moneybag global variable issue
#1

Hello, I'm facing a problem as usual XD, I've declared a global variable for Money bag as the enum was causing problem with value 0 or 1..

Here's the code
Код:
//	if(pMoneyBag == 1)
//	{
	new RandMoney = random(2669);
 	GivePlayerMoney(playerid, RandMoney);
	new msg[128], sName[24];
	GetPlayerName(playerid, sName, 24);
	format(msg, 128, "%s(%d) has robbed $%d.", sName, playerid, RandMoney);
	SendClientMessageToAll(-1, msg);
//	}
/*	else if(pMoneyBag == 1)
	{
	new RandMoney = random(4969);
	GivePlayerMoney(playerid, RandMoney + 4969);
	new msg[128], sName[24];
	GetPlayerName(playerid, sName, 24);
	format(msg, 128, "%s(%d) has robbed $%d.", sName, playerid, RandMoney);
	SendClientMessageToAll(-1, msg);
	}
	
	*/
When I add these commented lines, neither does it give me money, nor does it sends a client message.


But when they are again COMMENTED, it works smooth..


Also, about the random money, in the first case, i want it to be 1600 - 2500.. I did use RandomEx, but it gave some errors.. so i switched back to this..
Reply


Messages In This Thread
moneybag global variable issue - by div - 23.06.2018, 02:37
Re: moneybag global variable issue - by div - 23.06.2018, 03:13
Re: moneybag global variable issue - by div - 23.06.2018, 03:18
Re: moneybag global variable issue - by div - 23.06.2018, 03:22
Re: moneybag global variable issue - by Verc - 23.06.2018, 04:09
Re: moneybag global variable issue - by div - 23.06.2018, 04:18
Re: moneybag global variable issue - by Verc - 23.06.2018, 04:21
Re: moneybag global variable issue - by div - 23.06.2018, 04:44
Re: moneybag global variable issue - by JasonRiggs - 23.06.2018, 07:37

Forum Jump:


Users browsing this thread: 4 Guest(s)