12.01.2013, 16:50
Hey,
My warn command is very bugged. For example I warn somebody and he has 1/3 warnings, then I warn myself and I have 2/3 warnings. I warn somebody else and he has 3/3 warnings and he gets kicked even if he was warned one time. Or, everybody has 1/3 warnings at the text but still gets kicked when the count reaches 3. Example:
This is the command, I feel like warnid gets saved for everybody but I'm not sure how to fix it:
My warn command is very bugged. For example I warn somebody and he has 1/3 warnings, then I warn myself and I have 2/3 warnings. I warn somebody else and he has 3/3 warnings and he gets kicked even if he was warned one time. Or, everybody has 1/3 warnings at the text but still gets kicked when the count reaches 3. Example:
Код:
x has warned y (1/3) x has warned y (1/3) x has warned y (1/3) y has been kicked
pawn Код:
CMD:warn(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 1)
{
new warnid, reason[256], wNumber,
aName[MAX_PLAYER_NAME],
wName[MAX_PLAYER_NAME],
string[512];
wNumber = PlayerInfo[playerid][pWarns];
if(sscanf(params, "us[256]", warnid, reason)) return
SendClientMessage(playerid, COLOR_ORANGE, "[USAGE]{FFFFFF} /warn <playerid/name> <reason>");
if(!IsPlayerConnected(warnid)) return
SendClientMessage(playerid, COLOR_ERROR, "[ERROR]{FFFFFF} The playerid/name you have typen isn't connected.");
GetPlayerName(playerid, aName, sizeof(aName));
GetPlayerName(warnid, wName, sizeof(wName));
format(string, sizeof(string), "[WARN]{FFFFFF} Admin {33CFFF}'%s' {FFFFFF}has warned {33CFFF}'%s'{FF66A3}[ %s ( %d/3 ) ]", aName, wName, reason, wNumber);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
PlayerInfo[warnid][pWarns] += 1;
}else{
SendClientMessage(playerid, COLOR_ERROR, "[ERROR]{FFFFFF} Only level 2,3,4,5 admins can use this command.");
}
return 1;
}

