SA-MP Forums Archive
money - 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: money (/showthread.php?tid=91070)



money - Geekzor - 12.08.2009

guys how i can make : atm i have OnPlayerSpawn give player money 100

than allways whn i die etc i get 100$+ and again and again or when i quit the game and come back it give me 100$

how i can make this money on player spawn wont give it again 100+ when i spawn or something ...


Re: money - V1ceC1ty - 12.08.2009

you have GivePlayerMoney on, OnPlayerSpawn so everytime they spawn they will get 100+

you can try put it in playerclasses or onplayerconnect which will only give it to them once when they connect.


Re: money - soxfan - 12.08.2009

Top of your script add:

Код:
new spawncash[MAX_PLAYERS];
OnPlayerConnect
Код:
spawncash[playerid] = 0;
Then you can do this on spawn.

Код:
public OnPlayerSpawn(playerid)
{
  if(spawncash[playerid] == 0)
   {
   GivePlayerMoney(playerid, 100);
   spawncash[playerid] = 1;
   }
}



Re: money - James_Alex - 12.08.2009

or you can use
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
GivePlayerMoney(playerid, 100);
return 1;
}
this gives the player $100 ammount of money when he finish requesting class !


Re: money - sandisk125 - 12.08.2009

the best way you can do this is:
Quote:

public OnPlayerSpawn(playerid)
{
GivePlayerMoney(playerid,100);
return 1;
}




Re: money - WrathOfGenesis - 12.08.2009

Soxfans sugestion is best so far because it does exactly what he wants. He wanted a script to give a player money but only on their first spawn.