SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 19/05/2010, 11:54 PM   #1
DevilRP
Big Clucker
 
Join Date: May 2010
Posts: 115
Reputation: 0
Default Weird problem

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.
DevilRP is offline  
Old 20/05/2010, 12:00 AM   #2
BLAbla93
Huge Clucker
 
Join Date: Jan 2009
Posts: 213
Reputation: 4
Default Re: Weird problem

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

GivePlayerMoneyEx(killerid, 750);
 }
else
{
return 1;
}
BLAbla93 is offline  
Old 20/05/2010, 12:02 AM   #3
ViruZZzZ_ChiLLL
High-roller
 
ViruZZzZ_ChiLLL's Avatar
 
Join Date: Aug 2009
Location: I don't know
Posts: 1,645
Reputation: 8
Default Re: Weird problem

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
__________________


ViruZZzZ_ChiLLL is offline  
Old 20/05/2010, 12:03 AM   #4
Backwardsman97
High-roller
 
Backwardsman97's Avatar
 
Join Date: Nov 2007
Posts: 1,501
Reputation: 36
Default Re: Weird problem

Why not just like this?

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
   if(GetPlayerMoney(playerid) < 10)
   {
     GivePlayerMoney(killerid, 750);
     return 1;
   }
   return 1;
}
Backwardsman97 is offline  
Old 20/05/2010, 12:06 AM   #5
DevilRP
Big Clucker
 
Join Date: May 2010
Posts: 115
Reputation: 0
Default Re: Weird problem

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
DevilRP is offline  
Old 20/05/2010, 12:07 AM   #6
ViruZZzZ_ChiLLL
High-roller
 
ViruZZzZ_ChiLLL's Avatar
 
Join Date: Aug 2009
Location: I don't know
Posts: 1,645
Reputation: 8
Default Re: Weird problem

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?
__________________


ViruZZzZ_ChiLLL is offline  
Old 20/05/2010, 12:08 AM   #7
DevilRP
Big Clucker
 
Join Date: May 2010
Posts: 115
Reputation: 0
Default Re: Weird problem

I tryed it, it does the same, it gives me money even if i have 1000$
DevilRP is offline  
Old 20/05/2010, 12:09 AM   #8
ViruZZzZ_ChiLLL
High-roller
 
ViruZZzZ_ChiLLL's Avatar
 
Join Date: Aug 2009
Location: I don't know
Posts: 1,645
Reputation: 8
Default Re: Weird problem

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

GivePlayerMoneyEx(playerid, 750);
 }
else
{
return 1;
}

That should work
__________________


ViruZZzZ_ChiLLL is offline  
Old 20/05/2010, 12:18 AM   #9
DevilRP
Big Clucker
 
Join Date: May 2010
Posts: 115
Reputation: 0
Default Re: Weird problem

Thanks, i got it to work, i had a problem with the money cheats, i had 2 so they colided
DevilRP is offline  
Old 20/05/2010, 12:22 AM   #10
BLAbla93
Huge Clucker
 
Join Date: Jan 2009
Posts: 213
Reputation: 4
Default Re: Weird problem

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
BLAbla93 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
weird problem mige Help Archive 3 04/06/2010 06:46 PM
Really weird problem! Jokerstyle Help Archive 6 11/05/2010 05:44 PM
Weird problem!? playbox12 Help Archive 5 15/03/2010 08:09 PM
Weird Problem? Kirkmaster10 Everything and Nothing 1 06/06/2009 07:56 PM
Weird LAG Problem.. Please Help NoRCaLKiNG Client Support 4 02/05/2009 10:26 AM


All times are GMT. The time now is 09:01 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.