I need a quick /ad command
#3

Quote:
Originally Posted by Don Correlli
Thanks for that, but i get an error with that code. Whats the problem, Heres the code

Код:
 if(strcmp("/ad", cmdtext, true, 3) == 0)
	{
	new PlayerMoney;
	PlayerMoney = GetPlayerMoney(playerid);
	if(PlayerMoney >= 500)
	{
	if(cmdtext[3] == 0)
	{
	SendClientMessage(playerid, COLOR_RED, "Usage: /ad [advertising]");
	return 1;
	}
	new string[128];
	new PlayerName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
	ResetPlayerMoney(playerid);
	GivePlayerMoney(playerid, PlayerMoney -500);
	format(string, sizeof(string), "%s (ID: %d) is advertising: %s", PlayerName, playerid, cmdtext[4]);
	SendClientMessageToAll(COLOR_RED, string);
	return 1;
	}
	return 1;
	}
heres the warning

Код:
(513) : warning 219: local variable "string" shadows a variable at a preceding level
Reply


Messages In This Thread
I need a quick /ad command - by killdahobo99 - 20.07.2009, 01:54
Re: I need a quick /ad command - by Correlli - 20.07.2009, 01:57
Re: I need a quick /ad command - by killdahobo99 - 20.07.2009, 02:04
Re: I need a quick /ad command - by Correlli - 20.07.2009, 02:05
Re: I need a quick /ad command - by killdahobo99 - 20.07.2009, 02:22
Re: I need a quick /ad command - by Grim_ - 20.07.2009, 02:29
Re: I need a quick /ad command - by Annihalation - 20.07.2009, 02:44
Re: I need a quick /ad command - by killdahobo99 - 20.07.2009, 02:57

Forum Jump:


Users browsing this thread: 1 Guest(s)