01.03.2014, 19:48
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".
Help would be highly appriciated!
Regards,
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;
}
Regards,