Weird 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Weird problem (
/showthread.php?tid=148964)
Weird problem -
DevilRP - 19.05.2010
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerMoneyEx(playerid <10)){
GivePlayerMoneyEx(playerid, 750);
}
else
{
return 1;
}
etc...
I want to make it so if the player's money is ONLY smaller than 10 it will give him 750$
And when i use this^ Everytime i die i get 750, as if it doesnt recognize the getplayermoneyex, and i have no errors\warnings.
Re: Weird problem -
BLAbla93 - 20.05.2010
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerMoneyEx(playerid <10)){
GivePlayerMoneyEx(killerid, 750);
}
else
{
return 1;
}
Re: Weird problem -
ViruZZzZ_ChiLLL - 20.05.2010
ofc it won't give you any error, its just the
way of the code that gives you teh problem
and what do you mean by that?
Everytime i die i get 750, as if it doesnt recognize the getplayermoneyex
Do you want it to be give only once?
Quote:
Originally Posted by [T_S
DeStunter ]
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerMoneyEx(playerid <10)){
GivePlayerMoneyEx(killerid, 750);
}
else
{
return 1;
}
|
I don't see the difference between your code and his

nvm, saw it xD
Re: Weird problem -
Backwardsman97 - 20.05.2010
Why not just like this?
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerMoney(playerid) < 10)
{
GivePlayerMoney(killerid, 750);
return 1;
}
return 1;
}
Re: Weird problem -
DevilRP - 20.05.2010
i dont want the killer to get the money,
lets say i commit suicide, and i have 11$
i want it to do nothing,
but if i had 9$ or lower it will give me 750 when i spawn after the death
Re: Weird problem -
ViruZZzZ_ChiLLL - 20.05.2010
Quote:
Originally Posted by DevilRP
i dont want the killer to get the money,
lets say i commit suicide, and i have 11$
i want it to do nothing,
but if i had 9$ or lower it will give me 750 when i spawn after death
|
Then put the code under OnPlayerSpawn maybe?
Re: Weird problem -
DevilRP - 20.05.2010
I tryed it, it does the same, it gives me money even if i have 1000$
Re: Weird problem -
ViruZZzZ_ChiLLL - 20.05.2010
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerMoneyEx(playerid) < 10)){
GivePlayerMoneyEx(playerid, 750);
}
else
{
return 1;
}
That should work
Re: Weird problem -
DevilRP - 20.05.2010
Thanks, i got it to work, i had a problem with the money cheats, i had 2 so they colided
Re: Weird problem -
BLAbla93 - 20.05.2010
Lmao
Quote:
Originally Posted by DevilRP
Thanks, i got it to work, i had a problem with the money cheats, i had 2 so they colided
|
Re: Weird problem -
ViruZZzZ_ChiLLL - 20.05.2010
Quote:
Originally Posted by DevilRP
Thanks, i got it to work, i had a problem with the money cheats, i had 2 so they colided
|
LOL hmmkay xD
Pffttt.. Cheater xD