What does this mean?
#1

I've seen 3 of these, what do they each mean?

pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++)
pawn Код:
for (new i = 0; i != MAX_PLAYERS; i++)
pawn Код:
for (new i = 0; i > MAX_PLAYERS; i++)
Reply
#2

from what i know it's a way to do it when a callback dosen't have playerid, Where playerid would be you would put an i so for example

SetPlayerPos(i,x,y,z and so on

Instead of
SetPlayerPos(playerid,x,y,z and so on

Reply
#3

Quote:
Originally Posted by [SL~RP
ihatetn931 ]
from what i know it's a way to do it when a callback dosen't have playerid, Where playerid would be you would put an i so for example

SetPlayerPos(i,x,y,z and so on

Instead of
SetPlayerPos(playerid,x,y,z and so on

Not necessarily.

https://sampwiki.blast.hk/wiki/Loops
Reply
#4

I know but when would you use < MAX_PLAYERS and when would you use != MAX_PLAYERS
Reply
#5

https://sampwiki.blast.hk/wiki/Control_Structures#Operators
https://sampwiki.blast.hk/wiki/Loops

You can put it together yourself if you read them both.
Reply
#6

I know what the operators are.
Reply
#7

It s a loop for playerid, ok, so i = everyone. so..
Reply
#8

I know but when would you use < and when would you use !=
Reply
#9



for(new i=0;i<MAX_PLAYERS;i++)

right so while i =0 and is less then MAX_PLAYERS incress the value of i by ++ (1) each time the loop runs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)