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 SwapToAimedPed() { int player = PLAYER.PLAYER_ID(); if (!PLAYER.GET_ENTITY_PLAYER_IS_FREE_AIMING_AT(player, RPC.FreePointer)) { return; } int aimedEntity = PS4.Extension.ReadInt32(RPC.FreePointer); if (!ENTITY.IS_ENTITY_A_PED(aimedEntity)) { return; } ChangePed(player, aimedEntity); }
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); }