refactor(Functions): Moved create ambient money to a function

This commit is contained in:
Yimura 2021-01-15 01:23:17 +01:00
parent 24a89138d0
commit 3beb21b48b
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682
3 changed files with 11 additions and 2 deletions

View File

@ -227,4 +227,12 @@ namespace big::features::functions
return -1; return -1;
} }
void create_ambient_money(Vector3 location, int amount)
{
Hash hash = RAGE_JOAAT("PICKUP_MONEY_PAPER_BAG");
OBJECT::CREATE_AMBIENT_PICKUP(hash, location.x, location.y, location.z + 0.5f, 0, amount, hash, false, true);
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash);
}
} }

View File

@ -15,6 +15,8 @@ namespace big::features::functions
Entity spawn_vehicle(const char* model, Vector3 location, float heading); Entity spawn_vehicle(const char* model, Vector3 location, float heading);
void create_ambient_money(Vector3 location, int amount);
bool take_control_of_entity(Entity ent); bool take_control_of_entity(Entity ent);
BOOL raycast_entity(Entity* ent); BOOL raycast_entity(Entity* ent);

View File

@ -155,8 +155,7 @@ namespace big
{ {
Vector3 coords = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id), true); Vector3 coords = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id), true);
OBJECT::CREATE_AMBIENT_PICKUP(0x1E9A99F8, coords.x, coords.y, coords.z + 0.5f, 0, rand() % 500 + 2000, (Hash)-1666779307, false, true); features::functions::create_ambient_money(coords, rand() % 500 + 2000);
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED((Hash)-1666779307);
}QUEUE_JOB_END_CLAUSE }QUEUE_JOB_END_CLAUSE
} }