public void EntrevistarCommand(Client player, string targetString) { if (player.GetData(EntityData.PLAYER_KILLED) != 0) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_is_dead); } else if (player.GetData(EntityData.PLAYER_FACTION) != Constants.FACTION_NEWS) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_not_news_faction); } else { Vehicle vehicle = Vehicles.GetClosestVehicle(player); if (vehicle.GetData(EntityData.VEHICLE_FACTION) != Constants.FACTION_NEWS && player.VehicleSeat != (int)VehicleSeat.LeftRear) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_not_in_news_van); } else { Client target = int.TryParse(targetString, out int targetId) ? Globals.GetPlayerById(targetId) : NAPI.Player.GetPlayerFromName(targetString); if (target.HasData(EntityData.PLAYER_ON_AIR) == true) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.on_air); } else { player.SetData(EntityData.PLAYER_ON_AIR, target); player.SetData(EntityData.PLAYER_JOB_PARTNER, target); player.SendChatMessage(Constants.COLOR_INFO + InfoRes.wz_offer_onair); target.SendChatMessage(Constants.COLOR_INFO + InfoRes.wz_accept_onair); } } } }
public void ForceCommand(Client player) { if (player.GetData(EntityData.PLAYER_KILLED) != 0) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_is_dead); } else { if (player.GetData(EntityData.PLAYER_JOB) != Constants.JOB_THIEF) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.not_thief); } else if (player.GetData(EntityData.PLAYER_LOCKPICKING) != null) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.already_lockpicking); } else { var vehicle = Vehicles.GetClosestVehicle(player); if (vehicle == null) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.no_vehicles_near); } else if (Vehicles.HasPlayerVehicleKeys(player, vehicle)) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_cant_lockpick_own_vehicle); } else if (!vehicle.Locked) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.veh_already_unlocked); } else { // Generate police report GeneratePoliceRobberyWarning(player); player.SetData(EntityData.PLAYER_LOCKPICKING, vehicle); player.PlayAnimation("missheistfbisetup1", "hassle_intro_loop_f", (int)Constants.AnimationFlags.Loop); player.SetData(EntityData.PLAYER_ANIMATION, true); // Timer to finish forcing the door var robberyTimer = new Timer(OnLockpickTimer, player, 10000, Timeout.Infinite); robberyTimerList.Add(player.Value, robberyTimer); } } } }
public void CheckCommand(Client player) { if (player.GetData(EntityData.PLAYER_KILLED) != 0) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_is_dead); } else if (player.GetData(EntityData.PLAYER_ON_DUTY) == 0) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_not_on_duty); } else if (player.GetData(EntityData.PLAYER_FACTION) != Constants.FACTION_POLICE) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_not_police_faction); } else { Vehicle vehicle = Vehicles.GetClosestVehicle(player, 3.5f); if (vehicle == null) { int vehicleId = vehicle.GetData(EntityData.VEHICLE_ID); string checkTitle = string.Format(GenRes.vehicle_check_title, vehicleId); string model = vehicle.GetData(EntityData.VEHICLE_MODEL); string plate = vehicle.GetData(EntityData.VEHICLE_PLATE); string owner = vehicle.GetData(EntityData.VEHICLE_OWNER); player.SendChatMessage(checkTitle); player.SendChatMessage(GenRes.vehicle_model + model); player.SendChatMessage(GenRes.vehicle_plate + plate); player.SendChatMessage(GenRes.owner + owner); string message = string.Format(InfoRes.check_vehicle_plate, player.Name, model); foreach (Client target in NAPI.Pools.GetAllPlayers()) { if (player != target && player.Position.DistanceTo(target.Position) < 20.0f) { target.SendChatMessage(Constants.COLOR_CHAT_ME + message); } } } else { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.no_vehicles_near); } } }
public void NewsCommand(Client player, string message) { if (player.GetData(EntityData.PLAYER_KILLED) != 0) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_is_dead); } else if (player.GetData(EntityData.PLAYER_FACTION) != Constants.FACTION_NEWS) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_not_news_faction); } else { Vehicle vehicle = Vehicles.GetClosestVehicle(player); if (vehicle.GetData(EntityData.VEHICLE_FACTION) != Constants.FACTION_NEWS && player.VehicleSeat != (int)VehicleSeat.LeftRear) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_not_in_news_van); } else { SendNewsMessage(player, message); } } }