06.04.2012, 15:46
need a bit of help identifly a variable
06.04.2012, 15:48
"i" is who it's being sent to, or the playerid, basically.
06.04.2012, 15:58
its from raven's roleplay but i cant find where its set so i dont know what i is
06.04.2012, 18:25
Here
pawn Код:
for(new i=0; i < MAX_PLAYERS; i++)
06.04.2012, 18:36
He's not asking how to do it, he's asking what the i "means". (this is already in the script he showed)
That is basicly stating that it loops through all online players, and the i is all the players. So, for example, the i != playerid means if the looped players are not the playerid (if not correct).
Good luck, hope I helped.
That is basicly stating that it loops through all online players, and the i is all the players. So, for example, the i != playerid means if the looped players are not the playerid (if not correct).
Good luck, hope I helped.
06.04.2012, 19:05
Quote:
He's not asking how to do it, he's asking what the i "means". (this is already in the script he showed)
That is basicly stating that it loops through all online players, and the i is all the players. So, for example, the i != playerid means if the looped players are not the playerid (if not correct). Good luck, hope I helped. |
![Picard](images/smilies/picard2.png)
And 'i' is not 'all players', it's a normal variable like 'new Float:X' or 'new iname'. It loops through all player IDs from 0 to MAX_PLAYERS (usually 500). So it runs the code in the 'for' block 500 times, and every time does 'i++' (i=i+1) at the end of the block. So when running the code first time, i=0, second time i=1, then i=2, i=3 .... i=499, because 499 is the biggest value (player ID) where 'i < 500' is true. And 'i != playerid' means if the looped ID is not the ID of the player who pressed the key.
You should read this to learn more about the 'for loop' - https://sampwiki.blast.hk/wiki/Control_S...res#for_.28.29
06.04.2012, 21:06
in this code "i" is for each player that is in range of this
it will hit him with tazer
Quote:
if(IsPlayerInRangeOfPoint(i,60, pX,pY,pZ)) |
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)