loop certain vehicles
#1

is there anyway to loop through a certain type of vehicle etc..
so it loops through and checks for taxi id 420 that's unoccupied and add attachment to the them taxi ids

for(new i = 0; i<MAX_VEHICLES;i++)
{
if(vehicleid == 420)
{
///etc code here
}
}

please help thanks
Reply
#2

replace vehicleid to GetVehicleModel(i)
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
replace vehicleid to GetVehicleModel(i)
Also, use http://pastebin.com/Crt916CT to check whether a car is occupied or not.
Reply
#4

pawn Код:
for(new i = 1, occupiedhicle; i < MAX_VEHICLES; i++)
{
    if(GetVehicleModel(i) != 420) continue;
   
    for(new j = GetMaxPlayers() - 1; j != -1; j--)
    {
        if(!IsPlayerInVehicle(j, i)) continue;
        occupiedhicle += 1;
        break;
    }
    if(occupiedhicle > 0)
    {
        occupiedhicle = 0;
        continue;
    }
    else Attach...
}
Reply
#5

thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)