14.11.2012, 09:28
pawn Code:
new WarnTimes[MAX_PLAYERS];
NOTE: I Will Explain How To Use in ZCMD, You Can Change It.....
pawn Code:
command(warn, playerid, params[])
{
return 1;
}
pawn Code:
command(warn, playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
return 1;
}
}
pawn Code:
command(warn, playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new i, reason[50];
new name[50];
new string[250];
if(sscanf(params, "us[50]", i, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /warn [id] [reason]");
else if(i == INVALID_PLAYER_ID) SendClientMessage(playerid, ROJO, "Player is not connected!");
else
{
return 1;
}
}
}
This Is Used To Give The USAGE and check if id is online

pawn Code:
GetPlayerName(i, name, sizeof(name));
if(playerid!=i)
{
pawn Code:
if(WarnTimes[i]>=2)
{
format(string, 256,"[AUTO-KICK]: %s[%d] Has Been Kicked From The Server, [3/3 Warnings]", name, i);
SendClientMessageToAll(AC, string);
SetPlayerHealth(i, 999999999);
SetPlayerInterior(i, 10);
SetPlayerPos(i,226.9807,111.1730,999.0156);
format(string, sizeof(string), "~W~You Have Been ~R~Kicked ~W~From The Server");
GameTextForPlayer(i ,string, 99999999999999999999999, 3);
Kick(i);
}
pawn Code:
else
{
WarnTimes[i]+=1;
if(WarnTimes[i]==1)
{
format(string, 256,"[ADMIN-WARN]: You Have Received A Warning, Reason: %s, [1/3 Warnings]", reason);
SendClientMessage(i, AC, string);
}
else if(WarnTimes[i]==2)
{
format(string, 256,"[ADMIN-WARN]: You Have Received A Warning, Reason: %s, [2/3 Warnings]", reason);
SendClientMessage(i, AC, string);
}
format(string, 256,"[ADMIN-WARN]: %s[%d] Has Received A Warning, Reason: %s", name, i, reason);
SendClientMessageToAll(AC, string);
GameTextForPlayer(i,"~W~You Have Received A ~n~ ~R~Warning",5000,3);
}
else if(war......) is to send message for player 1/3 warning 2/3 etc....
pawn Code:
command(warn, playerid, params[])
{
if(SInfo[playerid][pAdmin] >= 1)
{
new i, reason[50];
new name[50];
new string[250];
if(sscanf(params, "us[50]", i, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /warn [id] [reason]");
else if(i == INVALID_PLAYER_ID) SendClientMessage(playerid, ROJO, "Player is not connected!");
else
{
GetPlayerName(i, name, sizeof(name));
if(playerid!=i)
{
if(WarnTimes[i]>=2)
{
format(string, 256,"[AUTO-KICK]: %s[%d] Has Been Kicked From The Server, [3/3 Warnings]", name, i);
SendClientMessageToAll(AC, string);
SetPlayerHealth(i, 999999999);
SetPlayerInterior(i, 10);
SetPlayerPos(i,226.9807,111.1730,999.0156);
format(string, sizeof(string), "~W~You Have Been ~R~Kicked ~W~From The Server");
GameTextForPlayer(i ,string, 99999999999999999999999, 3);
Kick(i);
}
else
{
WarnTimes[i]+=1;
if(WarnTimes[i]==1)
{
format(string, 256,"[ADMIN-WARN]: You Have Received A Warning, Reason: %s, [1/3 Warnings]", reason);
SendClientMessage(i, AC, string);
}
else if(WarnTimes[i]==2)
{
format(string, 256,"[ADMIN-WARN]: You Have Received A Warning, Reason: %s, [2/3 Warnings]", reason);
SendClientMessage(i, AC, string);
}
format(string, 256,"[ADMIN-WARN]: %s[%d] Has Received A Warning, Reason: %s", name, i, reason);
SendClientMessageToAll(AC, string);
GameTextForPlayer(i,"~W~You Have Received A ~n~ ~R~Warning",5000,3);
}
}
else SendClientMessage(playerid, COLOR_RED, "You Can't Warn Your Self");
}
}
else SendClientMessage(playerid, COLOR_RED, "[Command Not Found Use /cmds or /commands.!]");
return 1;
}