Little help with a loop
#1

So I've got there 4 vehicle slots & I want to put a new modelid to the empty one (if available)
(0 means empty)
Код:
for(new i = 0; i < 4; i++)
{
    if(player[playerid][vModelid][i] == 0)
    {
But, with this code it is gonna put a new vehicle to every single one that equals to 0, not only one.

Any ideas? Thanx
Reply
#2

PHP код:
for(new 04i++)
{
    if(
player[playerid][vModelid][i] == 0)
    {
        
player[playerid][vModelid][i] = modelid;
        break; 
// exit loop 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)