public OnPlayerUpdate(playerid) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { for(new i = 0; i < sizeof(SpikeInfo); i++) { if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ])) { if(SpikeInfo[i][sCreated] == 1) { new panels, doors, lights, tires; new carid = GetPlayerVehicleID(playerid); GetVehicleDamageStatus(carid, panels, doors, lights, tires); tires = encode_tires(1, 1, 1, 1); UpdateVehicleDamageStatus(carid, panels, doors, lights, tires); return 0; } } } } new weaponid = GetPlayerWeapon(playerid); if(!IsPlayerInAnyVehicle(playerid) && weaponid == 44 || weaponid == 45) //desynced nv,infared { new Keys, ud, lr; GetPlayerKeys(playerid, Keys, ud, lr); if(Keys & KEY_FIRE) return 0; } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { for(new i = 0; i < sizeof(SpikeInfo); i++) { if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ])) { if(SpikeInfo[i][sCreated] == 1) { new panels, doors, lights, tires; new carid = GetPlayerVehicleID(playerid); GetVehicleDamageStatus(carid, panels, doors, lights, tires); tires = encode_tires(1, 1, 1, 1); UpdateVehicleDamageStatus(carid, panels, doors, lights, tires); GameTextForPlayer(playerid,"~r~Spiked",4000,3); return 0; } } } } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { for(new i = 0; i < sizeof(SCamerasInfo); i++) { if(IsPlayerInRangeOfPoint(playerid, 20.0, SCamerasInfo[i][scX], SCamerasInfo[i][scY], SCamerasInfo[i][scZ])) { if(SCamerasInfo[i][scCreated] == 1 && SpeedCamera[playerid] == 0) { if(GetPlayerSpeed(playerid, false) > SCamerasInfo[i][scLimit]) { new string[128]; new location[MAX_ZONE_NAME]; new model = GetVehicleModel(playerid); GetPlayer2DZone(playerid, location, MAX_ZONE_NAME); SpeedCamera[playerid] = 15; format(string, sizeof(string), "HQ: A [%s(%d)] has been caught speeding [%d/%d] in [%s] (CAM:%d)", vehName[model - 400], GetPlayerVehicleID(playerid), GetPlayerSpeed(playerid, false), SCamerasInfo[i][scLimit], location, SCamerasInfo[i][scTag]); SendRadioMessage(1, TEAM_BLUE_COLOR, string); SendRadioMessage(3, TEAM_BLUE_COLOR, string); GameTextForPlayer(playerid,"~r~Caught speeding!",4000,3); PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0); format(string, sizeof(string), "WARNING: You have been found speeding ([%d] in a [%d]MPH Zone!). The police have been notified.", GetPlayerSpeed(playerid, false), SCamerasInfo[i][scLimit]); SendClientMessage(playerid, COLOR_YELLOW, string); return 0; } } } } } new Keys, ud, lr; GetPlayerKeys(playerid, Keys, ud, lr); if(Keys & KEY_FIRE) { if(GetPlayerWeapon(playerid) == 23 && PlayerHasTazer[playerid] == 1) { for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerAimingAtPlayer(playerid, i)) { if(i == playerid) return 1; if(GetDistanceBetweenPlayers(playerid, i) < { if(PlayerCuffed[i]) return 1; if(IsACop(i)) return SendClientMessage(playerid, COLOR_GREY, " Cannot Tazer Cops / FBI / SASD !"); if(IsPlayerInAnyVehicle(i)) return SendClientMessage(playerid, COLOR_GREY, " Get the suspect out of the vehicle !"); if(TazerTime[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, " Please wait while your tazer recharges!"); new string[128]; TogglePlayerControllable(i, 0); format(string, sizeof(string), "* You were Tazed by %s for 8 seconds.", PlayerName(playerid)); SendClientMessage(i, COLOR_LIGHTBLUE, string); if(PlayerInfo[i][pMask] == 1) { format(string, sizeof(string), "* You Tazed A Stranger for 8 seconds."); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* %s shoots with his Tazer at A Stranger, and tazed him.", PlayerName(playerid)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); } else { format(string, sizeof(string), "* You Tazed %s for 8 seconds.",PlayerName(i)); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* %s shoots with his Tazer at %s, and tazed him.", PlayerName(playerid),PlayerName(i)); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE); } SetTimerEx("TazerTimer", 8000, false, "i", playerid); TazerTime[playerid] = 1; GameTextForPlayer(i, "~r~Tazed", 2500, 3); PlayerCuffed[i] = 1; PlayerCuffedTime[i] = 8; ApplyAnimation(i, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0); } else { SendClientMessage(playerid, COLOR_GREY, " You are too far away from the suspect !"); return 1; } } } } } |