27.05.2012, 08:17
Wow. That's a lot of code!
A word of advice - name your vehicles better. When you come back in the future you'll be like 'what the fuck is pd[]' and end up looking all through your code trying to work it out. For example, gPoliceVehicleID[] instead.
pawn Код:
new pd[?];
// To check if they are in any of the pd[] vehicles:
new vid = GetPlayerVehicleID(playerid);
new found;
for(new i=0; i<sizeof(pd); i++) // Loop through all pd[x] vehicle IDs
{
if(vid == pd[i]) // If they are in that vehicle
{
found = 1;
break; // End loop
}
}
if(found)
{
// They are in one of the pd[x] vehicles
}
else
{
// They are not
}