Posts: 1,241
Threads: 67
Joined: Dec 2013
Quote:
Originally Posted by Juvanii
Simple command of warning with kick able.
pawn Код:
new Warnings[MAX_PLAYERS]; //on top of your script
CMD:warn(playerid, params[]) { new targetid, reason[128], string[128]; if(PlayerInfo[playerid][pAdmin] == 0) return 0; if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, -1, "/warn [playerid/name] [reason]"); if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, -1, "This player is not connected."); if(targetid == playerid) return SendClientMessage(playerid,-1,"You cannot use this command on yourself.");
if(Warnings[targetid] < 4) { Warnings[targetid] ++; format(string, sizeof(string), "%s(%d) has been Warned by an Administrator, reason: %s", GetName(targetid), targetid, reason); SendClientMessageToAll(-1, string); } else //if warning = 5 it will kick player id { format(string, sizeof(string), "%s(%d) Has Been Kicked From The Server,t reason: so much warnings", GetName(targetid), targetid); SendClientMessageToAll(-1, string); Kick(targetid); } return 1; }
|
First of all he got his help and you don't need to re-bump it, You could answer to others.
Second, Copying a cmd from a gamemode you have downloaded won't help him to learn at all.