SA-MP Forums Archive
Ban Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Ban Command (/showthread.php?tid=498049)



Ban Command - Vasu99 - 01.03.2014

Hey, I've scouted through the tutorial section of the forums a bit but I simply can't seem to find any tutorial regarding a ban system? Therefore I'd love it if anyone could help me out with a ban system, somehow. Perhaps send me a tutorial that I haven't found, or something? It'd be awesome!

Regards,


Re: Ban Command - Clad - 01.03.2014

Use ******


Re: Ban Command - Bingo - 01.03.2014

https://sampforum.blast.hk/showthread.php?tid=401701

Here.


Re: Ban Command - Vasu99 - 01.03.2014

Thanks guys, but I used my old script for kicking a player and turned it into a ban system. Ironically the ban command now works as a kick, due to the fact that the player can log in again after he's been "banned".

pawn Код:
CMD:ban(playerid,params[])
{
    if(PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid, 0xF69521AA, "You can't use this command!");//Checking if the player has admin level 1, if not it sends him a message.
    new id;//Creating a variable to store the selected id;
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,0xF69521AA,"USAGE: /ban [id]");//Checking if the player has selected an id, other wise it sends him a message. We used the "u" specifier, because he can put a name or an id.
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xF69521AA,"That player is not connected!");//Checking if the selected user is connected or not.
    Ban(id);
    SendClientMessage(playerid,0xF69521AA,"You have successfully banned the selected user from La Ville De L'Isle Roleplay!"); // Sends the admin a message.
    return 1;
}
Help would be highly appriciated!

Regards,