Help with Command to supply all cars
#6

Код:
CMD:fillcars(playerid,params[])
{
	if( PlayerInfo[playerid][pAdmin] < 2 || PlayerInfo[playerid][pMod] < 2 || PlayerInfo[playerid][pDono] < 2)
	return SendClientMessage(playerid,red,"| ERROR | You don't have permission!");
	new quantity, stringgas[130];
	if(sscanf(params, "i", quantity)) return SendClientMessage(playerid, red, "Use: /fillcars [quantity]");
	if(quantity< 0 || quantity> 100) return SendClientMessage(playerid, red, "| ERROR | The maximum amount of gas is 100!");
	format(stringgas, sizeof(stringgas), "AdmCmd: You supplied % d liter on all cars of San Andreas", quantity);
	SendClientMessage(playerid, blue, stringgas);
	for ( new c = 1 ; c < MAX_VEHICLES ; c ++)
	{
		carfuel[c] += quantity;
	}
	return 1;
}
Fixed the if(PlayerInfo.. etc, your code makes players that are not admin able to use this command as well
Reply


Messages In This Thread
Help with Command to supply all cars - by LucasDias - 09.06.2015, 14:02
Re: Help with Command to supply all cars - by Konstantinos - 09.06.2015, 14:04
Re: Help with Command to supply all cars - by LucasDias - 09.06.2015, 14:11
Re: Help with Command to supply all cars - by Richie© - 09.06.2015, 14:15
Re: Help with Command to supply all cars - by Konstantinos - 09.06.2015, 14:17
Re: Help with Command to supply all cars - by JaydenJason - 09.06.2015, 14:26
Re: Help with Command to supply all cars - by Threshold - 09.06.2015, 15:56
Re: Help with Command to supply all cars - by LucasDias - 09.06.2015, 17:00
Re: Help with Command to supply all cars - by Threshold - 09.06.2015, 17:44

Forum Jump:


Users browsing this thread: 1 Guest(s)