Rank - 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: Rank (
/showthread.php?tid=142290)
Rank -
ScottCFR - 17.04.2010
How can i make it so when someone makes a rank on my server it doesn't keep spam "New Rank! Killah!"
pawn Код:
if(GetPlayerScore(playerid) == 100)
{
GameTextForPlayer(playerid, "New Rank! Killah!", 5000, 5);
return 1;
}
Re: Rank -
Calgon - 17.04.2010
pawn Код:
if(GetPlayerScore(playerid) == 100)
{
SetPlayerScore( playerid, 101 );
GameTextForPlayer(playerid, "New Rank! Killah!", 1000, 5);
return 1;
}
There are better ways, but that'll do.
Re: Rank -
Dark_Kostas - 17.04.2010
pawn Код:
if(GetPlayerScore(playerid) == 100)
{
if(GetPVarInt(playerid, "100Rank") == 1) return 1;//Use "continue;" if this is on a loop
SetPVarInt(playerid, "100Rank", 1);
GameTextForPlayer(playerid, "New Rank! Killah!", 5000, 5);
return 1;
}
Re: Rank -
Calgon - 17.04.2010
Quote:
Originally Posted by Dark_Kostas
pawn Код:
if(GetPlayerScore(playerid) == 100) { if(GetPVarInt(playerid, "100Rank") == 1) return 1;//Use "continue;" if this is on a loop SetPVarInt(playerid, "100Rank", 1); GameTextForPlayer(playerid, "New Rank! Killah!", 5000, 5); return 1; }
|
So you're making a PVar, despite the score being an individual-saving variable? Okay.
Re: Rank -
ScottCFR - 17.04.2010
Well, I want it to stay for 5 seconds. It stays the whole time. Which one would do that ^_^
Re: Rank -
Dark_Kostas - 17.04.2010
Quote:
Originally Posted by ScottCFR
Well, I want it to stay for 5 seconds. It stays the whole time. Which one would do that ^_^
|
Both of them will work. But using FreddoX's will set your score to 101, but mine will keep it at 100 and still work