public static int CreatePickup(string pickName, string probsName, int value = 1) { int pickHash = GAMEPLAY.GET_HASH_KEY(pickName.ToString()); int propHash = 0; if (probsName != "default") { propHash = GAMEPLAY.GET_HASH_KEY(probsName.ToString()); } Vector3 vec = GetPosition(); return(OBJECT.CREATE_PICKUP(pickHash, vec.X, vec.Y, vec.Z, 700, value, true, propHash)); }
public static void TeleportToWaypoint() { Vector3 wp = WayPoint(); if (wp.X == 0) { return; } GAMEPLAY.GET_GROUND_Z_FOR_3D_COORD(wp.X, wp.Y, 5000.0f, RPC.FreePointer, true); float z = PS4.Extension.ReadFloat(RPC.FreePointer); int ped = PLAYER.PLAYER_PED_ID(); int veh = PED.GET_VEHICLE_PED_IS_IN(ped, false); ENTITY.SET_ENTITY_COORDS(veh == 0 ? ped : veh, wp.X, wp.Y, z, true, true, true, true); }
public static void SetModel(string modelName) { int player = PLAYER.PLAYER_ID(); int modelHash = GAMEPLAY.GET_HASH_KEY(modelName); STREAMING.REQUEST_MODEL(modelHash); int timeOut = 0; while (!STREAMING.HAS_MODEL_LOADED(modelHash)) { timeOut++; if (timeOut == 5) { break; } } PLAYER.SET_PLAYER_MODEL(player, modelHash); STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(modelHash); }
public static int SpawnVehicle(string vehName, bool intoVehicle = true) { int vehHash = GAMEPLAY.GET_HASH_KEY(vehName); int newVec = 0; STREAMING.REQUEST_MODEL(vehHash); for (int i = 0; i < 100; i++) { if (STREAMING.HAS_MODEL_LOADED(vehHash)) { int playerPed = PLAYER.PLAYER_PED_ID(); Vector3 myCoords = GetPosition(); newVec = VEHICLE.CREATE_VEHICLE(vehHash, myCoords.X, myCoords.Y, myCoords.Z, ENTITY.GET_ENTITY_HEADING(playerPed), true, true); if (intoVehicle) { PED.SET_PED_INTO_VEHICLE(playerPed, newVec, -1); } STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(vehHash); break; } } return(newVec); }
public static void SetWeather(string weather) { GAMEPLAY.SET_OVERRIDE_WEATHER(weather); }
public static void SetGravity(bool toggle) { GAMEPLAY.SET_GRAVITY_LEVEL(toggle ? 3 : 0); }