SA-MP Forums Archive
Money In First Spawn - 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 In First Spawn (/showthread.php?tid=46764)



Money In First Spawn - Unvisible11 - 11.08.2008

How I Change The Money Thate Player Spawn's with?(on him not in bank)
and if iil register to my server i got 50k in bank how can i change it so he will start with 500?(500 in bank not on him)?
P.S i use GF GM so i know i need to change something there but i dont know where there?


Re: Money In First Spawn - 56avenue - 11.08.2008

Quote:
Originally Posted by Unvisible11
P.S i use GF GM so i know i need to change something there but i dont know where there?
Mabey you should search the forum before posting.
All GF questions here


Re: Money In First Spawn - [SAPD]Bryan26 - 11.08.2008

Well for the part that gives them money on spawn, you can use this function....

pawn Код:
GivePlayerMoney(playerid, 5000);
As for the part the money in bank, i dont know you will have to goto the GF section....


Re: Money In First Spawn - Fenom - 23.06.2010

Hi I also have a problem.
When I spawn I allways get 1000$ (ive set it to that amount).
When i kill somone i get 1000$.
Lets say that i have 5000$ and somone kills me. Then when I respawn I get 1000$ again.

Can anyone tell me what do I need to do so when I die I will loose 1500$? And get 2000$ if I kill someone?

As I was looking through the gamemode code I found this, do I need to change anything in here to do that above?

-----------------------------------------------------------------
public OnPlayerDeath(playerid, killerid, reason)
{
new playercash;

if(killerid == INVALID_PLAYER_ID) {
ResetPlayerMoney(playerid);

} else
{
playercash = GetPlayerMoney(playerid);
if(playercash > 0)
{
GivePlayerMoney (killerid, playercash);
ResetPlayerMoney(playerid);
}
}
return 1;
}
-------------------------------------------------------------------

and at the beginning of the code there Is:

ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 1000);



Sorry for bad english.


Re: Money In First Spawn - acade - 23.06.2010

public OnPlayerDeath
{
return 0;
}
This will stop you taking the other persons money when you kill them.


Re: Money In First Spawn - Jofi - 23.06.2010

Quote:
Originally Posted by tom
Can anyone tell me what do I need to do so when I die I will loose 1500$? And get 2000$ if I kill someone?
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  new string[50];
  GivePlayerMoney(killerid, 2000); // $2000 For Killer
  SendClientMessage(killerid, 0xFFFFFFAA, "You earned $2000 for killing other player!");
  GivePlayerMoney(playerid, -1500); // $-1500 For Death Player
  SendClientMessage(playerid, 0xFFFFFFAA, "You died and lose $1500!");
  SendDeathMessage(killerid,playerid,reason);
}
Not Sure Does It Work,
but it should Give $2,000 For Killer And Take $1,500 From Player Who Died And Send DeathMessage



Re: Money In First Spawn - Fenom - 23.06.2010

Hi
Jofi
That worked but allways when I log out and back in get the same error


Re: Money In First Spawn - Jofi - 23.06.2010

Where you got

ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 1000);

OnPlayerSpawn or OnPlayerConnect ... ?
( And do you have registration in your script? Because you need it to save moneys )


Re: Money In First Spawn - Fenom - 23.06.2010

I use XAdmin, And the registration is in there.

And at:

ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 1000);

I have
OnPlayerSpawn


Re: Money In First Spawn - Jofi - 23.06.2010

Quote:
Originally Posted by tom
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 1000);

OnPlayerSpawn
Well Remove that..