29.10.2012, 01:31
Hey guys, i made a code that should tell the closest player to pull over, however it doesn't work, can you guys see any errors?
It uses a stock which detects the nearest vehicle.
PHP код:
CMD:pu(playerid, params[])
{
new vehicleid;
vehicleid = GetClosestVehiclePolice(playerid);
for (new checkwantedpull; checkwantedpull < MAX_PLAYERS; checkwantedpull++)
if(gTeam[playerid] == POLICE)
{
if(IsPlayerInVehicle(checkwantedpull, vehicleid) && GetPlayerWantedLevel(checkwantedpull) >= 1)
{
GameTextForPlayer(checkwantedpull,"~b~ POLICE REQUEST~n~~r~PULL OVER",6000,5);
SendClientMessage(playerid, COLOR_BLUE, "Pull over request sent.");
}
}
return 1;
}