14.03.2010, 15:31
Seriously, I have no idea what's wrong with this command... It IS working, but showing something wrong (ClientMessage).
It sets the kills to the amount I want but says:
''Adminstrator [UF]DarkPhoenix has set your kills to 1'' when I set it to 500.
It sets the kills to the amount I want but says:
''Adminstrator [UF]DarkPhoenix has set your kills to 1'' when I set it to 500.
pawn Код:
dcmd_setkills(playerid, params[])
{
if(pInfo[playerid][pAdmin] < 5) return SystemMessage(playerid, "You are not an Administrator with the required level.");
new amount, str[128];
if(sscanf(params, "ud", giveplayerid, amount)) return SystemMessage(playerid, "[USAGE] ''/setkills [playername/id] [amount]''.");
if(!IsPlayerConnected(giveplayerid)) return SystemMessage(playerid, "This player is not active.");
if(amount < 0) return SystemMessage(playerid, "Invalid amount!");
GetName(giveplayerid, playername);
GetName(playerid, adminname);
pInfo[giveplayerid][pKills] = amount;
SetPlayerScore(giveplayerid, amount);
format(str, sizeof(str), "Administrator %s has set your kills to %d", adminname, playerid, amount);
SystemMessage(giveplayerid, str);
format(str, sizeof(str), "You have set %s's kills to %d", playername, giveplayerid, amount);
SystemMessage(playerid, str);
return 1;
}