Author Topic: Static help needed! I am making scripts gups v5  (Read 9790 times)

0 Members and 1 Guest are viewing this topic.

Offline Terminatorupgrade 2

  • Wiseguy
  • **
  • Posts: 91
  • pawno scripter
    • View Profile
Re: Static help needed! I am making scripts gups v5
« Reply #15 on: December 03, 2010, 09:18:36 am »
Please any one Can do Code? ;D from any script

Offline Terminatorupgrade 2

  • Wiseguy
  • **
  • Posts: 91
  • pawno scripter
    • View Profile
Re: Static help needed! I am making scripts gups v5
« Reply #16 on: December 13, 2010, 03:17:40 pm »
please reply.tommis!

Offline Madara

  • Street Thug
  • *
  • Posts: 48
    • View Profile
Re: Static help needed! I am making scripts gups v5
« Reply #17 on: December 14, 2010, 05:16:06 am »
First download this link:http://www.mediafire.com/?jnr27599hribuio, brings in a folder that says "Banneds" you put that folder in the folder "scriptfiles" (if you do not, create it). and paste these 4 functions in your "GameMode":

Code: [Select]
public InfoPlayerBanned(playerid)
{
new IP[256],MSN[256],BAN;
  GetPlayerIp(playerid,IP,256);
  BAN = dini_Int("/Banneds/Banlist.ini",IP);//find IP in the list.
  if(BAN == 1){// if the IP in the list is 1, kick player (1 = true, 0 = false)
              format(MSN,256,">> Server Auto-Kick: %s - Reason: [IP Banned]",gPlayers[playerid]);
              SendClientMessageToAll(BLUE,MSN);
            Kick(playerid);//kick player :P
                    }
}

public PlayerBanIP(playerid,admin,reason[])
{
        new IP[256],MSN[256],inf[256];
        GetPlayerIp(playerid,IP,256);
        format(inf,256,"1 %s %s %s",gPlayers[playerid],gPlayers[admin],reason);//info to archive player banned
        dini_Set("/Banneds/Banlist.ini",IP,inf);//send to ban list
        dini_Set("/Banneds/PlayerBanlist.ini",gPlayers[playerid],IP);//send to player and IP
        format(MSN,256,">> Admin %s Banned: %s, ID: %d, Reason:%s",gPlayers[admin],gPlayers[playerid],playerid,reason);
        SendClientMessageToAll(BLUE,MSN);
        Kick(playerid);//kick player xP
}

public PlayerUnBanIP(player[],admin,reason[])
{
new MSN[256],IP[256],param[2][128];
IP = dini_Get("/Banneds/PlayerBanlist.ini",player);
        split(dini_Get("/Banneds/Banlist.ini",IP), param, ' ');
        format(MSN,256,">> Admin %s Un-Banned: %s, Reason:%s",gPlayers[admin],param[1],reason);
        SendClientMessageToAll(BLUE,MSN);
        dini_Unset("/Banneds/Banlist.ini",IP);//remove IP banned the list
        dini_Unset("/Banneds/PlayerBanlist.ini",player);//remove the name list
}

public IsPlayerBanned(player[])
{
new ispb[256];
ispb = dini_Get("/Banneds/PlayerBanlist.ini",player);//find IP to check list banneds
return (strcmp(ispb, "0", true) == 0) ? false : true;//checks the existence of the player or not
}

Now, in function "public OnPlayerConnect (playerid)," hit this InfoPlayerBanned (playerid), which would be more or less if:

Code: [Select]
public OnPlayerConnect(playerid)
{
  InfoPlayerBanned(playerid);
return 1;
}

Now paste these 2 commands in function "public OnPlayerCommandText (playerid, cmdtext [])":

Code: [Select]
   else if (strcmp(cmd, "ban", true) == 0) {
new plr,reason[256];
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp), reason = strtok(cmdtext, idx);
if (!strlen(reason)) SendClientMessage(playerid,GREEN,"** pm >> [Syntax] - The correct use: /c ban <player> <reason>");
   else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,GREEN,"** pm >> [Error] - Unknown player.");
