Getplayerscore == 2?
#1

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.,..
Reply
#2

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

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

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

}
Reply
#5

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

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

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
Reply
#7

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..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)