SA-MP Forums Archive
Getplayerscore == 2? - 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: Getplayerscore == 2? (/showthread.php?tid=395203)



Getplayerscore == 2? - ThePhill97 - 25.11.2012

How can I make it so that it goes
pawn Код:
GetPlayerScore(playerid) == 2
SetPlayerColor(playerid, 0xAFAFAFAA);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 500);
Basically.. all im needing is for the if score = 2 then do something.,..


Re: Getplayerscore == 2? - Djole1337 - 25.11.2012

pawn Код:
new Score = GetPlayerScore(playerid);
if(Score == 2)
{
       //whatever
}



Re: Getplayerscore == 2? - XtremeR - 25.11.2012

Yes do it like this:
pawn Код:
if (GetPlayerScore(playerid) == 2) {
SetPlayerColor(playerid, 0xAFAFAFAA);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 500);
}



Re: Getplayerscore == 2? - QuaTTrO - 25.11.2012

Quote:
Originally Posted by Mr_DjolE
Посмотреть сообщение
pawn Код:
new Score = GetPlayerScore(playerid);
if(Score == 2)
{
       //whatever
}
How about:
pawn Код:
if(GetPlayerScore(playerid) == 2)
{

}



Re: Getplayerscore == 2? - Djole1337 - 25.11.2012

Quote:
Originally Posted by QuaTTrO
Посмотреть сообщение
How about:
pawn Код:
if(GetPlayerScore(playerid) == 2)
{

}
What's the difference ? Except 1 more line.


Re: Getplayerscore == 2? - ikey07 - 25.11.2012

Its useful if you want check that score many times, like

new a = GetPlayerScore(playerid);
if(a == 1) { do; }
else if(a == 2) { do; }
else if(a == 3) { do; }
else if(a == 4) { do; }

You dont have to get player score each time, I believe its few miliseconds faster, you also wont call same thing all over again, as each time it sends some data from client to server, so you send it only once and compare, hope you got it


Re: Getplayerscore == 2? - XtremeR - 25.11.2012

Umm guys, my post already helped him...
and agree with Y LESS

Quote:
Originally Posted by ikey07
Посмотреть сообщение
as each time it sends some data from client to server
it doesn't bro..