What's mean this ? - 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: What's mean this ? (
/showthread.php?tid=73289)
What's mean this ? -
russiany - 13.04.2009
Can somebady tell me what are doing this 2 "parameters"
first one : that 2 points (
: )
the last one : the question mark (
? )
Here's an Boylet Example :
pawn Код:
bool:IsInReach(Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:z2,Float:dist)
{
x = (x > x2) ? x - x2 : x2 - x;
if(x > dist) return false;
y = (y > y2) ? y - y2 : y2 - y;
if(y > dist) return false;
z = (z > z2) ? z - z2 : z2 - z;
if(z > dist) return false;
return true;
}
Re: What's mean this ? -
russiany - 13.04.2009
i've made this "command"
pawn Код:
if(!strcmp(cmd, "/test",true))
{
new a = 10;
new b = 2;
new restul = b ? a : 2;
format(string,sizeof(string),"%d",restul);
SendClientMessage(playerid,COLOR_LIGHTGREEN,string);
return 1;
}
And when i type /test , it results me 10 ...
Re: What's mean this ? -
(SF)Noobanatior - 14.04.2009
e1 ? e2 :e3 if e1 is true the answer is e2 and if e1 is false the answer is e3
make sence? there for 10