25.05.2017, 08:28
PHP код:
CMD:giveallscore(playerid,params[])
{
if(Spawned[playerid] == 0) return SendClientMessage(playerid, 0xf8f8f8fff,"ERROR: {F00f00}You can't use this command while you are not spawned!");
if(PlayerInfo[playerid][pAdmin] >= 5)
{
new string[128];
new amount;
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname,sizeof(pname));
if(sscanf(params,"i",amount)) return SCM(playerid, 0xf8f8f8fff,"Syntax: {f00f00}/giveallscore <amount>");
if(amount < 0 || amount > 900000) return SCM(playerid, 0xf8f8f8fff,"ERROR: {FFFFFF}900000 is high amount can be used!");
foreach(Player, i)
{
SetPlayerScore(GetPlayerScore(i), amount);
format(string,sizeof(string),"{ffa700}Administrator {f00f00}%s {ffa700}has given all {f00f00}%d {ffa700}score!",pname,amount);
SendClientMessage(i, -1, string);
}
}
else
{
SCM(playerid, 0xf8f8f8fff,"ERROR: {FFFFFF}You aren't authorized to use this command!");
}
return 1;
}