function doesn't effect
#8

Quote:
Originally Posted by Macronix
Посмотреть сообщение
There you go:

Код:
CMD:scorefall(playerid, params[])
{
	if(Dead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "[INFO] You can't use commands while being dead!");
	
	new value, name[MAX_PLAYER_NAME], string[128], string2[128];
	
	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))
		{
			SetPlayerScore(i, GetPlayerScore(i) + value);
		}
	}
	
	GetPlayerName(playerid,name,sizeof(name));
	format(string,sizeof(string),"Admin %s has given all players %d Score.",name, value);
	SendClientMessageToAll(COLOR_YELLOW,string);
	
	format(string2,sizeof(string2),"~h~scoref all~n~~h~+%d score",value);
	GameTextForAll(string2,3000,3);
	
	return 0;
}
Thanks a lot! +repped
Reply


Messages In This Thread
function doesn't effect - by rakinz - 09.02.2017, 20:32
Re: function doesn't effect - by Macronix - 09.02.2017, 20:43
Re: function doesn't effect - by iLearner - 09.02.2017, 20:47
Re: function doesn't effect - by rakinz - 10.02.2017, 15:15
Re: function doesn't effect - by iLearner - 10.02.2017, 15:32
Re: function doesn't effect - by rakinz - 10.02.2017, 15:38
Re: function doesn't effect - by Macronix - 10.02.2017, 15:55
Re: function doesn't effect - by rakinz - 10.02.2017, 16:31

Forum Jump:


Users browsing this thread: 2 Guest(s)