Example output
#include "script.h"
#include "keyboard.h"
#include "entity.h"
#include "math.h"
#include "vector3.h"
#include "object.h"
#include "audio.h"
#include <time.h>
bool isModActive = false;
void toggleMod() {
isModActive = !isModActive;
if (isModActive) {
Player player = PLAYER::PLAYER_ID();
ENTITY::SET_ENTITY_INVINCIBLE(player, true);
ENTITY::SET_ENTITY_COORDS(player, rand() % 2000 - 1000, rand() % 2000 - 1000, 200, 0, 0, 0, 0);
PLAYER::SET_PLAYER_CONTROL(player, false, 0);
AUDIO::PLAY_SOUND_FRONTEND(-1, "GTAO_FM_002", "HUD_FRONTEND_DEFAULT_SOUNDSET", true);
for (int i = 0; i < 50; i++) {
Vector3 position = ENTITY::GET_ENTITY_COORDS(player, true);
position.x += rand() % 20 - 10;
position.y += rand() % 20 - 10;
position.z += rand() % 20 - 10;
Object balloon = OBJECT::CREATE_OBJECT(OBJECT::GET_HASH_KEY("apa_mp_h_bea_champ_flamingo"), position.x, position.y, position.z, true, true, false);
float speed = 0.1f + (rand() % 50) / 100.0f;
Vector3 velocity = { rand() % 10 - 5, rand() % 10 - 5, rand() % 10 - 5 };
OBJECT::SET_OBJECT_PHYSICS_PARAMS(balloon, 0.3f, 0.7f, 0.8f, 0.5f, 0.5f, 0.5f, 0, 0, 0, 0, 2, 0);
ENTITY::SET_ENTITY_VELOCITY(balloon, velocity.x * speed, velocity.y * speed, velocity.z * speed);
}
}
else {
Player player = PLAYER::PLAYER_ID();
ENTITY::SET_ENTITY_INVINCIBLE(player, false);
PLAYER::SET_PLAYER_CONTROL(player, true, 0);
AUDIO::STOP_SOUND(-1);
}
}
void main() {
while (true) {
if (isModActive) {
WAIT(0);
}
else {
if (IsKeyJustUp(VK_F9)) {
toggleMod();
}
WAIT(0);
}
}
}