Problem with Max_VEHICLES
#1

Код:
new car[MAX_VEHICLES];

if(strcmp(cmd, "/ic", true) == 0)
{
    for(new i=1; i < MAX_VEHICLES; i++)
    {  
        if(car[i] != 1)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "This car slot is free (1)");
            car[vehicleid] = 1;
            return 1;
        }
        if(car[i] != 2)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "This car slot is free (2)");
            car[vehicleid] = 2;
            return 1;
        }
     }
}
That is a bit of the code that i have created.

I am typing a cmd /ic which gives the car a value. If the car slot is free, I want the server to sendclientmessage saying that it is free. BUT, the problem is, is that everytime i type /ic on a car, it says this slot is free (1) every single time... and I only want 1 car in each car slot... so how can i fix this?

Thanks
Reply
#2

Change car[vehicleid] to car[i]

Example:
pawn Код:
car[i] = 2;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)