Weird problem
#1

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.
Reply
#2

Code:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerMoneyEx(playerid <10)){

GivePlayerMoneyEx(killerid, 750);
 }
else
{
return 1;
}
Reply
#3

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
Reply
#4

Why not just like this?

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
   if(GetPlayerMoney(playerid) < 10)
   {
     GivePlayerMoney(killerid, 750);
     return 1;
   }
   return 1;
}
Reply
#5

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
Reply
#6

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?
Reply
#7

I tryed it, it does the same, it gives me money even if i have 1000$
Reply
#8

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerMoneyEx(playerid) < 10)){

GivePlayerMoneyEx(playerid, 750);
 }
else
{
return 1;
}
That should work
Reply
#9

Thanks, i got it to work, i had a problem with the money cheats, i had 2 so they colided
Reply
#10

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
Reply
#11

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)