This is creating an infinite loop, Why?
#4

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
How can you even do such a thing?
gettime returns 3 values which you compare to one value (MAX_PLAYERS)
This is like doing:
new pos;
pos = GetPlayerPos(playerid,x,y,z);
new i = pos;
while(pos != 0)

Pos has 3 values which you cannot compare to one.
It will never be equal to MAX_PLAYERS therefore the infinite loop.
No it does not return three values, it returns a single unix timestamp value which is way bigger than the max ammount of players samp will ever get, aswell modificates the three parameters you input on the function outside it, but its an integer function, and GetPlayerPos doesnt return a value, so in your example you store the value of void function on an integer, which makes no sense.
Reply


Messages In This Thread
This is creating an infinite loop, Why? - by Dokins - 24.01.2012, 19:28
Re: This is creating an infinite loop, Why? - by [XST]O_x - 24.01.2012, 19:32
Re: This is creating an infinite loop, Why? - by Dokins - 24.01.2012, 19:40
Respuesta: Re: This is creating an infinite loop, Why? - by kirk - 24.01.2012, 19:44
Re: Respuesta: Re: This is creating an infinite loop, Why? - by [XST]O_x - 24.01.2012, 19:48
Respuesta: Re: Respuesta: Re: This is creating an infinite loop, Why? - by kirk - 24.01.2012, 20:38

Forum Jump:


Users browsing this thread: 1 Guest(s)