18.01.2016, 14:31
You need to loop through those array and check if ID exists in them.
PHP код:
//the function to check if its cop car or not
stock IsCopCar(vid)
{
new i;
for(i = 0; i < sizeof(lspdinf); i++)if(vid == lspdinf[i])return true;
for(i = 0; i < sizeof(lspdche); i++)if(vid == lspdche[i])return true;
for(i = 0; i < sizeof(lspdbul); i++)if(vid == lspdbul[i])return true;
return false;
}
//function usage:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsCopCar(vehicleid))
{ dont let him in unless cop...}
}