public static Vector3 GetSpawnPoint(float distanceFromPlayer) { try { Script.Wait(100); Model m = new Model(VehicleHash.Panto); m.Request(2000); var v = World.CreateVehicle(m, Game.Player.Character.Position.Around(distanceFromPlayer)); Script.Wait(100); try { if (v != null) { v.PlaceOnNextStreet(); } } catch (Exception ex) { RPGLog.Log(ex); } var pos = v != null ? v.Position : Game.Player.Character.Position.Around(distanceFromPlayer); if (v != null) { v.Delete(); } return(pos); } catch (Exception ex) { RPGLog.Log(ex); throw; } }
public static bool GetCustomCondition(string questName, string name) { var quest = Quests.FirstOrDefault(i => i.Name == questName); if (quest != null) { var c = quest.Conditions.FirstOrDefault(co => co.Name == name); if (c != null) { return(c.CustomCondition.Invoke()); } } RPGLog.Log("Quest condition [" + name + "] not found for quest [" + questName + "]"); return(false); }
public static void LoadPlayerWeapons() { try { Game.Player.Character.Weapons.RemoveAll(); // for (int i = 0; i < PlayerData.Weapons.Count; i++) { var wepDefinition = PlayerData.Weapons[i]; if (!wepDefinition.Unlocked) { continue; } Game.Player.Character.Weapons.Give(wepDefinition.WeaponHash, 0, false, false); Script.Wait(150); Game.Player.Character.Weapons[wepDefinition.WeaponHash].Ammo = wepDefinition.AmmoCount; } Game.Player.Character.Weapons.Give(WeaponHash.Unarmed, 0, true, false); } catch (Exception ex) { RPGLog.Log(ex); } }