dcmd_warn(playerid,params[])
{
new id, string[128],pName[MAX_PLAYER_NAME], p2Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red, "ERROR: You must be level 2");
if(sscanf(params,"uz",id)) return SendClientMessage(playerid, LGREEN, "USAGE: /warn [playerid] [reason]");
if(PInfo[id][Warnings] == MAX_WARNINGS)
{
GetPlayerName(id,p2Name, sizeof(p2Name));
format(string, sizeof (string),"%s has been kicked [Reason: %s](Warnings: %d/%d)",p2Name, params[2],PInfo[id][Warnings], MAX_WARNINGS);
SendClientMessageToAll(ORANGE,string);
Kick(id);
}
else
{
GetPlayerName(playerid,pName,sizeof(pName));
GetPlayerName(id,p2Name, sizeof(p2Name));
PInfo[id][Warnings]++;
format(string, sizeof(string), "Administrator %s has warned %s [Reason: %s][Warnings: %d/%d]",pName, p2Name, params[2], PInfo[id][Warnings], MAX_WARNINGS);
SendClientMessageToAll(ORANGE,string);
}
return 1;
}

, btw hi jeffry
)
|
new reason[100]; if(sscanf(params,"uz",id,reason)) |
|
Your paramater count is off. If you have two characters in where "uz" is, you need two things after the next comma.
|
|
Oh and by the way, you shouldn't use "z", it should be "s" - otherwise sscanf will give you a warning.
![]() |