Posts: 1,241
Threads: 67
Joined: Dec 2013
pawn Код:
if(strcmp(cmd, "/warn", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /warn [id] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= AdminLevel)
{
Posts: 323
Threads: 79
Joined: Sep 2013
Reputation:
0
well i know the basics,but i need someone give me an example of warn command and deletewarns and explain
Posts: 1,241
Threads: 67
Joined: Dec 2013
Give player warn.
pawn Код:
PlayerInfo[giveplayerid][pWarned] = 1;
So admins doesn't do this on higher level.
pawn Код:
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* You can not ban People that is higher Than You!");
Posts: 323
Threads: 79
Joined: Sep 2013
Reputation:
0
thanks clad for helping me
Posts: 1,241
Threads: 67
Joined: Dec 2013
Quote:
Originally Posted by Youssef214
thanks clad for helping me
|
You're welcome

.
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.