SA-MP Forums Archive
Random Spawns And Money Detecting - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random Spawns And Money Detecting (/showthread.php?tid=109356)



Random Spawns And Money Detecting - [03]Garsino - 19.11.2009

How do I make random spawns for players?
And how do I check if a player got enough money to buy something?


Re: Random Spawns And Money Detecting - [LCG]TANKER - 19.11.2009

best way is GetPlayerMoney and for the random spawn take a look at this example

https://sampwiki.blast.hk/wiki/Random
it will help you greatly with spawns and anything else that is related to being random :P

like if(GetPlayerMoney[playerid] == "500") dont quote me on that as im just throwing it out


Re: Random Spawns And Money Detecting - [03]Garsino - 19.11.2009

Quote:
Originally Posted by [LCG
TANKER ]
best way is GetPlayerMoney and for the random spawn take a look at this example

https://sampwiki.blast.hk/wiki/Random
it will help you greatly with spawns and anything else that is related to being random :P
Thanks


Re: Random Spawns And Money Detecting - Calon - 19.11.2009

GetPlayerMoney(playerid)


Re: Random Spawns And Money Detecting - [03]Garsino - 20.11.2009

Didnt get it completly working. So could anyone modify this EXAMPLE code and then I'll see how its build?

pawn Код:
if (strcmp(cmdtext, "/testcmd", true) == 0)
{
    GivePlayerWeapon(playerid,46,1); // Parachute with 1 ammo. I want the person to pay $2500 for it and it detect if the person got enough money or it will prevent him from buying..

  return 1;
}



Re: Random Spawns And Money Detecting - [LCG]TANKER - 20.11.2009

try this, untested

Код:
if (strcmp(cmdtext, "/testcmd", true) == 0)
{
	if(GetPlayerMoney(playerid) => 2500)
	{	
		GivePlayerWeapon(playerid,46,1); // Parachute with 1 ammo. I want the person to pay $2500 for it and it detect if the person got enough money or it will prevent him from buying..
		return 1;
	}
	else
	{
		// not enought money message
        return 1;
	}
}
return 0;



Re: Random Spawns And Money Detecting - [03]Garsino - 20.11.2009

Quote:
Originally Posted by [LCG
TANKER ]
try this, untested

Код:
if (strcmp(cmdtext, "/testcmd", true) == 0)
{
	if(GetPlayerMoney(playerid) => 2500)
	{	
		GivePlayerWeapon(playerid,46,1); // Parachute with 1 ammo. I want the person to pay $2500 for it and it detect if the person got enough money or it will prevent him from buying..
		return 1;
	}
	else
	{
		// not enought money message
        return 1;
	}
}
return 0;
GTA967 helped me with a good way. Thanks for trying to help tho!