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



onplayerspawn problem - jop9888 - 17.04.2012

hee all,

i got a problem wich involves onplayerspawn,

everytime i type /kill and spawn, i lose $100 at spawn
while i'm pretty sure there's nothing there like GivePlayerMoney(playerid, -100);

anyone got an idea?

thanks in advance,

Jop9888


Respuesta: onplayerspawn problem - TiNcH010 - 17.04.2012

Don't you have any variable that is activated when you die and give you money with that variable?
Example:
pawn Код:
// OnPlayerDeath:

Variable[playerid] -= 1000;

// OnPlayerSpawn:

GivePlayerMoney(playerid, Variable[playerid]);



Re: onplayerspawn problem - Skribblez - 18.04.2012

It's default to lose $100 every time a player dies if you don't have any code that counters it under OnPlayerDeath
Best thing to do is to get the player's money and set it to that amount.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new pmoney = GetPlayerMoney(playerid);
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, pmoney);
    return 1;
}



Respuesta: onplayerspawn problem - TiNcH010 - 18.04.2012

No is not ¬¬
I don't have this problem.


Re: onplayerspawn problem - Skribblez - 18.04.2012

Well, I've had it too and it seemed like it's default. Maybe you don't have it since you're already taking away from a player's money when they die.


Re: onplayerspawn problem - admantis - 18.04.2012

Tincho you don't have the problem because you probably have an anti-money hack which will automatically set the money to the correct one because the -$100 is a server side issue. These who have played the singleplayer game will see how they will lose $100 when they are sent to hospital, well the same happens here, it's a thing hardcoded into San Andreas.


Respuesta: Re: onplayerspawn problem - TiNcH010 - 18.04.2012

Quote:
Originally Posted by admantis
Посмотреть сообщение
Tincho you don't have the problem because you probably have an anti-money hack which will automatically set the money to the correct one because the -$100 is a server side issue. These who have played the singleplayer game will see how they will lose $100 when they are sent to hospital, well the same happens here, it's a thing hardcoded into San Andreas.
Okay, but I don't have an anti-money hack which set the money correctly :S (yes, I have on my server but not happend this).


Re: onplayerspawn problem - jop9888 - 19.04.2012

i'm sure that NEVER in my script i take $100 from a player, and indeed it only happens when a player spawn after death, i'll try your idea scribbels, thanks for the help all!