struct Client_t {
int currentTime;
char* currentWeapon;
VariableStruct* LocationSelector;
float* LocationSelectorPos;
};
void shootProjectile(int clientIndex, const char* Projectile) {
if (OnNotify("weapon_fired", clientIndex, CT_ENTITY)) {
float* Origin = VectorScale(Main::Call<float*>(anglestoforward, Object::Call<float*>(getplayerangles, clientIndex, CT_ENTITY)), 1000000);
float* Trace = Main::String::Call<float*>(bullettrace, "position", Object::Call<float*>(gettagorigin, clientIndex, CT_ENTITY, "tag_eye"), Origin, 0, &entityArray[0]);
Main::Call<int>(magicbullet, Projectile, Object::Call<float*>(gettagorigin, 0, CT_ENTITY, "tag_eye"), Trace, &entityArray[0]);
}
}
//Example : shootProjectile(0, "javelin_mp");
Object::Call<int>(notifyonplayercommand, clientIndex, CT_ENTITY, "dpad_up", "+actionslot 1");
Object::Call<int>(notifyonplayercommand, clientIndex, CT_ENTITY, "button_r2", "+frag");
Object::Call<int>(notifyonplayercommand, clientIndex, CT_ENTITY, "button_l2", "+smoke");
//Do with all buttons ...
void TeleportGun(int clientIndex) {
if (OnNotify("+actionslot 1", clientIndex, CT_ENTITY)) {
Client[clientIndex].HasTlpGun = !Client[clientIndex].HasTlpGun;
}
if (OnNotify("weapon_fired", clientIndex, CT_ENTITY) && Client[clientIndex].HasTlpGun) {
float* Origin = VectorScale(Main::Call<float*>(anglestoforward, Object::Call<float*>(getplayerangles, 0, CT_ENTITY)), 1000000);
float* Trace = Main::String::Call<float*>(bullettrace, "position", Object::Call<float*>(gettagorigin, 0, CT_ENTITY, "tag_eye"), Origin, 0, &entityArray[0]);
Object::Call<null>(setorigin, clientIndex, CT_ENTITY, Trace);
}
}
struct {
Helicopter_t Helicopter;
helicopterStatus Hstatus;
}Mod_helicopter;
enum Team_t {
allies,
axis
};
struct Helicopter_t {
int entityNum;
int owner;
Team_t team;
};
enum helicopterStatus {
beginLocation,
wait,
};
void locationSelector(int clientIndex, float Alture, char* notify) {
Client[clientIndex].LocationSelector = OnNotify("confirm_location", clientIndex, CT_ENTITY);
if (OnNotify(notify, clientIndex, CT_ENTITY)) {
Object::Call<int>(beginlocationselection, clientIndex, CT_ENTITY, "map_artillery_selector");
Client[clientIndex].currentWeapon = Object::Call<char*>(getcurrentweapon, clientIndex, CT_ENTITY);
Object::Call<int>(disableoffhandweapons, clientIndex, CT_ENTITY);
Object::Call<int>(giveweapon, clientIndex, CT_ENTITY, "killstreak_precision_airstrike_mp");
Object::Call<int>(switchtoweapon, clientIndex, CT_ENTITY, "killstreak_precision_airstrike_mp");
}
if (Client[clientIndex].LocationSelector) {
float* Location = Client[clientIndex].LocationSelector->vectorValue;
float AddTo[] = { 0, 0, Alture };
Client[clientIndex].LocationSelectorPos = Main::String::Call<float*>(bullettrace, "position", VectorAdd(Client[clientIndex].LocationSelector->vectorValue, AddTo), Client[clientIndex].LocationSelector->vectorValue, 0, undefined);
Object::Call<int>(endlocationselection, clientIndex, CT_ENTITY);
Object::Call<int>(enableoffhandweapons, clientIndex, CT_ENTITY);
Object::Call<int>(takeweapon, clientIndex, CT_ENTITY, "killstreak_precision_airstrike_mp");
Object::Call<int>(switchtoweapon, clientIndex, CT_ENTITY, Client[clientIndex].currentWeapon);
}
}
void spawnHelicopter(Helicopter_t* heli, int owner, float *startPos, const char* helicopterType, const char* helicopterModel) {
heli->entityNum = (int)Main::Call<entNum*>(spawnhelicopter, owner, startPos, Object::Call<float*>(getplayerangles, owner, CT_ENTITY), helicopterType, helicopterModel);
heli->owner = owner;
char* team = Fields::String::getField<char*>(pers, "team", owner, CT_ENTITY);
(team == "allies") ? heli->team = allies : heli->team = axis;
}
void ComeHeliPosition(int clientIndex) {
Object::Call<null>(vehicle_setspeed, Client[clientIndex].Mod_helicopter.Helicopter.entityNum, CT_ENTITY, 100, 50);
Object::Call<null>(setvehgoalpos, Client[clientIndex].Mod_helicopter.Helicopter.entityNum, CT_ENTITY, Client[clientIndex].LocationSelectorPos, true);
}
void doPilotHelicopter(int clientIndex) {
if (Client[clientIndex].Mod_helicopter.Hstatus == beginLocation)
{
locationSelector(clientIndex, 500, "weapon_fired");
if (OnNotify("dpad_up", clientIndex, CT_ENTITY))
{
float startPos[3] = { 1000, -12000, 3000 };
spawnHelicopter(&Client[clientIndex].Mod_helicopter.Helicopter, clientIndex, startPos, "cobra_mp", "vehicle_cobra_helicopter_fly_low");
ComeHeliPosition(clientIndex);
Client[clientIndex].Mod_helicopter.Hstatus = wait;
}
}
}
//Example: doPilotHelicopter(0);
Copyright © 2024, NextGenUpdate.
All Rights Reserved.