public void mission(Client player, PedHash newPlayerModel, Vector3 missionStartCoord, Vector3 missionDesCoord, VehicleHash missionVeh, Vector3 vehRot, PedHash oldModel) { var playerObj = new set(); var create = new create(); playerObj.playerModel(player, newPlayerModel); // player to garbage model var shape = create.shape(missionDesCoord); // create shape at destination var veh = create.veh(missionVeh, missionStartCoord, vehRot, 255, 133); // veh create shape.onEntityEnterColShape += (s, ent) => { var curVeh = API.getEntityModel(player.CurrentVehicle); var missionVehicle = API.getEntityModel(veh); if (curVeh == missionVehicle) // not sure if this will work { playerObj.playerModel(player, oldModel); // not sure about this // oldModel = API.pedNameToModel(Convert.ToString(curModel)); API.warpPlayerOutOfVehicle(player, veh); // warp player out of vehicle API.deleteEntity(veh); // Delete the vehicle API.deleteColShape(shape); // Delete the mission destination shape API.sendChatMessageToPlayer(player, "Mission complete"); } else { API.sendChatMessageToPlayer(player, "Wrong Vehicle"); } }; }
public void startMission(Client sender) { var curModel = API.getEntityModel(sender.CharacterHandle); // current player model var oldModel = API.pedNameToModel(Convert.ToString(curModel)); // the old player model (not sure) PedHash model = PedHash.GarbageSMY; // garbadge man model var create = new create(); VehicleHash missionVeh = VehicleHash.Trash; Vector3 vehRot = new Vector3(0, 0, 0); // Vehicle rotation Vector3 missionStartCoord = sender.Position; // player position Vector3 missionDesCoord = new Vector3(50, 50, 50); // destination coords var missionStartIcon = 78; var startPoint = create.shape(missionStartCoord); create.blipAtPos(missionStartCoord, missionStartIcon); // create shape to start mission startPoint.onEntityEnterColShape += (s, ent) => { create.mission(sender, model, missionStartCoord, missionDesCoord, missionVeh, vehRot, oldModel); }; }