17.08.2009, 17:50
I have an onplayerstatechange command
This is suppose to make it so if a police officer goes into a police vehicle it says "This vehicle belongs to the city. You can use this vehicle to do your job"
but if anyone else gets into this vehicle, it sends cops a message saying "vehicle theft" but im having problems with this...
Everytime a cop gets into any other car (other then the ones given in the peice of code) it makes them wanted and sends police a message saying "vehicle theft" even though im a police officer...
I hope you understand what im trying to say lol...
so how do i fix this? thanks
Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) { new vehicleidd = GetPlayerVehicleID(playerid); if(GetVehicleModel(vehicleidd) == 596 || GetVehicleModel(vehicleidd) == 523 || GetVehicleModel(vehicleidd) == 601 || GetVehicleModel(vehicleidd) == 432 || GetVehicleModel(vehicleidd) == 497) if(gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_ARMY) { SendClientMessage(playerid,0xF08080AA,"This vehicle belongs to the city. You can use this vehicle to do your job"); return 1; } new plwl; GetPlayerName(playerid,pname,24); if(StoleCopCarRecent[playerid] == 0) { plwl = GetPlayerWantedLevel(playerid); SetPlayerWantedLevel(playerid,plwl +4); } new pcol = GetPlayerColor(playerid); plwl = GetPlayerWantedLevel(playerid); SendClientMessage(playerid, 0xA9A9A9AA, "|_Crime Commited_|"); format(string1, sizeof(string1), "(LAW ENFORCEMENT VEHICLE THEFT) Wanted Level %d",plwl); SendClientMessage(playerid,pcol,string1); commitedcrimerecently[playerid] +=200; if(StoleCopCarRecent[playerid] == 0) { for(new i=0;i<MAX_PLAYERS;i++) { new current_zone; current_zone = player_zone[playerid]; if(LawEnforcementRadio[i] == 1) { format(string1, sizeof(string1), "DISPATCH:(LAW ENFORCEMENT VEHICLE THEFT) %s(%d) Has stolen a police vehicle.Location: %s",pname,playerid,zones[current_zone][zone_name]); SendClientMessage(i, COLOR_ROYALBLUE, string1); } } } StoleCopCarRecent[playerid] =1; }
but if anyone else gets into this vehicle, it sends cops a message saying "vehicle theft" but im having problems with this...
Everytime a cop gets into any other car (other then the ones given in the peice of code) it makes them wanted and sends police a message saying "vehicle theft" even though im a police officer...
I hope you understand what im trying to say lol...
so how do i fix this? thanks