3D scoring help - 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: 3D scoring help (
/showthread.php?tid=180862)
3D scoring help -
ToPhrESH - 03.10.2010
Well, i have no clue how to do this. I keep attempting to try to do this, but everytime messing up my script. So here is the problem.
pawn Код:
if(GetPlayerScore(playerid) < 250)
{
SetPlayerWantedLevel(playerid, 1);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
Newb[playerid] = Create3DTextLabel("Recruit",0x00FFFFFF,X, Y, Z+2.0,20.0,1);
Attach3DTextLabelToPlayer(Newb[playerid],playerid,0,0,1.2);
}
else if(GetPlayerScore(playerid) > 250);
{
//not done yet
}
I need help on that second part. Like I got the getplayerscore and if his score is less then 250 then he will have 3D text saying recruit.
But then I have problem. I want to make another rank. Where I get the players score and it is more than 250 but less than 350.
pawn Код:
else if (GetPlayerScore (playerid) > 250 & < 350 // I want it where they have to be more than 250 but less than 350.
{
SetPlayerWantedLevel(playerid, 2);
}
Re: 3D scoring help -
iFriSki - 03.10.2010
I believe it goes along something like this..
pawn Код:
new pscore;
pscore = GetPlayerScore(playerid); // Get the players score into pscore
if((pscore >= 250) && (pscore <= 350)) // If pscore is greater than or equal to 250, and less than or equal to 350
{
// Code
}
Re: 3D scoring help -
ToPhrESH - 03.10.2010
wow thanks alot man
Re: 3D scoring help -
playbox12 - 03.10.2010
Quote:
Originally Posted by iFriSki
I believe it goes along something like this..
pawn Код:
new pscore; pscore = GetPlayerScore(playerid); // Get the players score into pscore if((pscore >= 250) && (pscore <= 350)) // If pscore is greater than or equal to 250, and less than or equal to 350 { // Code }
|
Note that there is no need in storing it in a variable while you can do
pawn Код:
if((GetPlayerScore(playerid) >= 250 && GetPlayerScore(playerid) <= 350))
{
// other code
}
Re: 3D scoring help -
samgreen - 03.10.2010
Quote:
Originally Posted by playbox12
Note that there is no need in storing it in a variable while you can do
pawn Код:
if((GetPlayerScore(playerid) >= 250 && GetPlayerScore(playerid) <= 350)) { // other code }
|
Also no need for the extra parenthesis. ex:
pawn Код:
if(GetPlayerScore(playerid) >= 250 && GetPlayerScore(playerid) <= 350)
// Pawn also supports this shorthand
if(250 <= GetPlayerScore(playerid) <= 350)