Player Money On Death - 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)
+--- Thread: Player Money On Death (
/showthread.php?tid=531882)
Player Money On Death -
TheLittleFucker - 15.08.2014
Hey Guys,
I'm only new at this and I was just wondering if its possible to change it so players don't lose any money on death?
I have researched but can't find anything

So if someone could help me out that would be great.
Re: Player Money On Death -
AIped - 15.08.2014
search in your gamemode for
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
if GivePlayerMoney is in there..remove it
Re: Player Money On Death -
[XST]O_x - 15.08.2014
pawn Код:
new money[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
money[playerid] = GetPlayerMoney(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, money[playerid]);
return 1;
}
Re: Player Money On Death -
TheLittleFucker - 15.08.2014
Thanks so much guys

Greatly appreciated.
Re: Player Money On Death -
TheLittleFucker - 15.08.2014
Quote:
Originally Posted by AIped
search in your gamemode for
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) {
return 1; }
if GivePlayerMoney is in there..remove it
|
Tried it, didn't work

I think I went wrong somewhere
Re: Player Money On Death -
TheLittleFucker - 15.08.2014
Quote:
Originally Posted by [XST]O_x
pawn Код:
new money[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason) { money[playerid] = GetPlayerMoney(playerid); return 1; }
public OnPlayerSpawn(playerid) { ResetPlayerMoney(playerid); GivePlayerMoney(playerid, money[playerid]); return 1; }
|
Yours will work, but I am having problems compiling it, Wont compile because "OnPlayerSpawn" is already used