else {
                 PlayerBanIP(plr,playerid,cmdtext[strval(reason)+strlen(tmp)+4]);
}
return 1;
     }

    else if (strcmp(cmd, "unban", true) == 0) {
new reason[256];
tmp = strtok(cmdtext, idx), reason = strtok(cmdtext, idx);
if (!strlen(reason)) SendClientMessage(playerid,GREEN,"** pm >> [Syntax] - The correct use: /c unban <player> <reason>");
   else if (!IsPlayerBanned(tmp)) SendClientMessage(playerid,GREEN,"** pm >> [Error] - This player is't banned, insert full name.");
else {
                PlayerUnBanIP(tmp,playerid,cmdtext[strval(reason)+strlen(tmp)+6]);
}
return 1;
     }

Credits: YO (Madara)  :o

You must remember, that if these two commands will stick where you have more commands and Hass and started one with "if ", the two commands would begin with "else if ".
Now only question that you put a line reference, that only admins can use these 2 commands.

Hope that helps, if you have any doubts, let me know if you are using GUPS scripts, and you can not get on your GM do, let me know to do so in ways that command is in GUPS, but if you do it yourself pudistes , Good luck.

Greetings ;)
« Last Edit: December 14, 2010, 05:31:46 am by Madara »

Offline Terminatorupgrade 2

  • Wiseguy
  • **
  • Posts: 91
  • pawno scripter
    • View Profile
Re: Static help needed! I am making scripts gups v5
« Reply #18 on: December 14, 2010, 05:32:59 pm »
Quote
[Syntax] - The correct use: /c unban <player> <reason>");

Why Reason is Needed in unban!??

Offline Madara

  • Street Thug
  • *
  • Posts: 48
    • View Profile
Re: Static help needed! I am making scripts gups v5
« Reply #19 on: December 14, 2010, 06:35:03 pm »
Online :o, well,when "unban" a player must be a reason of "unban"

Offline Terminatorupgrade 2

  • Wiseguy
  • **
  • Posts: 91
  • pawno scripter
    • View Profile
Re: Static help needed! I am making scripts gups v5
« Reply #20 on: December 14, 2010, 06:43:08 pm »
thanks.... ;D ;D

like i do

/c unban fullnick unbanned

Offline Madara

  • Street Thug
  • *
  • Posts: 48
    • View Profile
Re: Static help needed! I am making scripts gups v5
« Reply #21 on: December 14, 2010, 06:54:05 pm »
In fullnick, need insert full name previously saved in the list of bans,if you do not write the full name of player or if it's not on the list, this will send a message of non-existence of the player, for example, I "ban" to David, when using "unban", write the full name of that.

Quote
/c unban david blablablabla

What is your server?
« Last Edit: December 14, 2010, 07:01:34 pm by Madara »

Offline Terminatorupgrade 2

  • Wiseguy
  • **
  • Posts: 91
  • pawno scripter
    • View Profile
Re: Static help needed! I am making scripts gups v5
« Reply #22 on: December 14, 2010, 08:21:54 pm »
OMG thanks.. :)
i have a Zombie server! and other normal server

yazeen

  • Guest
Re: Static help needed! I am making scripts gups v5
« Reply #23 on: March 11, 2011, 08:33:13 am »
Its not GivePlayerCash its SetPlayerCash(playerid,-500);

 :P

yazeen

  • Guest
Re: Static help needed! I am making scripts gups v5
« Reply #24 on: March 11, 2011, 08:46:57 am »
Quote
[Syntax] - The correct use: /c unban <player> <reason>");

Why Reason is Needed in unban!??

Caz if wrongly banned or

eg: /c unban yaz [1 more time u hack and not more unban]

Offline BIG[H]

  • Made Man
  • ***
  • Posts: 159
  • Sight of light
    • View Profile
Re: Static help needed! I am making scripts gups v5
« Reply #25 on: March 11, 2011, 04:41:55 pm »
@yazeen man its in  GUPS DecPlayerHandCash(playerid,amount);
Outdoor city server Administrator, FS server owner!

yazeen

  • Guest
Re: Static help needed! I am making scripts gups v5
« Reply #26 on: March 12, 2011, 09:31:05 am »
@yazeen man its in  GUPS DecPlayerHandCash(playerid,amount);

oh ok