Get Vehicle Players?
#1

Hi, i have some cars made with: new cars[3];

And before destroying the car i wan't to know if someone is sitting in that car. Is it possible to check? How?
Reply
#2

IsPlayerInAnyVehicle
Reply
#3

Quote:
Originally Posted by ajwar
Посмотреть сообщение
Hi, i have some cars made with: new cars[3];

And before destroying the car i wan't to know if someone is sitting in that car. Is it possible to check? How?
pawn Код:
for(new vehicleid; vehicleid < MAX_VEHICLES; vehicleid++)
{
     if(!IsAnyPlayerInVehicle(vehicleid)) DestroyVehicle(vehicleid);
}

stock IsAnyPlayerInVehicle(vehicleid)
{
     new bool:Is = false;
     for(new i; i < MAX_PLAYERS; i++) if(IsPlayerInVehicle(i, vehicleid)) Is = true; break;
     return Is;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)