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;
}
format(str, sizeof(str), "Administrator %s has set your kills to %d", adminname, amount);
format(str, sizeof(str), "Administrator (%d) %s has set your kills to %d", playerid, adminname, amount);
format(str, sizeof(str), "You have set %s's kills to %d", playername, amount);
format(str, sizeof(str), "You have set (%d) %s's kills to %d", giveplayerid, playername, amount);
Originally Posted by _Saif_
i dont exactly know but did u tried %s instead %d or %f ? if no then try it
|
Originally Posted by Babul
your format is getting 2 variables, you gave it 3...
Код:
format(str, sizeof(str), "Administrator %s has set your kills to %d", adminname, amount); Код:
format(str, sizeof(str), "Administrator (%d) %s has set your kills to %d", playerid, adminname, amount); Код:
format(str, sizeof(str), "You have set %s's kills to %d", playername, amount); Код:
format(str, sizeof(str), "You have set (%d) %s's kills to %d", giveplayerid, playername, amount); |