Posts: 55
Threads: 1
Joined: Aug 2008
Reputation:
0
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?
Posts: 47
Threads: 5
Joined: Jul 2008
Reputation:
0
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.
Posts: 446
Threads: 66
Joined: Mar 2008
Reputation:
0
public OnPlayerDeath
{
return 0;
}
This will stop you taking the other persons money when you kill them.
Posts: 47
Threads: 5
Joined: Jul 2008
Reputation:
0
Hi
Jofi
That worked but allways when I log out and back in get the same error
Posts: 159
Threads: 10
Joined: May 2009
Reputation:
0
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 )
Posts: 47
Threads: 5
Joined: Jul 2008
Reputation:
0
I use XAdmin, And the registration is in there.
And at:
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 1000);
I have
OnPlayerSpawn