public static void SkyDive() { int ped = PLAYER.PLAYER_PED_ID(); Vector3 vec = ENTITY.GET_ENTITY_COORDS(ped, true); ENTITY.SET_ENTITY_COORDS(ped, vec.X, vec.Y, 2500f, true, true, true, true); AI.TASK_SKY_DIVE(ped); }
public static int Clone() { int ped = PLAYER.PLAYER_PED_ID(); int pedCloned = PED.CLONE_PED(ped, 1f, false, true); MakeHimAsGuard(pedCloned); return(pedCloned); }
public static void ChangePed(int player, int ped) { int currentPed = PLAYER.PLAYER_PED_ID(); if (currentPed != ped) { PLAYER.CHANGE_PLAYER_PED(player, ped, false, false); } }
public static void RagDoll(bool toggle) { int ped = PLAYER.PLAYER_PED_ID(); PED.SET_PED_CAN_RAGDOLL(ped, !toggle); PED.SET_PED_CAN_RAGDOLL_FROM_PLAYER_IMPACT(ped, !toggle); ENTITY.SET_ENTITY_INVINCIBLE(ped, toggle); PED.SET_PED_CAN_BE_KNOCKED_OFF_VEHICLE(ped, 1); PLAYER.GIVE_PLAYER_RAGDOLL_CONTROL(ped, !toggle); PED.SET_PED_RAGDOLL_ON_COLLISION(ped, !toggle); }
public static void MakeHimAsGuard(int ped) { int groupId = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID()); int leader = PLAYER.PLAYER_PED_ID(); PED.SET_PED_AS_GROUP_LEADER(leader, groupId); PED.SET_PED_AS_GROUP_MEMBER(ped, groupId); PED.SET_PED_NEVER_LEAVES_GROUP(ped, true); PED.SET_PED_CAN_SWITCH_WEAPON(ped, true); PED.SET_PED_COMBAT_ABILITY(ped, 1); }
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); }
private void chkLocation_CheckedChanged(object sender, EventArgs e) { if (!chkLocation.Checked) { return; } Task.Run(delegate { int ped = PLAYER.PLAYER_PED_ID(); while (true) { if (!chkLocation.Checked) { break; } Vector3 vec = ENTITY.GET_ENTITY_COORDS(ped, true); lblLoction.Text = string.Format("X: {0} Y: {1} Z: {2}", vec.X, vec.Y, vec.Z); } }); }
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 Vector3 GetPosition() { return(ENTITY.GET_ENTITY_COORDS(PLAYER.PLAYER_PED_ID(), true)); }
public static void GiveWeapon(Weapons weapon) { WEAPON.GIVE_WEAPON_TO_PED(PLAYER.PLAYER_PED_ID(), (int)weapon, 500, false, true); }
public static void InfiniteAmmo(bool toggle) { WEAPON.SET_PED_INFINITE_AMMO_CLIP(PLAYER.PLAYER_PED_ID(), toggle); }
public static int GetSelectedWeapon() { return(WEAPON.GET_SELECTED_PED_WEAPON(PLAYER.PLAYER_PED_ID())); }
private void button1_Click(object sender, EventArgs e) { ENTITY.SET_ENTITY_MAX_SPEED(PLAYER.PLAYER_PED_ID(), 100f); }
private void chkInvisible_CheckedChanged(object sender, EventArgs e) { Script.Invisible(PLAYER.PLAYER_PED_ID(), chkPlayerInvisible.Checked); }