09.02.2017, 20:47
PHP код:
CMD:scorefall(playerid, params[])
{
if(Dead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "[INFO] You can't use commands while being dead!");
new value;
if(PlayerInfo[playerid][pAdmin] <= 2) return SendClientMessage(playerid, COLOR_RED, "ERROR: Insufficient Permissions!");
if(sscanf(params, "d", value)) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "Usage: /Scorefall [Amount]");
if(value <= 0) return SendClientMessage(playerid, COLOR_RED, "Invalid Amount!");
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
new string[128];
format(string,sizeof(string),"Admin %s has given all players %d Score.",name, value);
SendClientMessageToAll(COLOR_YELLOW,string);
new s = GetPlayerScore(i);
SetPlayerScore(i, s+value);
format(string,sizeof(string),"~h~score all~n~~h~+%d score",value);
GameTextForAll(string,3000,3);
}
}
return 1;
}