Where should i place this code...? - 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: Where should i place this code...? (
/showthread.php?tid=362944)
Where should i place this code...? -
Littlehelper - 26.07.2012
-NVM, fixed it myself.
Now using it on OnPlayerDeath callback.
Re: Where should i place this code...? -
CentyPoo - 26.07.2012
How exactly does the player get their EXP stat? Doesn't show what you've used for that.
Re: Where should i place this code...? -
Devilxz97 - 26.07.2012
i think that should be place on OnPlayerUpdate . . :\
Respuesta: Re: Where should i place this code...? -
HarlemSAMP - 26.07.2012
Quote:
Originally Posted by Devilxz97
i think that should be place on OnPlayerUpdate . . :\
|
+1 I'm pretty sure you have to set it up OnPlayerUpdate, i could help you more if explain a bit on how do you exactly rank up.
Re: Where should i place this code...? -
ReneG - 26.07.2012
timer lol?
Re: Where should i place this code...? -
Kitten - 26.07.2012
Never use OnPlayerUpdate for these kind of codes what i would do is create a simple stock like
pawn Код:
stock CheckRank(playerid)
{
if(YourXPvar >= 50) // or == depends on how your system works.
{
RankedUp(playerid);
PInfo[playerid][Rank] = 1;
}
return 1;
}
I'm not really sure about this but i'm sure you are using the EXP when he/she gets a kill if not do the same thing when that function gets called for that, if you are using it when he/she kills someone call CheckRank(killerid) on that person that kills another player.
Respuesta: Where should i place this code...? -
Bu11Sh0t - 26.07.2012
pawn Код:
public OnPlayerSpawn(playerid)
{
if(PInfo[playerid][EXP] == 100 && PInfo[playerid][Rank] == 0)
{
RankedUp(playerid);
PInfo[playerid][Rank] = 1;
}
// More code...
Re: Where should i place this code...? -
Littlehelper - 26.07.2012
Quote:
Originally Posted by Devilxz97
i think that should be place on OnPlayerUpdate . . :\
|
Quote:
Originally Posted by HarlemSAMP
+1 I'm pretty sure you have to set it up OnPlayerUpdate, i could help you more if explain a bit on how do you exactly rank up.
|
You guys need to do read what i said "Using it on OnPlayerUpdate spams You Ranked Up"
Quote:
Originally Posted by Kitten
Never use OnPlayerUpdate for these kind of codes
|
Yeah thanks, fixed it by using it OnPlayerDeath.