14.12.2013, 17:43
First you should have an admin system and saving stats to save your admin variable stats , also you need some plugins and includes (ZCMD- command processoring) which will help you creating this , once you done the admin enum you can check if the player who typed the command is an admin or not , and to get the correct usage of the command you need to use sscanf read more about that you need also to use a saving stats like (y_ini , MySQL , SQlite,and so on..) search for those saving player data processors and once you got that , try to search for tutorials on Tutorial section.
PS: If you don't want to use all what i said and use this command as rcon admin simply you can do this , but you need to download sscanf first !
PS: If you don't want to use all what i said and use this command as rcon admin simply you can do this , but you need to download sscanf first !
pawn Код:
CMD:ban(playerid, params[])
{
new id, reason[28];//here we declay a new variables , id is the player we want to ban him , reason is the reason of his ban
if(!IsPlayerAdmin(playerid)) SendClientMessageToAll(0xFF0000FF, "Error you need to be an admin to use this command");//here we are goning to check if the player rcon admin or not
else if(sscanf(params, "ds[28]", id, reason))SendClientMessage(playerid,-1,"{FF0000}System Usage: {FAF5F5}/ban [playerid] [reason]");//d is used for integer , s[28] means string with max letters 28 !
Ban(id);//here we are going to ban the player , you need to send client message with the reason , read more about formating strings!
return 1;
}