Hi all... i know "gups contain many bugs, one example "register,givecash,deposit not show you real deposit,lockcars,ban system.... So now i fixed the ban system... only follow the steps xD[pawn]public OnPlayerConnect(playerid)
{
InfoBanned(playerid);[/pawn]
[pawn]public OnPlayerCommandText(playerid, cmdtext[ ])
{
else if (strcmp(cmd, "ban", true) == 0) {
new razon[256], plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp), razon = strtok(cmdtext, idx);
if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, 0xF0182DFF, "Not have acces to this command" );
else if (!strlen(razon)) SendClientMessage(playerid, 0xFFFF00AA,"[Error] - Write: /c ban <id/name> <reason>.");
else if (plr == INACTIVE_PLAYER_ID)SendClientMessage(playerid, 0xF0182DFF,"[Error] - unknown player.");
else {
BaneoIP(plr,"Admin",gPlayers[playerid],cmdtext[strval(razon)+strlen(tmp)+4]);
}
return 1;
}
else if (strcmp(cmd, "unban", true) == 0) {
new razon[256];
tmp = strtok(cmdtext, idx), razon = strtok(cmdtext, idx);
if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, 0xF0182DFF, "Not have acces to this command" );
else if ( !strlen(tmp)) SendClientMessage(playerid, 0xFFFF00AA,"[Error] - Write: /c unban <Full name>.");
else if (!IfPlayerBanned(tmp)) SendClientMessage(playerid, 0xFFFF00AA,"[Error] - not is in the banned list");
else {
DesbaneoIP(tmp,gPlayers[playerid],cmdtext[strval(razon)+strlen(tmp)+6]);
}
return 1;
}
[/pawn]
[pawn]
//==============================================================================
public InfoBanned(playerid)
{
new IP[256],BAN,String[256];
GetPlayerIp(playerid,IP,256);
BAN = dini_Int("/Banned/BannedList.ini",IP);
if(BAN == 1){
format( String, sizeof( String ), "Auto-Kick: player %s - Reason:[IP Banned of server].",gPlayers[playerid]);
SendClientMessageToAll(0xFFFF00AA, String );
Kick(playerid);
}
}
//==============================================================================
public IfPlayerBanned(player[ ])
{
new ispb[256];
ispb = dini_Get("/Banned/PlayerBanned.ini",player);
return (strcmp(ispb, "0", true) == 0) ? false : true;
}
//==============================================================================
public BaneoIP(playerid,type[ ],admin[ ],reason[ ])
{
new IP[256],inf[256],String[256];
GetPlayerIp(playerid,IP,256);
format(inf,256,"1 %s %s %s",gPlayers[playerid],admin,reason);
dini_Set("/Banned/BannedList.ini",IP,inf);
dini_Set("/Banned/PlayerBanned.ini",gPlayers[playerid],IP);
format( String, sizeof( String )," %s %s is banned player: %s, ID: %d, Reason:[%s ].",type,admin,gPlayers[playerid],playerid,reason);
SendClientMessageToAll(0xFFFF00AA, String );
Kick(playerid);
}
//==============================================================================
[/pawn]
public DesbaneoIP(player[ ],admin[ ],reason[ ])
{
new IP[256],param[2][128],String[256];
IP = dini_Get("/Banned/PlayerBanned.ini",player);
split(dini_Get("/Banned/BannedList.ini",IP) , param , ' ' );
format( String, sizeof( String ), "Admin %s Remove ban player: %s, Reason:[%s ].",admin,param[1],reason);
SendClientMessageToAll(0xFFFF00AA, String );
dini_Unset("/Banned/BannedList.ini",IP);
dini_Unset("/Banned/PlayerBanned.ini",player);
return 1;
}
//==============================================================================
SORRY public desbaneo ip showme wrong the command whit pawno code, so i put only whit normal words xD but... copy all!Download the banned folderhttp://www.mediafire.com/?0yg0zwpxa55mb8jYou need delete the commands "ban and banip"
and of onplayerconnect
need delete
line "ipbans" to return
}
Put the banned folder inside of scriptfilesVIDEO!
http://www.youtube.com/watch?v=DFTWivr1qXc&feature=youtu.beSORRY my bad english but... thank me... some times....