Random Spawns And Money Detecting
#1

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

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
Reply
#3

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
Reply
#4

GetPlayerMoney(playerid)
Reply
#5

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;
}
Reply
#6

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;
Reply
#7

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)