mirror of
https://github.com/iDisaster/GTAConnected.git
synced 2026-03-13 03:41:49 +00:00
Add files via upload
This commit is contained in:
525
Trident/MD_Functions/MDF_Army_Functions.c
Normal file
525
Trident/MD_Functions/MDF_Army_Functions.c
Normal file
@@ -0,0 +1,525 @@
|
||||
/**
|
||||
* @ MAJOR DISTRIBUTION EXTEND
|
||||
* @ Version MDv13 TRIDENT
|
||||
* @ MADE BY - DEVILSDESIGN & IIV NATHAN VII
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
//We also need a function to make bodyguards drive cars
|
||||
//extern int FIND_MAX_NUMBER_OF_GROUP_MEMBERS(void);
|
||||
//extern void GET_GROUP_SIZE(Group group, uint *pStartIndex, uint *pCount);
|
||||
//extern void GET_NTH_GROUP_MEMBER(int group, int n, Ped *ped);
|
||||
//extern void GET_NUMBER_OF_FOLLOWERS(Ped ped, int *followers);
|
||||
|
||||
void Clear_All_BGuards(void){
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
FORCE_CHAR_TO_DROP_WEAPON(BG_ped[i]);
|
||||
delete_objects_on_ped(BG_ped[i]);
|
||||
DELETE_CHAR(&BG_ped[i]);
|
||||
MARK_CHAR_AS_NO_LONGER_NEEDED(&BG_ped[i]);
|
||||
}
|
||||
Alert("~b~MD: ~s~All bodyguards cleared.",false);
|
||||
}
|
||||
|
||||
void Attach_Objects_BGuards(uint model,int pedbone, float obj_x, float obj_y, float obj_z, float obj_rx, float obj_ry, float obj_rz, int id){
|
||||
if (IS_MODEL_IN_CDIMAGE(model)){
|
||||
if(!Guard_Check()) return;
|
||||
REQUEST_MODEL(model);
|
||||
while(!HAS_MODEL_LOADED(model)) WAIT(0);
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
CREATE_OBJECT(model,0.0,0.0,0.0,&Attach_object[id],true);
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
FREEZE_OBJECT_POSITION(Attach_object[id], false);
|
||||
SET_OBJECT_VISIBLE(Attach_object[id], true);
|
||||
SET_OBJECT_LIGHTS(Attach_object[id], true);
|
||||
SET_OBJECT_INVINCIBLE(Attach_object[id], true);
|
||||
SET_OBJECT_COLLISION(Attach_object[id], false);
|
||||
SET_OBJECT_DYNAMIC(Attach_object[id],true);
|
||||
while (!DOES_OBJECT_EXIST(Attach_object[id]))WAIT(0);
|
||||
block_net_control_of_object(Attach_object[id]);
|
||||
ATTACH_OBJECT_TO_PED(Attach_object[id],BG_ped[i],pedbone, obj_x, obj_y, obj_z, obj_rx, obj_ry, obj_rz,false);
|
||||
}
|
||||
Alert("~b~MD: ~s~Attached Selected Object to Guards",false);
|
||||
}
|
||||
}
|
||||
void Teleport_BGuards_Coord(float x, float y, float z){
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
int BG_id;
|
||||
GET_NETWORK_ID_FROM_PED(BG_ped[i], &BG_id);
|
||||
if(network_control(BG_id)){
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
if(IS_CHAR_IN_ANY_CAR(BG_ped[i]))
|
||||
WARP_CHAR_FROM_CAR_TO_COORD(BG_ped[i],x,y,z);
|
||||
else
|
||||
SET_CHAR_COORDINATES(BG_ped[i], x, y, z);
|
||||
}
|
||||
}
|
||||
Alert("~b~MD: ~s~Bodyguards teleported.",false);
|
||||
}
|
||||
|
||||
void Spawn_BGuards(const int playersPed, const int model, const int weapon){
|
||||
if(DOES_CHAR_EXIST(playersPed)){
|
||||
fix_group_for_guards();
|
||||
if(Number_of_BGuards() > (MAX_SPAWNGUARDS - 1)){
|
||||
Alert("~b~MD: ~s~Maximum bodyguards have been spawned!",false);
|
||||
return;
|
||||
}
|
||||
REQUEST_MODEL(model);
|
||||
while(!HAS_MODEL_LOADED(model)) WAIT(0);
|
||||
int i,rand;
|
||||
float x,y,z;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS(playersPed, 0, 2, 0, &x, &y, &z);
|
||||
GENERATE_RANDOM_INT_IN_RANGE(0,14,&rand);
|
||||
// RELATIONSHIP_GROUP_MISSION_4, //26 //this must be whai
|
||||
//CREATE_CHAR(26, model, x + rand,y + rand,z, &BG_ped[i], true);
|
||||
CREATE_CHAR(RELATIONSHIP_GROUP_MISSION_1, model, x + rand,y + rand,z, &BG_ped[i], true);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
if(In_Network){
|
||||
int NetID;
|
||||
GET_NETWORK_ID_FROM_PED(BG_ped[i],&NetID);
|
||||
SET_NETWORK_ID_CAN_MIGRATE(NetID,false);
|
||||
}
|
||||
SET_CHAR_RANDOM_COMPONENT_VARIATION(BG_ped[i]);
|
||||
SET_GROUP_MEMBER(BG_Group, BG_ped[i]);
|
||||
SET_CHAR_NEVER_LEAVES_GROUP(BG_ped[i], true);
|
||||
SET_PLAYER_GROUP_TO_FOLLOW_ALWAYS(iPlayer,true);
|
||||
SET_GROUP_SEPARATION_RANGE(BG_Group,1000);
|
||||
//SET_CHAR_RELATIONSHIP_GROUP(BG_ped[i], RELATIONSHIP_GROUP_PLAYER); //yes leave them as generic singleplayer blah, good
|
||||
SET_CHAR_RELATIONSHIP(BG_ped[i], RELATIONSHIP_RESPECT, PLAYERS_RELATIONSHIP_GROUP(iPlayer)); //tell them to respect us (the user), Good!
|
||||
//SET_CHAR_RELATIONSHIP(BG_ped[i], RELATIONSHIP_RESPECT, RELATIONSHIP_GROUP_PLAYER);
|
||||
SET_CHAR_ACCURACY(BG_ped[i], 500);
|
||||
SET_SENSE_RANGE(BG_ped[i], 1000.0);
|
||||
SET_PED_GENERATES_DEAD_BODY_EVENTS(BG_ped[i], true);
|
||||
SET_CHAR_SHOOT_RATE(BG_ped[i], 200);
|
||||
SET_CHAR_WILL_USE_COVER(BG_ped[i], true);
|
||||
SET_CHAR_WILL_DO_DRIVEBYS(BG_ped[i], true);
|
||||
SET_CHAR_SIGNAL_AFTER_KILL(BG_ped[i], true);
|
||||
SET_CHAR_WILL_USE_CARS_IN_COMBAT(BG_ped[i], true);
|
||||
SET_CHAR_WILL_FLY_THROUGH_WINDSCREEN(BG_ped[i], false);
|
||||
SET_CHAR_INVINCIBLE(BG_ped[i], true); ////////////////
|
||||
SET_CHAR_PROOFS(BG_ped[i], true, true, true, true, true);
|
||||
SET_CHAR_PROVIDE_COVERING_FIRE(BG_ped[i], true);
|
||||
SET_CHAR_CANT_BE_DRAGGED_OUT(BG_ped[i], true);
|
||||
SET_CHAR_STAY_IN_CAR_WHEN_JACKED(BG_ped[i], true);
|
||||
SET_PED_DONT_DO_EVASIVE_DIVES(BG_ped[i], false);
|
||||
SET_PED_PATH_MAY_DROP_FROM_HEIGHT(BG_ped[i], true);
|
||||
SET_PED_PATH_MAY_USE_CLIMBOVERS(BG_ped[i], true);
|
||||
SET_PED_PATH_MAY_USE_LADDERS(BG_ped[i], true);
|
||||
SET_ROCKET_LAUNCHER_FREEBIE_IN_HELI(true);
|
||||
GIVE_PED_HELMET(BG_ped[i]);
|
||||
SET_CHAR_KEEP_TASK(BG_ped[i], true);
|
||||
UpdateWeaponOfPed(BG_ped[i], weapon);
|
||||
SET_CURRENT_CHAR_WEAPON(BG_ped[i], weapon, true);
|
||||
//GIVE_PED_FAKE_NETWORK_NAME(Ped ped, char *name, int r, int g, int b, int a);
|
||||
/*
|
||||
MAX_SPAWNGUARDS 7
|
||||
*/
|
||||
/*
|
||||
WAIT(500);
|
||||
char* guard_net_names[7];
|
||||
//guard_net_names[0] = "~b~MD ~s~Bodyguard ~COL_NET_4~1"; //string too long
|
||||
guard_net_names[0] = "MD Bodyguard 1";
|
||||
guard_net_names[1] = "MD Bodyguard 2";
|
||||
guard_net_names[2] = "MD Bodyguard 3";
|
||||
guard_net_names[3] = "MD Bodyguard 4";
|
||||
guard_net_names[4] = "MD Bodyguard 5";
|
||||
guard_net_names[5] = "MD Bodyguard 6";
|
||||
guard_net_names[6] = "MD Bodyguard 7";
|
||||
int i, rand[3];
|
||||
for(i = 0; i < 3; i++)
|
||||
{
|
||||
GENERATE_RANDOM_INT_IN_RANGE(0, 255, &rand[i]);
|
||||
}
|
||||
|
||||
GIVE_PED_FAKE_NETWORK_NAME(BG_ped[i], guard_net_names[i], rand[0], rand[1], rand[2], 200);
|
||||
*/
|
||||
return; // BG_ped[i];
|
||||
}
|
||||
}
|
||||
else return Alert(Error_No_Player,false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Ragdoll_BGuards(void){
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
SWITCH_PED_TO_RAGDOLL(BG_ped[i],20000,30000,false,false,false,false);
|
||||
}
|
||||
Alert("~b~MD: ~s~Ragdoll'd bodyguards.",false);
|
||||
}
|
||||
|
||||
void Delete_Objects_BGuards(void){
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
delete_objects_on_ped(BG_ped[i]); //sorted buddy :D
|
||||
}
|
||||
//Universal_Delete( 20,2, false );
|
||||
Alert("~b~MD: ~s~Objects attached to guards cleared.",false);
|
||||
}
|
||||
|
||||
/**use looped**/
|
||||
void Attach_BG_To_Vehcile(const int vehicle,float wide1,float wide2,float position_y, float height, float angle){
|
||||
int i;
|
||||
int BG_id;
|
||||
float net_x,net_y,net_z;
|
||||
Ped NetPlayer_Char;
|
||||
if(!Guard_Check()) return;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
if (DOES_VEHICLE_EXIST(vehicle)){
|
||||
ATTACH_PED_TO_CAR(BG_ped[i], vehicle, 0, wide1, position_y, height, 0.00, angle, 0.00, 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Fire_BG_Weapon(const int player_index){
|
||||
int i;
|
||||
int BG_id;
|
||||
float net_x,net_y,net_z;
|
||||
Ped NetPlayer_Char;
|
||||
if(!Guard_Check()) return;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
GET_PLAYER_CHAR(player_index,&NetPlayer_Char);
|
||||
if(!DOES_CHAR_EXIST(NetPlayer_Char)) continue;
|
||||
GetOffset(NetPlayer_Char, 5, &net_x, &net_y, &net_y);
|
||||
FIRE_PED_WEAPON(BG_ped[i], net_x, net_y, net_z);
|
||||
}
|
||||
Alert("~b~MD: ~s~Firing Guards Weapon",false);
|
||||
}
|
||||
void weapon_vehicle2(int weapon){
|
||||
float x ,y ,z ,Offset_x , Offset_y , Offset_z ;
|
||||
Vehicle Weapon_Vehicle;
|
||||
if(IS_CHAR_IN_ANY_CAR(pPlayer)){
|
||||
if(IS_CHAR_IN_ANY_CAR(pPlayer)){
|
||||
int Veh_Guard;
|
||||
for(Veh_Guard = 0;Veh_Guard < MAX_SPAWNGUARDS;Veh_Guard++){
|
||||
Spawn_BGuards(pPlayer, MODEL_M_Y_CLUBFIT,weapon);
|
||||
}
|
||||
Attach_BG_To_Vehcile(Personal_Vehicle,0,0,0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Strides_BGuards(const char* set){
|
||||
int i;
|
||||
int BG_id;
|
||||
if(!Guard_Check()) return;
|
||||
REQUEST_ANIMS(set);
|
||||
while(!HAVE_ANIMS_LOADED(set)) WAIT(0);
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
GET_NETWORK_ID_FROM_PED(BG_ped[i], &BG_id);
|
||||
if(network_control(BG_id)){
|
||||
SET_ANIM_GROUP_FOR_CHAR(BG_ped[i],set);
|
||||
}
|
||||
}
|
||||
Alert("~b~MD: ~s~Bodyguard strides set.",false);
|
||||
REMOVE_ANIMS(set);
|
||||
}
|
||||
|
||||
void BGuards_Clear_Enemies(void)
|
||||
{
|
||||
int i,z;
|
||||
for(i = 0; i < MAX_PLAYERS; i++)
|
||||
{
|
||||
if(i == iPlayer) continue;
|
||||
for(z = 0; z < MAX_SPAWNGUARDS; z++)
|
||||
{
|
||||
if(!DOES_CHAR_EXIST(BG_ped[z])) continue;
|
||||
CLEAR_ALL_CHAR_RELATIONSHIPS(BG_ped[z], PLAYERS_RELATIONSHIP_GROUP(i));
|
||||
Alert("~b~MD: ~s~Bodyguards enemies cleared.",false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**This works*/
|
||||
void BGuard_Send_After_PlayerPED(const int player_index, const int player_ped){
|
||||
if(DOES_CHAR_EXIST(player_ped) || PLAYER_HAS_CHAR(player_index)){
|
||||
if(!Guard_Check()) return; //just for safety
|
||||
int i;
|
||||
for(i = 0;i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i]) || !DOES_CHAR_EXIST(player_ped))continue;
|
||||
int BG_id;
|
||||
GET_NETWORK_ID_FROM_PED(BG_ped[i], &BG_id);
|
||||
if(network_control(BG_id)){
|
||||
//SET_NETWORK_ID_CAN_MIGRATE(BG_id,true);
|
||||
SET_CHAR_NEVER_LEAVES_GROUP(BG_ped[i], true);
|
||||
//SET_PLAYER_GROUP_TO_FOLLOW_ALWAYS(player_index,true); //we need to always follow our group, not other peoples :S
|
||||
//SET_CHAR_RELATIONSHIP(BG_ped[i], RELATIONSHIP_HATE, RELATIONSHIP_GROUP_PLAYER);
|
||||
SET_CHAR_RELATIONSHIP(BG_ped[i], RELATIONSHIP_HATE, PLAYERS_RELATIONSHIP_GROUP(player_index));
|
||||
SET_POLICE_IGNORE_PLAYER(player_index, false);
|
||||
SET_GROUP_CHAR_DUCKS_WHEN_AIMED_AT(BG_ped[i], true);
|
||||
SET_CHAR_SHOOT_RATE(BG_ped[i], 1000);
|
||||
SET_CHAR_ACCURACY(BG_ped[i], 1000);
|
||||
SET_CHAR_FIRE_DAMAGE_MULTIPLIER(BG_ped[i], 1000);
|
||||
SET_CHAR_WILL_USE_CARS_IN_COMBAT(BG_ped[i], true);
|
||||
SET_CHAR_WILL_LEAVE_CAR_IN_COMBAT(BG_ped[i], false);
|
||||
SET_CHAR_WILL_DO_DRIVEBYS(BG_ped[i], true);
|
||||
SET_CHAR_WILL_USE_COVER(BG_ped[i], true);
|
||||
SET_CHAR_GET_OUT_UPSIDE_DOWN_CAR(BG_ped[i],true);
|
||||
SET_CHAR_BLEEDING(BG_ped[i], true);
|
||||
//UpdateWeaponOfPed(BG_ped[i], weapon);
|
||||
//SET_CURRENT_CHAR_WEAPON(BG_ped[i], weapon, true);
|
||||
TASK_COMBAT(BG_ped[i], player_ped); //probably not needed anymore //TESTING WITH RELATIONSHIP GROUPS ALONE //doesn't seem to work anymore on its own
|
||||
SET_CHAR_KEEP_TASK(BG_ped[i], true);
|
||||
//SET_NETWORK_ID_CAN_MIGRATE(BG_id,true);
|
||||
}
|
||||
}
|
||||
char * buffer[16];
|
||||
Strcpy(buffer, "~b~MD: ~s~Bodyguards sent after "); //41
|
||||
PLAYER_NAME_WITH_COLOUR(player_index,&buffer);
|
||||
Strcat(buffer, "."); //63 characters
|
||||
Alert(buffer, false);
|
||||
}
|
||||
else return Alert(Error_No_Player,false);
|
||||
}
|
||||
|
||||
void Set_BGuards_Invincible(const bool invincible) //Nathan new
|
||||
{
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++)
|
||||
{
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
SET_CHAR_INVINCIBLE(BG_ped[i], invincible);
|
||||
SET_CHAR_PROOFS(BG_ped[i], invincible, invincible, invincible, invincible, invincible);
|
||||
}
|
||||
Alert( invincible ? "~b~MD: ~s~Bodyguards are now invincible." : "~b~MD: ~s~Bodyguards are no longer invincible.", false);
|
||||
}
|
||||
|
||||
void Kill_BGuards(void) //Temporary fix
|
||||
{
|
||||
Set_BGuards_Invincible(false);
|
||||
}
|
||||
|
||||
void Invincibility_BGuards(void) //Temporary fix
|
||||
{
|
||||
Set_BGuards_Invincible(true);
|
||||
}
|
||||
|
||||
void Helmets_BGuards(void){
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++)
|
||||
{
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
GIVE_PED_HELMET(BG_ped[i]);
|
||||
}
|
||||
Alert("~b~MD: ~s~Helmets given to bodyguards.",false);
|
||||
}
|
||||
|
||||
void Remove_Helmets_BGuards(void){
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++)
|
||||
{
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
REMOVE_PED_HELMET(BG_ped[i], true);
|
||||
}
|
||||
Alert("~b~MD: ~s~Helmets removed from bodyguards.",false);
|
||||
}
|
||||
|
||||
void Clear_Task_BGuards(void) //Nathan new
|
||||
{
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++)
|
||||
{
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
CLEAR_CHAR_TASKS_IMMEDIATELY(BG_ped[i]);
|
||||
}
|
||||
Alert("~b~MD: ~s~Bodyguard tasks cleared.",false);
|
||||
}
|
||||
|
||||
void Clear_One_BGuards(void) //Nathan new
|
||||
{
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++)
|
||||
{
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
FORCE_CHAR_TO_DROP_WEAPON(BG_ped[i]);
|
||||
delete_objects_on_ped(BG_ped[i]);
|
||||
DELETE_CHAR(&BG_ped[i]);
|
||||
MARK_CHAR_AS_NO_LONGER_NEEDED(&BG_ped[i]);
|
||||
break;
|
||||
}
|
||||
Alert("~b~MD: ~s~One bodyguard was deleted.",false);
|
||||
}
|
||||
|
||||
void Weapon_BGuards(const int weapon) //Nathan new
|
||||
{
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++)
|
||||
{
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
REMOVE_ALL_CHAR_WEAPONS(BG_ped[i]);
|
||||
WAIT(3);
|
||||
UpdateWeaponOfPed(BG_ped[i], weapon);
|
||||
SET_CURRENT_CHAR_WEAPON(BG_ped[i],weapon, true);
|
||||
BGWeapontype_Lastselected = weapon;
|
||||
}
|
||||
Alert("~b~MD: ~s~Selected weapon given to bodyguards.",false);
|
||||
}
|
||||
|
||||
void Remove_Weapon_BGuards(void)
|
||||
{
|
||||
if(!Guard_Check()) return;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++)
|
||||
{
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
Run_Ptfx(BG_ped[i]);
|
||||
REMOVE_ALL_CHAR_WEAPONS(BG_ped[i]);
|
||||
|
||||
}
|
||||
Alert("~b~MD: ~s~Selected weapon removed from bodyguards.",false);
|
||||
}
|
||||
|
||||
void Teleport_BGuards(void) //temporary fix
|
||||
{
|
||||
float x,y,z;
|
||||
GET_CHAR_COORDINATES(pPlayer,&x,&y,&z);
|
||||
Teleport_BGuards_Coord(x,y,z);
|
||||
}
|
||||
|
||||
void Teleport_InPlayerVeh_BGuards(const int Player_ID, const int num_guards){ //Nathan new!
|
||||
if(PLAYER_HAS_CHAR(Player_ID)){
|
||||
if(!Guard_Check()) return;
|
||||
Ped Player_PED;
|
||||
GET_PLAYER_CHAR(Player_ID,&Player_PED);
|
||||
char * buffer[32];
|
||||
Strcpy(buffer, "~b~MD: ");
|
||||
if(!DOES_CHAR_EXIST(Player_PED))
|
||||
{
|
||||
PLAYER_NAME_WITH_COLOUR(Player_ID, &buffer);
|
||||
Strcat(buffer, "~s~ does not have a character.");
|
||||
Alert(buffer,false);
|
||||
return;
|
||||
}
|
||||
const bool in_car = IS_CHAR_IN_ANY_CAR(Player_PED);
|
||||
if(in_car)
|
||||
{
|
||||
int Player_PED_veh;
|
||||
GET_CAR_CHAR_IS_USING(Player_PED,&Player_PED_veh);
|
||||
int i,teleported_guards = 0;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++)
|
||||
{
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
int z;
|
||||
for(z = 0; z < 3; z++)
|
||||
{
|
||||
if(!IS_CAR_PASSENGER_SEAT_FREE(Player_PED_veh,z) || teleported_guards >= num_guards) continue;
|
||||
//Run_Ptfx(BG_ped[i]);
|
||||
WARP_CHAR_INTO_CAR_AS_PASSENGER(BG_ped[i],Player_PED_veh,z);
|
||||
teleported_guards++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Strcat(buffer, "~s~");
|
||||
itoa(teleported_guards,buffer);
|
||||
Strcat(buffer, " bodyguards are now in ");
|
||||
PLAYER_NAME_WITH_COLOUR(Player_ID, &buffer);
|
||||
Strcat(buffer, "'s ~s~");
|
||||
Strcat(buffer,VEHICLES_MODEL_NAME(Player_PED_veh));
|
||||
Strcat(buffer, ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
PLAYER_NAME_WITH_COLOUR(Player_ID, &buffer);
|
||||
Strcat(buffer, " ~s~is not in a vehicle.");
|
||||
}
|
||||
Alert(buffer,false);
|
||||
}
|
||||
else return Alert(Error_No_Player,false);
|
||||
}
|
||||
|
||||
|
||||
//!Not used yet in the code
|
||||
void Teleport_InVeh_BGuards(const int Player_ID){ //Nathan new //should change to playerid
|
||||
//!**Player Char Check**//
|
||||
Ped Player_PED;
|
||||
Vehicle vehicle;
|
||||
if(!PLAYER_HAS_CHAR(Player_ID))return Alert_Abort(Error_Char_Missing,false);
|
||||
else GET_PLAYER_CHAR(Player_ID,&Player_PED);
|
||||
/**Vehicle Checker**/
|
||||
if(!IS_CHAR_IN_ANY_CAR(Player_PED)){
|
||||
if(Player_PED == pPlayer)Alert_Abort(Error_Personal_Vehicle,false);
|
||||
else Alert_Abort(Error_NetPlayer_Vehicle,false);
|
||||
}
|
||||
else GET_CAR_CHAR_IS_USING(Player_PED,&vehicle);
|
||||
if(!Guard_Check()) return;
|
||||
int i,tmp;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
int z;
|
||||
for(z = 0; z < 3; z++){
|
||||
if(!IS_CAR_PASSENGER_SEAT_FREE(tmp,z)) continue;
|
||||
WARP_CHAR_INTO_CAR_AS_PASSENGER(BG_ped[i],vehicle,z);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Alert("~b~MD: ~s~Bodyguards were teleported into a vehicle.",false);
|
||||
}
|
||||
|
||||
|
||||
void BGuards_Arm_Vehicle(const int Player_ID){
|
||||
//!**Player Char Check**//
|
||||
Ped Player_PED;
|
||||
Vehicle vehicle;
|
||||
if(!PLAYER_HAS_CHAR(Player_ID))return Alert_Abort(Error_Char_Missing,false);
|
||||
else GET_PLAYER_CHAR(Player_ID,&Player_PED);
|
||||
/**Vehicle Checker**/
|
||||
if(Player_ID == iPlayer){
|
||||
if(!IS_CHAR_IN_ANY_CAR(Player_PED))MD_VEHICLE_SPAWNER_ON_ID(iPlayer,MODEL_SULTAN);
|
||||
WAIT(100);
|
||||
}
|
||||
if(!IS_CHAR_IN_ANY_CAR(Player_PED)){
|
||||
if(Player_PED == pPlayer)Alert_Abort(Error_Personal_Vehicle,false);
|
||||
else Alert_Abort(Error_NetPlayer_Vehicle,false);
|
||||
}
|
||||
else GET_CAR_CHAR_IS_USING(Player_PED,&vehicle);
|
||||
int Free_Seat;
|
||||
for(Free_Seat = 0; Free_Seat < 3; Free_Seat++){
|
||||
if(!IS_CAR_PASSENGER_SEAT_FREE(vehicle, Free_Seat)) continue;
|
||||
if(!DOES_CHAR_EXIST(BG_ped[Free_Seat]))Spawn_BGuards(Player_PED,MODEL_M_M_ARMOURED,WEAPON_MP5);
|
||||
if(IS_CHAR_IN_CAR(BG_ped[Free_Seat],vehicle)) continue;
|
||||
WAIT(100);
|
||||
WARP_CHAR_INTO_CAR_AS_PASSENGER(BG_ped[Free_Seat],vehicle,Free_Seat);
|
||||
WAIT(100);
|
||||
SET_CHAR_WILL_LEAVE_CAR_IN_COMBAT(BG_ped[Free_Seat], false);
|
||||
SET_CHAR_WILL_USE_CARS_IN_COMBAT(BG_ped[Free_Seat], true);
|
||||
}
|
||||
}
|
||||
540
Trident/MD_Functions/MDF_ContentBuilder_Functions.c
Normal file
540
Trident/MD_Functions/MDF_ContentBuilder_Functions.c
Normal file
@@ -0,0 +1,540 @@
|
||||
/**
|
||||
* @ MAJOR DISTRIBUTION EXTEND
|
||||
* @ Version V13 TRIDENT
|
||||
* @ DEV TEAM V13 - IIV NATHAN VII & DEVILSDESIGN
|
||||
*/
|
||||
//FILE HEAVILY OPTIMISED BY NATHAN -- VERY NICELY DONE!!!
|
||||
/**
|
||||
How to use :
|
||||
A. Create a function for the actionpad spawn // set an object
|
||||
1. Teleporter Mobile (using the grids + spark = 6 objects!)
|
||||
2. Teleporter on fixed place (using the grids + spark = 6 objects!)
|
||||
3. Actionpad doing a function (undefined)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
void aPadObjects(void){
|
||||
create_mobile_mapbase(pPlayer,0x4F3E5681,0.00f, -0.97f,0.00f, 1, 0);//1st object all the others are attached to
|
||||
create_mobile_mapobj(0x55CA3AE6,1, 0, 0.5483, 3.150,0,0);//SPARK
|
||||
create_mobile_mapobj(0x4F3E5681,-3.1206, 0, -2.2700, 0,1.575,0);//Grid1
|
||||
create_mobile_mapobj(0x4F3E5681,3.1206, 0, -2.2700, 0,4.725,0);//grid2
|
||||
create_mobile_mapobj(0x4F3E5681,0, 4.500, -3.7767, 1.575,0,0);//grid3
|
||||
}
|
||||
void aPadPayNSprayObjects(void){
|
||||
aPadObjects();
|
||||
create_mobile_mapobj(-41876173,22.5808,-9.3944,-3.500,0,0.0,0);//Pain spray Building
|
||||
create_mobile_mapobj(-1855959785,-3.0934,-4.725,-4.2500,0,0.0,4.725);//traffic lights
|
||||
create_mobile_mapobj(-1855959785,3.0934,-4.725,-4.2500,0,0.0,4.725);//traffic lights
|
||||
create_mobile_mapobj(-1855959785,-3.7792,3.9734,-4.2500,0,0.0,3.150);//traffic lights
|
||||
create_mobile_mapobj(-1855959785,3.7792,3.9734,-4.2500,0,0.0,0);//traffic lights
|
||||
}
|
||||
void aPadVehicleGeneratorObjects(void)
|
||||
{
|
||||
aPadObjects();
|
||||
create_mobile_mapobj(-1855959785,-3.0934,-4.725,-4.2500,0,0.0,4.725);//traffic lights
|
||||
create_mobile_mapobj(-1855959785,3.0934,-4.725,-4.2500,0,0.0,4.725);//traffic lights
|
||||
create_mobile_mapobj(-1855959785,-3.7792,3.9734,-4.2500,0,0.0,3.150);//traffic lights
|
||||
create_mobile_mapobj(-1855959785,3.7792,3.9734,-4.2500,0,0.0,0);//traffic lights
|
||||
create_mobile_mapobj(-1324211035,0,7.0815,-1.0811+0.970,0,0.0,0);//ramp
|
||||
}
|
||||
|
||||
#pragma once
|
||||
|
||||
#define MAX_ACTIONPADS 3
|
||||
|
||||
enum ePadActions{
|
||||
// ACTION_SULTANRS_TELEPORT = 1,
|
||||
ACTION_VEHICLE_GENERATE = 2,
|
||||
ACTION_PAYNSPRAY = 3,
|
||||
ACTION_TELEPORT_COORD_GROUND_X_Y = 4,
|
||||
};
|
||||
|
||||
|
||||
typedef struct _action_pads{
|
||||
int actionPadObj;
|
||||
int action; //0 by default
|
||||
int veh_model_to_generate; //0 by default so we can generate whatever vehicle easily, one var :P
|
||||
float TeleportCoordGroundX;
|
||||
float TeleportCoordGroundY; //X and Y both set to 1337 on startup, when we delete actionpads, we have to set the action pad index's coords to 1337 too for safety..
|
||||
} action_pads;
|
||||
action_pads aPads[MAX_ACTIONPADS]; //var usage = (5 x MAX_ACTIONPADS)
|
||||
|
||||
|
||||
/*
|
||||
|
||||
void telepad_saved1(void){
|
||||
create_mobile_mapbase(pPlayer,0xDD28B247,0,4,0, true, false);//blue cube
|
||||
create_mobile_mapbase(pPlayer,0x4F3E5681,0, -0.970,0, true, false);//1st object all the others are attached to
|
||||
create_mobile_mapobj(0x55CA3AE6,1, 0, 0.5483, 3.150,0,0);//SPARK
|
||||
create_mobile_mapobj(0x4F3E5681,-3.1206, 0, -2.2700, 0,1.575,0);//Grid1
|
||||
create_mobile_mapobj(0x4F3E5681,3.1206, 0, -2.2700, 0,4.725,0);//grid2
|
||||
create_mobile_mapobj(0x4F3E5681,0, 4.500, -3.7767, 1.575,0,0);//grid3
|
||||
}
|
||||
void telepad_saved2(void){
|
||||
create_mobile_mapbase(pPlayer,0x2718C626,0,4,0, true, false);//red cube
|
||||
create_mobile_mapbase(pPlayer,0x4F3E5681,0, -0.970,0, true, false);//1st object all the others are attached to
|
||||
create_mobile_mapobj(0x55CA3AE6,1, 0, 0.5483, 3.150,0,0);//SPARK
|
||||
create_mobile_mapobj(0x4F3E5681,-3.1206, 0, -2.2700, 0,1.575,0);//Grid1
|
||||
create_mobile_mapobj(0x4F3E5681,3.1206, 0, -2.2700, 0,4.725,0);//grid2
|
||||
create_mobile_mapobj(0x4F3E5681,0, 4.500, -3.7767, 1.575,0,0);//grid3
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
//Create_Actionpad(pad_action, &padID);
|
||||
|
||||
//use an ePadActions, //set to 0 if not used, // use 1337 if not used //use 1337 if not used
|
||||
void Create_Actionpad(const int PadAction, const int model_to_generate, float teleportCoordsForPadX, float teleportCoordsForPadY) //Created at pPlayer coords
|
||||
{
|
||||
//this drops below pPlayer
|
||||
int i,free_aPad_Index = -1;
|
||||
for(i = 0; i < MAX_ACTIONPADS; i++)
|
||||
{
|
||||
if(DOES_OBJECT_EXIST(aPads[i].actionPadObj)) continue;
|
||||
free_aPad_Index = i;
|
||||
break;
|
||||
}
|
||||
char * buffer[32];
|
||||
if(free_aPad_Index == -1)
|
||||
{
|
||||
Strcpy(buffer, "~b~MD: ~s~The limit of ");
|
||||
itoa( MAX_ACTIONPADS, buffer);
|
||||
Strcat(buffer, " action pads has been reached.");
|
||||
Alert(buffer,false);
|
||||
return;
|
||||
}
|
||||
//REQUEST_MODEL(0x4F3E5681); // gamegrid
|
||||
|
||||
REQUEST_MODEL(0x4F3E5681);
|
||||
aPads[free_aPad_Index].action = PadAction;
|
||||
aPads[free_aPad_Index].veh_model_to_generate = model_to_generate;
|
||||
aPads[free_aPad_Index].TeleportCoordGroundX = teleportCoordsForPadX;
|
||||
aPads[free_aPad_Index].TeleportCoordGroundY = teleportCoordsForPadY;
|
||||
float x,y,z,h;
|
||||
if(IS_CHAR_IN_ANY_CAR(pPlayer))
|
||||
{
|
||||
int tmp_veh, tmp_driver;
|
||||
GET_CAR_CHAR_IS_USING(pPlayer,&tmp_veh);
|
||||
GET_DRIVER_OF_CAR(tmp_veh,&tmp_driver);
|
||||
if(tmp_driver == pPlayer)
|
||||
{
|
||||
SET_CAR_FORWARD_SPEED(tmp_veh,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
REMOVE_CHAR_FROM_CAR_MAINTAIN_POSITION(pPlayer,tmp_veh);
|
||||
}
|
||||
}
|
||||
while(!HAS_MODEL_LOADED(0x4F3E5681)) WAIT(0); //gamegrid
|
||||
//create object here
|
||||
GET_CHAR_COORDINATES(pPlayer,&x,&y,&z);
|
||||
GET_GROUND_Z_FOR_3D_COORD(x,y,z,&z); //no need for attempts here as you're loaded here and not teleporting / NO ISSUES
|
||||
GET_CHAR_HEADING(pPlayer,&h);
|
||||
CREATE_OBJECT(0x4F3E5681,x,y,z+0.05f,&aPads[free_aPad_Index].actionPadObj,true);
|
||||
FREEZE_OBJECT_POSITION(aPads[free_aPad_Index].actionPadObj,true);
|
||||
SET_OBJECT_INVINCIBLE(aPads[free_aPad_Index].actionPadObj,true);
|
||||
SET_OBJECT_HEADING(aPads[free_aPad_Index].actionPadObj,h);
|
||||
SET_OBJECT_COLLISION(aPads[free_aPad_Index].actionPadObj, false);
|
||||
SET_OBJECT_VISIBLE(aPads[free_aPad_Index].actionPadObj, false);
|
||||
int NetID;
|
||||
GET_NETWORK_ID_FROM_OBJECT(aPads[free_aPad_Index].actionPadObj,&NetID);
|
||||
SET_NETWORK_ID_CAN_MIGRATE(NetID,false);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(0x4F3E5681);
|
||||
if(PadAction == ACTION_PAYNSPRAY)
|
||||
{
|
||||
aPadPayNSprayObjects();
|
||||
}
|
||||
else if(PadAction == ACTION_VEHICLE_GENERATE)
|
||||
{
|
||||
aPadVehicleGeneratorObjects();
|
||||
}
|
||||
else if(PadAction == ACTION_TELEPORT_COORD_GROUND_X_Y)
|
||||
{
|
||||
aPadObjects();
|
||||
//create_mobile_mapbase(pPlayer,0x2718C626,0,4,0, true, false);//red cube
|
||||
//SPAWN CUBE WITH COLOUR BASED ON ACTION PAD INDEX :P
|
||||
|
||||
/*
|
||||
void telepad_saved2(void){
|
||||
create_mobile_mapbase(pPlayer,0x2718C626,0,4,0, true, false);//red cube
|
||||
|
||||
void telepad_saved1(void){
|
||||
create_mobile_mapbase(pPlayer,0xDD28B247,0,4,0, true, false);//blue cube
|
||||
*/
|
||||
}
|
||||
Strcpy(buffer, "~b~MD Actionpad ");
|
||||
itoa( (free_aPad_Index + 1), buffer);
|
||||
Strcat(buffer, ": ~s~Has been created.");
|
||||
Alert(buffer,false);
|
||||
}
|
||||
|
||||
void Actionpad_looped(void)
|
||||
{
|
||||
int i,j,f,n;
|
||||
float aPadCornerOffsetX[2];
|
||||
aPadCornerOffsetX[0] = 3.1204f;
|
||||
aPadCornerOffsetX[1] = -3.1284f;
|
||||
float aPadCornerOffsetY[2];
|
||||
aPadCornerOffsetY[0] = 4.6515f;
|
||||
aPadCornerOffsetY[1] = -4.6273f;
|
||||
|
||||
float aPadCornerWorldCoordX[2];
|
||||
float aPadCornerWorldCoordY[2];
|
||||
float aPadx,aPady,aPadz,z;
|
||||
for(i = 0; i < MAX_ACTIONPADS; i++)
|
||||
{
|
||||
if(!DOES_OBJECT_EXIST(aPads[i].actionPadObj))
|
||||
{
|
||||
aPads[i].TeleportCoordGroundX = 1337;
|
||||
aPads[i].TeleportCoordGroundY = 1337;
|
||||
//aPads[i].TeleportCoordGroundZ //if it causes issues i'll add this
|
||||
aPads[i].veh_model_to_generate = 0;
|
||||
aPads[i].action = 0;
|
||||
aPads[i].actionPadObj = 0; //reset
|
||||
continue;
|
||||
}
|
||||
GET_OBJECT_COORDINATES(aPads[i].actionPadObj,&aPadx,&aPady,&aPadz);
|
||||
for(j = 0; j < 2; j++)
|
||||
{
|
||||
GET_OFFSET_FROM_OBJECT_IN_WORLD_COORDS(aPads[i].actionPadObj,aPadCornerOffsetX[j],aPadCornerOffsetY[j],0,&aPadCornerWorldCoordX[j],&aPadCornerWorldCoordY[j],&z);
|
||||
}
|
||||
int tmp_ped,tmp_veh,tmp_driver;
|
||||
float tmp_x,tmp_y,tmp_z;
|
||||
for(f = 0; f < MAX_PLAYERS; f++)
|
||||
{
|
||||
if(Player_Display_Selection(f)) continue; //contains PLAYER_HAS_CHAR check -- NO
|
||||
GET_PLAYER_CHAR(f,&tmp_ped);
|
||||
if(IS_CHAR_IN_ANY_CAR(tmp_ped))
|
||||
{
|
||||
GET_CAR_CHAR_IS_USING(tmp_ped,&tmp_veh);
|
||||
GET_DRIVER_OF_CAR(tmp_veh,&tmp_driver);
|
||||
if(tmp_driver == tmp_ped) //Player is driving
|
||||
{
|
||||
if(!IS_CAR_IN_AREA_2D(tmp_veh,aPadCornerWorldCoordX[0],aPadCornerWorldCoordY[0],aPadCornerWorldCoordX[1],aPadCornerWorldCoordY[1],false)) continue;
|
||||
GET_CAR_COORDINATES(tmp_veh,&tmp_x,&tmp_y,&tmp_z);
|
||||
int distance;
|
||||
GET_DISTANCE_BETWEEN_COORDS_3D(aPadx,aPady,aPadz,tmp_x,tmp_y,tmp_z,&distance);
|
||||
if(distance > 7) continue;
|
||||
int netID;
|
||||
GET_NETWORK_ID_FROM_VEHICLE(tmp_veh,&netID);
|
||||
REQUEST_CONTROL_OF_NETWORK_ID(netID);
|
||||
if(!HAS_CONTROL_OF_NETWORK_ID(netID) || aPads[i].action == 0) continue; //if no control or action not defined (don't use 0)
|
||||
//WE NOW HAVE CONTROL OF PLAYERS CAR AND THEY ARE ON THE ACTION PAD
|
||||
char * buffer[32];
|
||||
Strcpy(buffer, "~b~MD ActionPad "); //16
|
||||
itoa( (i + 1), buffer); //17
|
||||
Strcat(buffer, ": ~COL_NET_"); //11 + 17 = 28
|
||||
itoa( (f + 1), buffer); //30
|
||||
Strcat(buffer, "~"); //31
|
||||
Strcat(buffer,GET_PLAYER_NAME(f)); //46
|
||||
|
||||
if(aPads[i].action == ACTION_VEHICLE_GENERATE)
|
||||
{
|
||||
if(aPads[i].veh_model_to_generate != 0 && IS_MODEL_IN_CDIMAGE(aPads[i].veh_model_to_generate)) //Hash has been set + Model is in users image.
|
||||
{
|
||||
if(!HAS_MODEL_LOADED(aPads[i].veh_model_to_generate))
|
||||
{
|
||||
REQUEST_MODEL(aPads[i].veh_model_to_generate);
|
||||
continue;
|
||||
}
|
||||
DELETE_CAR(&tmp_veh);
|
||||
float spawn_x,spawn_y,spawn_z;
|
||||
int spawned_veh;
|
||||
GET_OFFSET_FROM_OBJECT_IN_WORLD_COORDS(aPads[i].actionPadObj,0,4,0,&spawn_x, &spawn_y, &spawn_z);
|
||||
CREATE_CAR(aPads[i].veh_model_to_generate,spawn_x,spawn_y,spawn_z + 5, &spawned_veh, true);
|
||||
REQUEST_COLLISION_AT_POSN(spawn_x,spawn_y,spawn_z + 5);
|
||||
float h;
|
||||
GET_OBJECT_HEADING(aPads[i].actionPadObj,&h);
|
||||
SET_CAR_HEADING(spawned_veh,h);
|
||||
int rand[4],n;
|
||||
for(n = 0; n < 4; n++)
|
||||
{
|
||||
GENERATE_RANDOM_INT_IN_RANGE(0,134,&rand[n]);
|
||||
}
|
||||
CHANGE_CAR_COLOUR(spawned_veh,rand[0],rand[1]);
|
||||
SET_EXTRA_CAR_COLOURS(spawned_veh,rand[2],rand[3]);
|
||||
SET_CAR_CAN_BE_DAMAGED(spawned_veh,false);
|
||||
SET_CAR_CAN_BE_VISIBLY_DAMAGED(spawned_veh,false);
|
||||
SET_CAN_BURST_CAR_TYRES(spawned_veh,false); //can make a var for Actionpad_Generate_InvincibleVehs
|
||||
SET_CAR_STRONG(spawned_veh,true);
|
||||
Strcat(buffer, " ~s~used the ");
|
||||
Strcat(buffer, GET_STRING_FROM_TEXT_FILE(GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(aPads[i].veh_model_to_generate)));
|
||||
Strcat(buffer, " generator.");
|
||||
|
||||
}
|
||||
}
|
||||
else if(aPads[i].action == ACTION_PAYNSPRAY)
|
||||
{
|
||||
int rand[4];
|
||||
for(n = 0; n < 4; n++)
|
||||
{
|
||||
GENERATE_RANDOM_INT_IN_RANGE(0,134,&rand[n]);
|
||||
}
|
||||
CHANGE_CAR_COLOUR(tmp_veh,rand[0],rand[1]);
|
||||
SET_EXTRA_CAR_COLOURS(tmp_veh,rand[2],rand[3]);
|
||||
GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS(tmp_ped, 0, -8, 0 ,&tmp_x,&tmp_y,&tmp_z);
|
||||
SET_CAR_COORDINATES(tmp_veh,tmp_x, tmp_y, tmp_z); //their heading shouldn't change so no need to grab it
|
||||
Strcat(buffer, " ~s~used the Pay'NSpray."); //24 + 46 = 70
|
||||
}
|
||||
else if(aPads[i].action == ACTION_TELEPORT_COORD_GROUND_X_Y)
|
||||
{
|
||||
if(aPads[i].TeleportCoordGroundX != 1337 && aPads[i].TeleportCoordGroundY != 1337)
|
||||
{
|
||||
float ground;
|
||||
GET_GROUND_Z_FOR_3D_COORD(aPads[i].TeleportCoordGroundX,aPads[i].TeleportCoordGroundY,50,&ground);
|
||||
SET_CAR_FORWARD_SPEED(tmp_veh,0); //stop net control fucking them up
|
||||
SET_CAR_COORDINATES(tmp_veh,aPads[i].TeleportCoordGroundX,aPads[i].TeleportCoordGroundY,ground);
|
||||
Strcat(buffer, " ~s~was teleported to ~r~X: ~s~"); //78
|
||||
itoa((int)aPads[i].TeleportCoordGroundX, buffer); //max 5 chars? //83
|
||||
Strcat(buffer, " ~r~Y: ~s~"); //93
|
||||
itoa((int)aPads[i].TeleportCoordGroundY, buffer); //5 //might just get away with this
|
||||
}
|
||||
}
|
||||
|
||||
if(aPads[i].action > 1) //0 not used & 1 not defined currently
|
||||
{
|
||||
Alert(buffer, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if(DOES_OBJECT_EXIST(SultanRSGenerator_obj)){ //ACTIONPAD OBJECT
|
||||
//DEFINING ACTIONPAD
|
||||
int i,tmp,tmp_veh,tmp_vehNetId;
|
||||
float x,y,z,x2,y2,z2,h;
|
||||
float tmp_x,tmp_y,tmp_z;
|
||||
float mobile_obj_corner_1_x,mobile_obj_corner_2_x,mobile_obj_corner_1_y,mobile_obj_corner_2_y;
|
||||
float distance;
|
||||
GET_OBJECT_COORDINATES(SultanRSGenerator_obj,&x2,&y2,&z2);
|
||||
float ap_obj;
|
||||
GET_OFFSET_FROM_OBJECT_IN_WORLD_COORDS(SultanRSGenerator_obj,3.1204f,4.6515f,0,&mobile_obj_corner_1_x,&mobile_obj_corner_1_y,&ap_obj);
|
||||
GET_OFFSET_FROM_OBJECT_IN_WORLD_COORDS(SultanRSGenerator_obj,-3.1284f,-4.6273f,0,&mobile_obj_corner_2_x,&mobile_obj_corner_2_y,&ap_obj);
|
||||
//SCAN PLAYERS
|
||||
for(i=0;i<=15;i++){
|
||||
if(!IS_NETWORK_PLAYER_ACTIVE(i)) continue;
|
||||
GET_PLAYER_CHAR(i,&tmp);
|
||||
if(!DOES_CHAR_EXIST(tmp)) continue;
|
||||
if(!is_driving(tmp)) continue;
|
||||
GET_CAR_CHAR_IS_USING(tmp,&tmp_veh);
|
||||
if(!IS_CAR_IN_AREA_2D(tmp_veh,mobile_obj_corner_1_x,mobile_obj_corner_1_y,mobile_obj_corner_2_x,mobile_obj_corner_2_y,false)) continue;
|
||||
GET_CAR_COORDINATES(tmp_veh,&x,&y,&z);
|
||||
GET_CHAR_COORDINATES(tmp,&tmp_x,&tmp_y,&tmp_z);
|
||||
GET_DISTANCE_BETWEEN_COORDS_3D(x,y,z,x2,y2,z2,&distance);
|
||||
if(distance > 5) continue;
|
||||
|
||||
//Alert_Two(GET_PLAYER_NAME(i),"~BLIP_76~~COL_NET_4~was detected on the actionpad~n~~w~Attemting to get control of NET ID");
|
||||
GET_NETWORK_ID_FROM_VEHICLE(tmp_veh,&tmp_vehNetId);
|
||||
REQUEST_CONTROL_OF_NETWORK_ID(tmp_vehNetId);
|
||||
if(!HAS_CONTROL_OF_NETWORK_ID(tmp_vehNetId)) continue;
|
||||
if(!IS_CHAR_IN_ANY_HELI(tmp)){
|
||||
float Cargen_x, Cargen_y, Cargen_z, Cargen_h;// Cargen_zz;
|
||||
float TP_out_x, TP_out_y, TP_out_z, TP_out_h;
|
||||
uint carmodel,tmp_carmodel;
|
||||
GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS(tmp, 10, 0, 0 ,&TP_out_x,&TP_out_y,&TP_out_z);
|
||||
GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS(tmp, 0, 0, 0 ,&Cargen_x,&Cargen_y,&Cargen_z);
|
||||
//GET_GROUND_Z_FOR_3D_COORD(Cargen_x, Cargen_y, Cargen_z, &Cargen_zz);
|
||||
GET_CHAR_HEADING(tmp,&Cargen_h);
|
||||
REQUEST_MODEL(MODEL_SULTANRS);
|
||||
while(!HAS_MODEL_LOADED(MODEL_SULTANRS)) WAIT(0);
|
||||
GET_CAR_MODEL(tmp_veh, &tmp_carmodel);
|
||||
if(tmp_carmodel == MODEL_SULTANRS){
|
||||
SET_CAR_COORDINATES(tmp_veh,TP_out_x, TP_out_y, TP_out_z);
|
||||
SET_CAR_HEADING(tmp_veh,Cargen_h);
|
||||
}
|
||||
else{
|
||||
Vehicle vehicle;
|
||||
clear_objects_on_car(tmp_veh);
|
||||
DELETE_CAR(&tmp_veh);
|
||||
MARK_CAR_AS_NO_LONGER_NEEDED(&tmp_veh);
|
||||
CREATE_CAR(MODEL_SULTANRS,Cargen_x ,Cargen_y,Cargen_z,&vehicle,true);
|
||||
SET_CAR_COORDINATES_NO_OFFSET(vehicle, Cargen_x, Cargen_y, Cargen_z);
|
||||
SET_CAR_HEADING(vehicle,Cargen_h);
|
||||
FREEZE_CAR_POSITION(vehicle, false);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(MODEL_SULTANRS);
|
||||
GET_CAR_MODEL(vehicle, &carmodel);
|
||||
int colours[14],rand;
|
||||
colours[0] = 128; //yellow
|
||||
colours[1] = 120; //cream
|
||||
colours[2] = 107; //brown
|
||||
colours[3] = 59; //green
|
||||
colours[4] = 132; //yellow
|
||||
colours[5] = 129; //lightblue
|
||||
colours[6] = 125; //pink
|
||||
colours[7] = 135; //white
|
||||
colours[8] = 30; //red
|
||||
colours[9] = 46;
|
||||
colours[10] = 65; //blue
|
||||
colours[11] = 71; //blue
|
||||
colours[12] = 76; //blue
|
||||
colours[13] = 103; //
|
||||
GENERATE_RANDOM_INT_IN_RANGE(0,13,&rand);
|
||||
if(carmodel == MODEL_SULTANRS){
|
||||
CHANGE_CAR_COLOUR(vehicle,0,colours[rand]);
|
||||
SET_EXTRA_CAR_COLOURS(vehicle,colours[rand],colours[rand]);
|
||||
}
|
||||
else{
|
||||
int dick;
|
||||
GENERATE_RANDOM_INT_IN_RANGE(0,13,&dick);
|
||||
CHANGE_CAR_COLOUR(vehicle,colours[rand],colours[dick]);
|
||||
int cock;
|
||||
GENERATE_RANDOM_INT_IN_RANGE(0,13,&rand);
|
||||
GENERATE_RANDOM_INT_IN_RANGE(0,13,&cock);
|
||||
SET_EXTRA_CAR_COLOURS(vehicle,colours[rand],colours[cock]);
|
||||
}
|
||||
Alert_Two(GET_PLAYER_NAME(i),"~COL_NET_1~~BLIP_76~used the Sultan RS Generator",false);
|
||||
SET_CAR_COLLISION(vehicle, true);
|
||||
SET_CAR_CAN_BE_DAMAGED(vehicle, !damage);
|
||||
SET_CAR_CAN_BE_VISIBLY_DAMAGED(vehicle, !damage);
|
||||
SET_CAN_BURST_CAR_TYRES(vehicle,!damage);
|
||||
SET_CAR_STRONG(vehicle,!damage);
|
||||
|
||||
int j;
|
||||
for(j=0;j<=9;j++){
|
||||
TURN_OFF_VEHICLE_EXTRA(vehicle,j,false);
|
||||
}
|
||||
SWITCH_CAR_SIREN(vehicle,siren);
|
||||
SET_CAN_BURST_CAR_TYRES(vehicle,false);
|
||||
}
|
||||
}
|
||||
else{
|
||||
Alert_Two(GET_PLAYER_NAME(i),"~COL_NET_4~~BLIP_76~detected on actionpad using a heli~n~~w~Player is now burning to death!",false);
|
||||
clear_objects_on_car(tmp_veh);
|
||||
DELETE_CAR(&tmp_veh);
|
||||
MARK_CAR_AS_NO_LONGER_NEEDED(&tmp_veh);
|
||||
START_CHAR_FIRE(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
void Actionpad_teleport_function(uint function_object,float tx,float ty,float tz){
|
||||
if(DOES_OBJECT_EXIST(function_object)){ //ACTIONPAD OBJECT
|
||||
//DEFINING ACTIONPAD
|
||||
int i,tmp,tmp_veh,tmp_vehNetId;
|
||||
float x,y,z,x2,y2,z2,h;
|
||||
float mobile_obj_corner_1_x,mobile_obj_corner_2_x,mobile_obj_corner_1_y,mobile_obj_corner_2_y;
|
||||
float distance;
|
||||
GET_OBJECT_COORDINATES(function_object,&x2,&y2,&z2);
|
||||
float ap_obj;
|
||||
GET_OFFSET_FROM_OBJECT_IN_WORLD_COORDS(function_object,3.1204f,4.6515f,0,&mobile_obj_corner_1_x,&mobile_obj_corner_1_y,&ap_obj);
|
||||
GET_OFFSET_FROM_OBJECT_IN_WORLD_COORDS(function_object,-3.1284f,-4.6273f,0,&mobile_obj_corner_2_x,&mobile_obj_corner_2_y,&ap_obj);
|
||||
//SCAN PLAYERS
|
||||
for(i=0;i<MAX_PLAYERS;i++){
|
||||
if(!IS_NETWORK_PLAYER_ACTIVE(i)) continue;
|
||||
GET_PLAYER_CHAR(i,&tmp);
|
||||
if(!DOES_CHAR_EXIST(tmp)) continue;
|
||||
if(!is_driving(tmp)) continue;
|
||||
GET_CAR_CHAR_IS_USING(tmp,&tmp_veh);
|
||||
if(!IS_CAR_IN_AREA_2D(tmp_veh,mobile_obj_corner_1_x,mobile_obj_corner_1_y,mobile_obj_corner_2_x,mobile_obj_corner_2_y,false)) continue;
|
||||
GET_CAR_COORDINATES(tmp_veh,&x,&y,&z);
|
||||
GET_DISTANCE_BETWEEN_COORDS_3D(x,y,z,x2,y2,z2,&distance);
|
||||
if(distance > 5) continue;
|
||||
|
||||
Alert_Two(GET_PLAYER_NAME(i),"~BLIP_76~~COL_NET_4~was detected on the teleporter~n~~w~Attemting to get control of NET ID",false);
|
||||
GET_NETWORK_ID_FROM_VEHICLE(tmp_veh,&tmp_vehNetId);
|
||||
REQUEST_CONTROL_OF_NETWORK_ID(tmp_vehNetId);
|
||||
if(!HAS_CONTROL_OF_NETWORK_ID(tmp_vehNetId)) continue;
|
||||
if(!IS_CHAR_IN_ANY_HELI(tmp)){
|
||||
SET_CAR_COORDINATES(tmp_veh,tx,ty,tz);//do the function
|
||||
|
||||
if(tx == -970.6938)Alert_Two(GET_PLAYER_NAME(i),"~COL_NET_1~~BLIP_76~is teleporting to Sultan RS Spawn",false);
|
||||
if(tx == 2614.2830)Alert_Two(GET_PLAYER_NAME(i),"~COL_NET_1~~BLIP_76~is teleporting to Devils Cloud",false);
|
||||
if(tx == save_x1)Alert_Two(GET_PLAYER_NAME(i),"~COL_NET_1~~BLIP_76~is teleporting to Saved Location~y~ 1",false);
|
||||
if(tx == save_x2)Alert_Two(GET_PLAYER_NAME(i),"~COL_NET_1~~BLIP_76~is teleporting to Saved Location~y~ 2",false);
|
||||
|
||||
FIX_CAR(tmp_veh);
|
||||
//if(tmp != pPlayer)change_car_color(tmp_veh,0,30,30,30);//devilscolors --> make this optional
|
||||
GET_CAR_HEADING(tmp_veh, &h);
|
||||
SET_CAR_HEADING(tmp_veh,0);
|
||||
}
|
||||
else{
|
||||
Alert_Two(GET_PLAYER_NAME(i),"~COL_NET_4~~BLIP_76~tried to teleport using a heli~n~~w~Player is now burning to death!",false);
|
||||
clear_objects_on_car(tmp_veh);
|
||||
DELETE_CAR(&tmp_veh);
|
||||
MARK_CAR_AS_NO_LONGER_NEEDED(&tmp_veh);
|
||||
START_CHAR_FIRE(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* @ MAJOR DISTRIBUTION EXTEND
|
||||
* @ Version V7 ULTIMATE
|
||||
* @ DEV TEAM V7- DEVILSDESIGN
|
||||
*/
|
||||
|
||||
/**
|
||||
How to use :
|
||||
A. Create a function for the actionpad spawn // set an object
|
||||
1. Teleporter Mobile (using the grids + spark = 6 objects!) //eh? -- Nathan
|
||||
2. Teleporter on fixed place (using the grids + spark = 6 objects!)
|
||||
3. Actionpad doing a function (undefined)
|
||||
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**Teleporter needs*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
float save_x1 = 1234.5678, save_y1 = 1234.5678, save_z1 = 1234.5678; //Telepad 1
|
||||
float save_x2 = 8765.4321, save_y2 = 8765.4321, save_z2 = 8765.4321; //Telepad 2
|
||||
float custom_float_change;
|
||||
Object savedlocation1;//used for mobile teleport with saved coords
|
||||
Object savedlocation2;
|
||||
//Object Waypoint_location;
|
||||
Object greencloud_obj;//used for devilscloud ramp
|
||||
Object SultanRS_Teleport_obj;// used for test teleporter
|
||||
Object PayNSpray_obj;
|
||||
Object SultanRSGenerator_obj;
|
||||
Object CometGenerator_obj;
|
||||
Object SabreGTGenerator_obj;
|
||||
Object SentinelGenerator_obj;
|
||||
Object FbiGenerator_obj;
|
||||
Object PatriotGenerator_obj;
|
||||
*/
|
||||
void content_builder_setup(void){
|
||||
MENU_SUB_HEADER = "Content Builder";
|
||||
AddSubMenu("~PAD_RIGHT~ Spawn 8 Vehicles Around You"); //1
|
||||
AddSubMenu("~PAD_RIGHT~ Custom & Funny Vehicles"); //2
|
||||
AddSubMenu("~PAD_RIGHT~ Buildings Near You"); //3
|
||||
AddSubMenu("~PAD_RIGHT~ MapMod Builder On The Fly"); //4
|
||||
AddSubMenu("~PAD_RIGHT~ Spawn MapMods"); //5
|
||||
AddSubMenu("~PAD_RIGHT~ Special Effects"); //6
|
||||
AddSubMenu("~PAD_RIGHT~ Object Rotations"); //7
|
||||
AddSubMenu("~PAD_RIGHT~ Fun Stuff - Devils Favourites"); //AddSubMenu("~PAD_RIGHT~ Give mods to others"); //8 // Change this to fun stuff
|
||||
AddSubMenu("~PAD_RIGHT~ Blocked / Restricted Areas"); //9
|
||||
AddSubMenu("~PAD_RIGHT~ AirStrikes"); //10
|
||||
AddSubMenu("~PAD_RIGHT~ Mobile Teleporters - Non Modders");//11
|
||||
AddSubMenu("~PAD_RIGHT~ ActionPads - Non Modders"); //12
|
||||
AddSubMenu("~PAD_RIGHT~ Delete/Clear Options"); //13
|
||||
}
|
||||
|
||||
void actionpad_setup(void){
|
||||
MENU_SUB_HEADER = "Actionpads";
|
||||
AddFunction("~BLIP_52~ Pay'N Spray"); //1
|
||||
AddFunction("~BLIP_52~ Sultan RS Generator"); //2
|
||||
AddFunction("~BLIP_52~ Comet Generator"); //3
|
||||
AddFunction("~BLIP_52~ Sabre GT Generator"); //4
|
||||
AddFunction("~BLIP_52~ Sentinel XS Generator"); //5
|
||||
AddFunction("~BLIP_52~ FBI Buffalo Generator"); //6
|
||||
AddFunction("~BLIP_52~ Patriot Generator"); //7
|
||||
}
|
||||
|
||||
373
Trident/MD_Functions/MDF_Creation_Functions.c
Normal file
373
Trident/MD_Functions/MDF_Creation_Functions.c
Normal file
@@ -0,0 +1,373 @@
|
||||
/**
|
||||
* @ MAJOR DISTRIBUTION EXTEND
|
||||
* @ Version V7 ULTIMATE
|
||||
* @ MADE BY - DEVILSDESIGN & IIV_NATHAN_VII & SHOCKixiXixiWAVE
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
void create_mobile_mapobj(int model,float ox, float oy, float oz, float rx,float ry,float rz){ //Working together with BASE !!! Attaching objects to Hook
|
||||
Object mapextra_obj;
|
||||
if (IS_MODEL_IN_CDIMAGE(model)){
|
||||
REQUEST_MODEL(model);
|
||||
while (!HAS_MODEL_LOADED(model))WAIT(0);
|
||||
CREATE_OBJECT_NO_OFFSET(model, 0, 0, 0, &mapextra_obj, true);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
|
||||
FREEZE_OBJECT_POSITION(mapextra_obj, true);
|
||||
SET_OBJECT_LIGHTS(mapextra_obj, true);
|
||||
SET_OBJECT_VISIBLE(mapextra_obj, true);
|
||||
SET_OBJECT_INVINCIBLE(mapextra_obj, true);
|
||||
|
||||
ATTACH_OBJECT_TO_OBJECT(mapextra_obj, mapbase_obj, 0, ox,oy,oz,rx,ry,rz);
|
||||
SET_OBJECT_COLLISION(mapextra_obj, true);
|
||||
block_net_control_of_object(mapextra_obj);
|
||||
}
|
||||
}
|
||||
|
||||
void GIVE_HEALTH_TO_CHAR(const int Player_PED){
|
||||
Pickup healthpack;
|
||||
float Player_PED_GroundZ;
|
||||
float Player_PED_x, Player_PED_y, Player_PED_z;
|
||||
Blip BlipPickup;
|
||||
REMOVE_ALL_PICKUPS_OF_TYPE(2);
|
||||
GET_CHAR_COORDINATES(Player_PED, &Player_PED_x, &Player_PED_y, &Player_PED_z);
|
||||
GET_GROUND_Z_FOR_3D_COORD(Player_PED_x, Player_PED_y, Player_PED_z, &Player_PED_GroundZ);
|
||||
CREATE_PICKUP(1069950328, 2, Player_PED_x, Player_PED_y, Player_PED_GroundZ, &healthpack, false);
|
||||
ADD_BLIP_FOR_PICKUP(healthpack, &BlipPickup);
|
||||
WAIT(200);
|
||||
REMOVE_PICKUP(healthpack);
|
||||
}
|
||||
|
||||
void Spawn_Pickup(Ped PlayerPed,Model SpawnPickup_model,Pickup PickupInt,uint SpawnPickup_type ){
|
||||
REMOVE_ALL_PICKUPS_OF_TYPE(2);
|
||||
|
||||
Blip BlipPickup;
|
||||
float PlayerPed_x, PlayerPed_y, PlayerPed_z;
|
||||
GET_CHAR_COORDINATES(PlayerPed, &PlayerPed_x, &PlayerPed_y, &PlayerPed_z);
|
||||
if(!IS_ANY_PICKUP_AT_COORDS(PlayerPed_x, PlayerPed_y, PlayerPed_z)){
|
||||
CREATE_PICKUP(SpawnPickup_model, SpawnPickup_type, PlayerPed_x, PlayerPed_y+1, PlayerPed_z, &PickupInt, false);
|
||||
ADD_BLIP_FOR_PICKUP(PickupInt, &BlipPickup);
|
||||
/*
|
||||
create_map_obj(1005973733, 0.0577, -0.1013, -2.5672, 0, 4.200, 0,0,0, 0);
|
||||
*/
|
||||
}
|
||||
|
||||
if(HAS_PICKUP_BEEN_COLLECTED(PickupInt)){
|
||||
Alert("Pickup has been collected",false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void create_object_vehicle(uint object_vehicle, int visible){// FUNCTION TO CREATE OBJECT VEHICLE BASE
|
||||
|
||||
REQUEST_MODEL(object_vehicle);
|
||||
MD_Delete_Objects_On_Vehicle(iPlayer);
|
||||
while (!HAS_MODEL_LOADED(object_vehicle))WAIT(0);
|
||||
float curHeading, curX, curY, curZ, cGroundZ, curSpeed;
|
||||
if (IS_CHAR_IN_ANY_CAR(pPlayer)){
|
||||
GET_CAR_CHAR_IS_USING(pPlayer, &object_veh);
|
||||
GET_CAR_SPEED(object_veh, &curSpeed);
|
||||
GET_CAR_HEADING(object_veh, &curHeading);
|
||||
GET_CAR_COORDINATES(object_veh, &curX, &curY, &curZ);
|
||||
DELETE_CAR(&object_veh);
|
||||
MARK_CAR_AS_NO_LONGER_NEEDED(&object_veh);
|
||||
}
|
||||
else{
|
||||
GET_CHAR_HEADING(pPlayer, &curHeading);
|
||||
GET_CHAR_COORDINATES(pPlayer, &curX, &curY, &curZ);
|
||||
}
|
||||
CREATE_CAR(object_vehicle, curX, curY, curZ, &object_veh, true);
|
||||
while (!DOES_VEHICLE_EXIST(object_veh))WAIT(0);
|
||||
SET_CAR_HEADING(object_veh, curHeading);
|
||||
SET_CAR_COORDINATES(object_veh, curX, curY, curZ);
|
||||
SET_CAR_VISIBLE(object_veh,visible);
|
||||
SET_HAS_BEEN_OWNED_BY_PLAYER(object_veh, true);
|
||||
SET_NEEDS_TO_BE_HOTWIRED(object_veh, false);
|
||||
SET_CAR_ENGINE_ON(object_veh, true, true);
|
||||
if(GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_INVINCIBLE)){
|
||||
SET_CAR_CAN_BE_DAMAGED(object_veh,false);
|
||||
SET_CAR_CAN_BE_VISIBLY_DAMAGED(object_veh,false);
|
||||
SET_CAN_BURST_CAR_TYRES(object_veh,false);
|
||||
}
|
||||
if(GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_ALL_UPGRADES)){
|
||||
int i;
|
||||
for(i=0;i<=9;i++){
|
||||
TURN_OFF_VEHICLE_EXTRA(object_veh, i, false);
|
||||
}
|
||||
}
|
||||
if(GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_DIRT)){
|
||||
SET_VEHICLE_DIRT_LEVEL(object_veh,15.9);
|
||||
WASH_VEHICLE_TEXTURES(object_veh,255);
|
||||
}
|
||||
else{
|
||||
SET_VEHICLE_DIRT_LEVEL(object_veh,0);
|
||||
WASH_VEHICLE_TEXTURES(object_veh,0);
|
||||
}
|
||||
WARP_CHAR_INTO_CAR(pPlayer, object_veh);
|
||||
if (IS_THIS_MODEL_A_HELI(object_vehicle))
|
||||
SET_HELI_BLADES_FULL_SPEED(object_veh);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(object_vehicle);
|
||||
LOCK_CAR_DOORS(object_veh, VEHICLE_DOOR_UNLOCKED);
|
||||
if (IS_INTERIOR_SCENE()){
|
||||
GET_GROUND_Z_FOR_3D_COORD(curX, curY, curZ, &cGroundZ);
|
||||
SET_CHAR_COORDINATES_NO_OFFSET(pPlayer, curX, curY, cGroundZ);
|
||||
LOAD_SCENE(curX, curY, curZ);
|
||||
}
|
||||
if (curSpeed != 0)
|
||||
SET_CAR_FORWARD_SPEED(object_veh, curSpeed);
|
||||
return;
|
||||
}
|
||||
|
||||
void CreateMapObj(const int model, float x, float y, float z, float h, float qx, float qy, float qz, float qw, bool dynamic, bool NO_OFFSET)
|
||||
{
|
||||
Object object;
|
||||
if(IS_MODEL_IN_CDIMAGE(model))
|
||||
{
|
||||
REQUEST_MODEL(model);
|
||||
while(!HAS_MODEL_LOADED(model)) WAIT(0);
|
||||
if(NO_OFFSET)
|
||||
{
|
||||
CREATE_OBJECT_NO_OFFSET(model, x, y, z, &object, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
CREATE_OBJECT(model, x, y, z, &object, true);
|
||||
}
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
SET_OBJECT_HEADING(object, h);
|
||||
SET_OBJECT_QUATERNION(object, qx, qy, qz, qw);
|
||||
SET_OBJECT_INVINCIBLE(object, true);
|
||||
SET_OBJECT_PROOFS(object, false, false, false, false, false);
|
||||
SET_OBJECT_VISIBLE(object, true);
|
||||
SET_OBJECT_LIGHTS(object, true);
|
||||
if (dynamic)
|
||||
{
|
||||
SET_OBJECT_DYNAMIC(object, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
FREEZE_OBJECT_POSITION(object, true);
|
||||
}
|
||||
WAIT(0);
|
||||
if(In_Network)
|
||||
{
|
||||
int nvid;
|
||||
GET_NETWORK_ID_FROM_OBJECT(object, &nvid);
|
||||
SET_NETWORK_ID_CAN_MIGRATE(nvid, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void create_map_obj(const int model, float x, float y, float z, float h, float qx, float qy, float qz, float qw, bool dynamic){ ///temporary placeholder
|
||||
|
||||
//TEMPORARY PLACEHOLDER, REPLACE create_map_obj with my new CreateMapObj instead of calling this when you get time
|
||||
CreateMapObj(model,x,y,z,h,qx,qy,qz,qw,dynamic,true);
|
||||
}
|
||||
void create_map_obj_offset(uint model, float x, float y, float z, float h, float qx, float qy, float qz, float qw, bool dynamic){ //OBJECTS ON FIXED POSITION
|
||||
//TEMPORARY PLACEHOLDER, REPLACE create_map_obj_offset with my new CreateMapObj instead of calling this when you get time
|
||||
CreateMapObj(model,x,y,z,h,qx,qy,qz,qw,dynamic,false);
|
||||
|
||||
}
|
||||
|
||||
void create_map_car(uint model,float x,float y,float z){ //CARPLACEMENTS ON FIXED POSITION
|
||||
float h;
|
||||
Vehicle actionpad_vehicle;
|
||||
if(IS_MODEL_IN_CDIMAGE(model)){
|
||||
GET_CHAR_HEADING(pPlayer,&h);
|
||||
REQUEST_MODEL(model);
|
||||
while(!HAS_MODEL_LOADED(model)) WAIT(0);
|
||||
CREATE_CAR(model,x,y+7,z+2,&actionpad_vehicle,true);
|
||||
SET_CAR_HEADING(actionpad_vehicle,h-180);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
SET_CAR_COLLISION(actionpad_vehicle, false);
|
||||
SET_CAR_CAN_BE_DAMAGED(actionpad_vehicle,false);
|
||||
SET_CAR_CAN_BE_VISIBLY_DAMAGED(actionpad_vehicle,false);
|
||||
SET_CAN_BURST_CAR_TYRES(actionpad_vehicle,false);
|
||||
FREEZE_CAR_POSITION(actionpad_vehicle, true);
|
||||
int lockZ;
|
||||
GET_CAR_DOOR_LOCK_STATUS(actionpad_vehicle,&lockZ);
|
||||
if(lockZ == VEHICLE_DOOR_UNLOCKED){
|
||||
LOCK_CAR_DOORS(actionpad_vehicle,VEHICLE_DOOR_LOCKED_BOTH_SIDES);
|
||||
}
|
||||
}
|
||||
else Alert("~BLIP_76~ ~COL_NET_4~Error! ~w~Model missing from your CD image",false);
|
||||
//PLAY_AUDIO_EVENT("FRONTEND_MENU_MP_SERVER_HIGHLIGHT");
|
||||
}
|
||||
|
||||
|
||||
void attach_admin_object_to_player(const int player, const int model,const int pedbone, float obj_x, float obj_y, float obj_z, float obj_rx, float obj_ry, float obj_rz, const int id){
|
||||
//TEMPORARY PLACEHOLDER (both of these functions are the exact same, WASTE OF SPACE!
|
||||
attach_object_to_player(player,model,pedbone,obj_x,obj_y,obj_z,obj_rx,obj_ry,obj_rz,id);
|
||||
}
|
||||
|
||||
void change_car_color (int player, ColourIndex color1, ColourIndex color2, ColourIndex color3, ColourIndex color4){
|
||||
Vehicle vehicle;
|
||||
GET_CAR_CHAR_IS_USING(player, &vehicle);
|
||||
|
||||
if(GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_UNIFIED_COLOUR)){
|
||||
CHANGE_CAR_COLOUR(vehicle, color1, color2);
|
||||
SET_EXTRA_CAR_COLOURS(vehicle, color3, color4);
|
||||
}
|
||||
else{
|
||||
int rand;
|
||||
GENERATE_RANDOM_INT_IN_RANGE(0,134,&rand);
|
||||
CHANGE_CAR_COLOUR(vehicle,color1,rand);
|
||||
SET_EXTRA_CAR_COLOURS(vehicle,rand,rand); //done <3
|
||||
}
|
||||
|
||||
WAIT(0);
|
||||
FIX_CAR(vehicle);
|
||||
SET_VEHICLE_DIRT_LEVEL(vehicle,0.0);
|
||||
}
|
||||
|
||||
void change_Netcar_color (Vehicle vehicle,int player, ColourIndex color1, ColourIndex color2, ColourIndex color3, ColourIndex color4)
|
||||
{
|
||||
//TEMPORARY PLACEHOLDER (both of these functions are the exact same, WASTE OF SPACE!
|
||||
//I believe we already have functions for this no?
|
||||
change_car_color(player, color1, color2, color3, color4);
|
||||
|
||||
}
|
||||
|
||||
void clear_rotations(void){
|
||||
register int Rotation_Subject_ID;
|
||||
int i;
|
||||
for(i = 0; i < 3; i++){
|
||||
for(Rotation_Subject_ID = 0; Rotation_Subject_ID <= MAX_ROTATION_SUBJECTS -1; Rotation_Subject_ID++){
|
||||
if(!DOES_OBJECT_EXIST(Rotation_Subject_Handle))continue;
|
||||
if (DOES_CHAR_EXIST(Rotation_Subject[Rotation_Subject_ID]) && IS_PED_ATTACHED_TO_OBJECT(Rotation_Subject[Rotation_Subject_ID], Rotation_Subject_Handle)){
|
||||
DELETE_CHAR(&Rotation_Subject[Rotation_Subject_ID]);
|
||||
}
|
||||
else if (DOES_VEHICLE_EXIST(Rotation_Subject[Rotation_Subject_ID]) && IS_CAR_ATTACHED(Rotation_Subject[Rotation_Subject_ID])){
|
||||
DELETE_CAR(&Rotation_Subject[Rotation_Subject_ID]);
|
||||
}
|
||||
else if (DOES_OBJECT_EXIST(Rotation_Subject[Rotation_Subject_ID]) && IS_OBJECT_ATTACHED(Rotation_Subject[Rotation_Subject_ID])){
|
||||
DELETE_OBJECT(&Rotation_Subject[Rotation_Subject_ID]);
|
||||
}
|
||||
}
|
||||
WAIT(70);
|
||||
}
|
||||
SetBit(MD_Misc_OptionsBitSet,MD_MISC_ROTATIONS_LOOP,false);
|
||||
//Rotationsloop = false;
|
||||
if(DOES_OBJECT_EXIST(Rotation_Subject_Handle))DELETE_OBJECT(&Rotation_Subject_Handle);
|
||||
}
|
||||
|
||||
/*
|
||||
if(object == 0xD6E93FB5)continue;//V8 Object
|
||||
if(object == 0xD1BBA26E)continue;//V81 Object
|
||||
if(object == 0x3F15FE26)continue;//V11 Object
|
||||
if(object == 0x2D295A4D)continue;//Spare Object
|
||||
if(object == 0x3F15FE26)continue;//Spare Object
|
||||
REQUEST_MODEL(0xF45AB5AE); // poolball 0xF45AB5AE
|
||||
*/
|
||||
|
||||
void Create_Rotation(uint Player_ID, int model,float Subject_h,float Subject_x,float Subject_y, float height,float Angle_x,float Angle_y,float Angle_z,int id){
|
||||
if(PLAYER_HAS_CHAR(Player_ID)){
|
||||
Ped Player_PED;
|
||||
if(!DOES_OBJECT_EXIST(Rotation_Subject_Handle)){ //Create it
|
||||
Model Handle_model = 0xF45AB5AE;
|
||||
REQUEST_MODEL(Handle_model);
|
||||
while(!HAS_MODEL_LOADED(Handle_model))WAIT(0);
|
||||
CREATE_OBJECT(Handle_model, 0.0, 0.0, 0.0, &Rotation_Subject_Handle, true);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(Handle_model);
|
||||
SET_OBJECT_VISIBLE(Rotation_Subject_Handle, true);
|
||||
GET_PLAYER_CHAR(Player_ID,&Player_PED);
|
||||
ATTACH_OBJECT_TO_PED (Rotation_Subject_Handle,Player_PED, 0.0,0.0, 0.0, -1, 0.0, 0.0, rotate_inc, 0);
|
||||
//block_net_control_of_object(Rotation_Subject_Handle);
|
||||
if(!MARK_OBJECT_FOR_NATHANS_PROTECTION(Rotation_Subject_Handle)) //net control set in my func
|
||||
{
|
||||
block_net_control_of_object(Rotation_Subject_Handle);
|
||||
}
|
||||
WAIT(50);
|
||||
SetBit(MD_Misc_OptionsBitSet,MD_MISC_ROTATIONS_LOOP,true);
|
||||
//Rotationsloop = true;
|
||||
Alert("Rotation base created",false);
|
||||
}
|
||||
if(IS_MODEL_IN_CDIMAGE(model) && DOES_OBJECT_EXIST(Rotation_Subject_Handle)){
|
||||
REQUEST_MODEL(model);
|
||||
while (!HAS_MODEL_LOADED(model))WAIT(0);
|
||||
if(IS_THIS_MODEL_A_VEHICLE(model)){
|
||||
CREATE_CAR(model,0.0,0.0,0.0,&Rotation_Subject[id],true);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
ATTACH_CAR_TO_OBJECT(Rotation_Subject[id], Rotation_Subject_Handle,1,Subject_x, Subject_y,height, Angle_x,Angle_y,Angle_z);
|
||||
SWITCH_CAR_SIREN(Rotation_Subject[id],true);
|
||||
}
|
||||
else if(IS_THIS_MODEL_A_PED(model)){
|
||||
CREATE_CHAR(26, model, 0.0,0.0,0.0, &Rotation_Subject[id], true);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
SET_CHAR_RANDOM_COMPONENT_VARIATION(Rotation_Subject[id]);
|
||||
ATTACH_PED_TO_OBJECT(Rotation_Subject[id],Rotation_Subject_Handle,1,Subject_x, Subject_y,height, Angle_x,Angle_y,1,1);
|
||||
}
|
||||
else{
|
||||
CREATE_OBJECT_NO_OFFSET(model, 0, 0, 0, &Rotation_Subject[id], true);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
FREEZE_OBJECT_POSITION(Rotation_Subject[id], true);
|
||||
SET_OBJECT_VISIBLE(Rotation_Subject[id], true);
|
||||
SET_OBJECT_LIGHTS(Rotation_Subject[id], true);
|
||||
SET_OBJECT_INVINCIBLE(Rotation_Subject[id], true);
|
||||
ATTACH_OBJECT_TO_OBJECT(Rotation_Subject[id],Rotation_Subject_Handle,1,Subject_x, Subject_y,height, Angle_x, Angle_y ,Angle_z);
|
||||
}
|
||||
//Block_Net_Control_Of_Entity(model,Rotation_Subject[id]);// --> Make this turn false when detaching the cars
|
||||
}
|
||||
else Alert("~BLIP_76~ ~COL_NET_4~Error! ~w~Model missing from your CD image",false);
|
||||
}
|
||||
else Alert(Error_Char_Missing,false);
|
||||
}
|
||||
|
||||
|
||||
void MC_Create_Player_Rotation ( uint Player_ID, int Rot_Object_Model, float heightz, float angle1, float angle2, float angle3, float angle4 ){
|
||||
float hook = 0;
|
||||
float diagonal = 0.66;
|
||||
Create_Rotation(Player_ID,Rot_Object_Model,angle4, Rotation_Distance ,hook,heightz,angle1,angle2,angletest1,0);
|
||||
Create_Rotation(Player_ID,Rot_Object_Model,angle4,-Rotation_Distance,hook,heightz,angle1 ,angle2,angletest2,1);
|
||||
Create_Rotation(Player_ID,Rot_Object_Model,angle4,hook ,Rotation_Distance,heightz,angle1 ,angle2,angletest3,2);
|
||||
Create_Rotation(Player_ID,Rot_Object_Model,angle4,hook ,-Rotation_Distance,heightz,angle1,angle2,angletest4,3);
|
||||
Create_Rotation(Player_ID,Rot_Object_Model,angle4,-Rotation_Distance*diagonal,-Rotation_Distance*diagonal,heightz,angle1 ,angle2,angletest5,4);
|
||||
Create_Rotation(Player_ID,Rot_Object_Model,angle4, Rotation_Distance*diagonal, Rotation_Distance*diagonal,heightz,angle1 ,angle2,angletest6,5);
|
||||
Create_Rotation(Player_ID,Rot_Object_Model,angle4,-Rotation_Distance*diagonal, Rotation_Distance*diagonal,heightz,angle1,angle2 ,angletest7,6);
|
||||
Create_Rotation(Player_ID,Rot_Object_Model,angle4, Rotation_Distance*diagonal,-Rotation_Distance*diagonal,heightz,angle1 ,angle2,angletest8,7);
|
||||
}
|
||||
|
||||
/**Rotation loop**/
|
||||
void MC_Creation_Loop (void){
|
||||
register int NetPlayer_ID;
|
||||
int Rotation_Subject_ID;
|
||||
Ped NetPlayer_Char;
|
||||
Vehicle Rotation_Vehicle;
|
||||
float Driving_x;
|
||||
if(GetBit(MD_Misc_OptionsBitSet,MD_MISC_ROTATIONS_LOOP) && DOES_OBJECT_EXIST(Rotation_Subject_Handle)){
|
||||
if (rotate_inc >= 6.3f)rotate_inc = 0.05f;
|
||||
else rotate_inc += Rotation_Speed;
|
||||
for(NetPlayer_ID = 0;NetPlayer_ID < MAX_PLAYERS; NetPlayer_ID++){
|
||||
if(Player_Display_Selection(NetPlayer_ID))continue;
|
||||
GET_PLAYER_CHAR(NetPlayer_ID,&NetPlayer_Char);
|
||||
if(!DOES_CHAR_EXIST(NetPlayer_Char)) continue;
|
||||
if(GET_PED_OBJECT_IS_ATTACHED_TO(Rotation_Subject_Handle) == NetPlayer_Char && IS_OBJECT_ATTACHED(Rotation_Subject_Handle)){
|
||||
if(IS_CHAR_IN_ANY_CAR(NetPlayer_Char)){
|
||||
if(is_driving(NetPlayer_Char))Driving_x = 0.5f;
|
||||
else Driving_x = -0.5f;
|
||||
if(!DOES_CHAR_EXIST(NetPlayer_Char))continue;
|
||||
ATTACH_OBJECT_TO_PED (Rotation_Subject_Handle,NetPlayer_Char, 0, Driving_x, 0.0,Set_Rotation_Height -0.90f, 0.0, 0.0, rotate_inc, 0);
|
||||
}
|
||||
else {
|
||||
if(!DOES_CHAR_EXIST(NetPlayer_Char)) continue;
|
||||
ATTACH_OBJECT_TO_PED (Rotation_Subject_Handle,NetPlayer_Char, 0, 0.0, 0.0,Set_Rotation_Height - 1.50f, 0.0, 0.0, rotate_inc, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(Rot_Solidify){//Premium Only!!!
|
||||
for(Rotation_Subject_ID = 0; Rotation_Subject_ID <= MAX_ROTATION_SUBJECTS -1; Rotation_Subject_ID++){
|
||||
if (DOES_VEHICLE_EXIST(Rotation_Subject[Rotation_Subject_ID]) && IS_CAR_ATTACHED(Rotation_Subject[Rotation_Subject_ID])){
|
||||
if (IS_THIS_MODEL_A_HELI(GET_VEHICLE_MODEL_FROM_INDEX(Rotation_Subject_ID))){
|
||||
SET_HELI_BLADES_FULL_SPEED(Rotation_Subject[Rotation_Subject_ID]); //This doesnt work!!
|
||||
}
|
||||
SET_CAR_COLLISION(Rotation_Subject[Rotation_Subject_ID], Rot_Solidify);
|
||||
}
|
||||
else if (DOES_OBJECT_EXIST(Rotation_Subject[Rotation_Subject_ID]) && IS_OBJECT_ATTACHED(Rotation_Subject[Rotation_Subject_ID])){
|
||||
SET_OBJECT_COLLISION(Rotation_Subject[Rotation_Subject_ID], Rot_Solidify);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2273
Trident/MD_Functions/MDF_Shared_Functions.c
Normal file
2273
Trident/MD_Functions/MDF_Shared_Functions.c
Normal file
File diff suppressed because it is too large
Load Diff
559
Trident/MD_Functions/MDF_Shared_Functions_Required_By_Admin.c
Normal file
559
Trident/MD_Functions/MDF_Shared_Functions_Required_By_Admin.c
Normal file
@@ -0,0 +1,559 @@
|
||||
/**
|
||||
* @ MAJOR DISTRIBUTION EXTEND
|
||||
* @ Version MDv13 TRIDENT Based on ESSENTIALS
|
||||
* @ MADE BY - DEVILSDESIGN && IIV NATHAN VII
|
||||
* @ Updated : 20-03-2017
|
||||
*/
|
||||
|
||||
//CreateByteSet(hour, minute, 1, 1, &freezeTime);
|
||||
// if(freezeTime) SET_TIME_OF_DAY(GetByteInSet(freezeTime, 0), GetByteInSet(freezeTime, 1));
|
||||
//SpectateByteSet
|
||||
void CreateByteSet(uint b0, uint b1, uint b2, uint b3, uint *ByteSet)
|
||||
{
|
||||
*ByteSet = ((b3 % 256) * 16777216) + ((b2 % 256) * 65536) + ((b1 % 256) * 256) + (b0 % 256);
|
||||
}
|
||||
|
||||
uint GetByteInSet(uint ByteSet, uint byteIndex)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < (byteIndex * 2); i++)
|
||||
{
|
||||
ByteSet = SHIFT_RIGHT(ByteSet, 4); //SHIFT_RIGHT, shifts by 4 bits
|
||||
}
|
||||
ByteSet = ByteSet % 256;
|
||||
return ByteSet;
|
||||
}
|
||||
|
||||
void GetByteSet(uint ByteSet, uint *b0, uint *b1, uint *b2, uint *b3)
|
||||
{
|
||||
*b0 = GetByteInSet(ByteSet, 0);
|
||||
*b1 = GetByteInSet(ByteSet, 1);
|
||||
*b2 = GetByteInSet(ByteSet, 2);
|
||||
*b3 = GetByteInSet(ByteSet, 3);
|
||||
}
|
||||
|
||||
|
||||
void SetByteSet(uint *ByteSet, uint byteIndex, uint byteValue)
|
||||
{
|
||||
uint b[4];
|
||||
GetByteSet(*ByteSet, &b[0], &b[1], &b[2], &b[3]);
|
||||
b[byteIndex] = byteValue;
|
||||
CreateByteSet(b[0], b[1], b[2], b[3], &*ByteSet);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//use -1 for respawn mode, and hmm, -2 for clone maybe? I'll get to it!
|
||||
void nathan_spawn_vehicle(const int model, float x, float y, float z, float h){
|
||||
|
||||
int col5, col6, col7, col8,lock,car;
|
||||
float speed;
|
||||
Ped driver;
|
||||
bool respawning = (model == -1);
|
||||
bool upgrade[10];
|
||||
bool siren;
|
||||
int i;
|
||||
if(respawning)
|
||||
{
|
||||
//respawn
|
||||
GET_CAR_CHAR_IS_USING(pPlayer,&car);
|
||||
GET_CAR_MODEL(car, &model);
|
||||
GET_DRIVER_OF_CAR(car,&driver);
|
||||
siren = IS_CAR_SIREN_ON(car);
|
||||
GET_CAR_COLOURS(car, &col5, &col6);
|
||||
GET_EXTRA_CAR_COLOURS(car, &col7, &col8);
|
||||
GET_CAR_DOOR_LOCK_STATUS(car,&lock);
|
||||
GET_CAR_SPEED(car,&speed);
|
||||
GET_CAR_HEADING(car, &h);
|
||||
for(i = 0;i<10;i++)
|
||||
{
|
||||
upgrade[i] = IS_VEHICLE_EXTRA_TURNED_ON(car,i);
|
||||
}
|
||||
}
|
||||
if(!IS_MODEL_IN_CDIMAGE(model)) return;
|
||||
//GET_CAR_MODEL(car, &model);
|
||||
REQUEST_MODEL(model); ////Yes this SHOULD be here! In order to stop/reduce the script wasting time!
|
||||
while(!HAS_MODEL_LOADED(model)) WAIT(0);
|
||||
CREATE_CAR(model, x, y, z, &car, true);
|
||||
if(model == MODEL_ANNIHILATOR)
|
||||
{
|
||||
SET_CAR_CAN_BE_DAMAGED(car,false);
|
||||
SET_CAR_CAN_BE_VISIBLY_DAMAGED(car, false);
|
||||
FIX_CAR(car);
|
||||
}
|
||||
WARP_CHAR_INTO_CAR(pPlayer,car);
|
||||
|
||||
if(IS_THIS_MODEL_A_HELI(model))
|
||||
SET_HELI_BLADES_FULL_SPEED(car);
|
||||
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
SET_CAR_HEADING(car,h);
|
||||
SET_CAR_ENGINE_ON(car,true,true);
|
||||
if(respawning)
|
||||
{
|
||||
for(i = 0; i < 10; i++)
|
||||
{
|
||||
TURN_OFF_VEHICLE_EXTRA(car,i,!upgrade[i]);
|
||||
}
|
||||
SET_CAR_FORWARD_SPEED(car, speed);
|
||||
CHANGE_CAR_COLOUR(car, col5, col6);
|
||||
SET_EXTRA_CAR_COLOURS(car, col7, col8);
|
||||
SWITCH_CAR_SIREN(car,siren);
|
||||
LOCK_CAR_DOORS(car,lock);
|
||||
}
|
||||
}
|
||||
|
||||
bool IS_DRIVE_WALK_WATER_ENABLED_FOR_PLAYER(const int playerindex)
|
||||
{
|
||||
return DOES_OBJECT_EXIST(drive_water[playerindex]);
|
||||
}
|
||||
|
||||
void TOGGLE_DRIVE_WALK_WATER_FOR_PLAYER(const int playerindex)
|
||||
{
|
||||
char * buffer[32];
|
||||
Strcpy(buffer, "~b~MD: "); //7 chars
|
||||
PLAYER_NAME_WITH_COLOUR(playerindex, &buffer); //33
|
||||
Strcat(buffer, " ~s~"); //37
|
||||
if(PLAYER_HAS_CHAR(playerindex))
|
||||
{
|
||||
//GET_PLAYER_CHAR(playerindex,&players[playerindex].ped);
|
||||
if(DOES_OBJECT_EXIST(drive_water[playerindex]))
|
||||
{
|
||||
Strcat(buffer, "can no longer drive or walk on water."); //72 chars
|
||||
DELETE_OBJECT(&drive_water[playerindex]);
|
||||
}
|
||||
else
|
||||
{
|
||||
REQUEST_MODEL(0x4F9981BE);
|
||||
Strcat(buffer, "can now drive and walk on water."); //32 + 33 = 55
|
||||
float x,y,z;
|
||||
int NetID;
|
||||
GET_CHAR_COORDINATES(PLAYER_CHAR(playerindex),&x,&y,&z); //loop will "catch" the object, make less waiting happen :P
|
||||
while(!HAS_MODEL_LOADED(0x4F9981BE)) WAIT(0);
|
||||
CREATE_OBJECT(0x4F9981BE, x, y, z, &drive_water[playerindex], true);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(0x4F9981BE);
|
||||
SET_OBJECT_VISIBLE(drive_water[playerindex],false);
|
||||
SET_OBJECT_INVINCIBLE(drive_water[playerindex],true);
|
||||
GET_NETWORK_ID_FROM_OBJECT(drive_water[playerindex], &NetID);
|
||||
SET_NETWORK_ID_CAN_MIGRATE(NetID, false);
|
||||
SET_OBJECT_COORDINATES(drive_water[playerindex],x,y,-9.2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Strcat(buffer, "does not have a character.");;
|
||||
}
|
||||
Alert(buffer,false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool IS_CHARS_VEHICLE_LOCKED(const int ped) //Nathan new func
|
||||
{
|
||||
if(!DOES_CHAR_EXIST(ped) || !IS_CHAR_IN_ANY_CAR(ped)) return false;
|
||||
int lock,veh;
|
||||
GET_CAR_CHAR_IS_USING(ped,&veh);
|
||||
GET_CAR_DOOR_LOCK_STATUS(veh,&lock);
|
||||
return (lock == VEHICLE_DOOR_LOCKED_BOTH_SIDES || lock == VEHICLE_DOOR_LOCKED_FROM_OUTSIDE);
|
||||
}
|
||||
|
||||
void SET_VEHICLE_LOCKED_WITHOUT_NET_CONTROL_REQUEST(const int veh, const int lock)
|
||||
{
|
||||
if(!DOES_VEHICLE_EXIST(veh)) return;
|
||||
if(lock == 0 || lock == 1)
|
||||
{
|
||||
LOCK_CAR_DOORS(veh, (lock ? VEHICLE_DOOR_LOCKED_BOTH_SIDES : VEHICLE_DOOR_UNLOCKED));
|
||||
}
|
||||
else if(lock == VEHICLE_DOOR_LOCKED_FROM_OUTSIDE)
|
||||
{
|
||||
LOCK_CAR_DOORS(veh,VEHICLE_DOOR_LOCKED_FROM_OUTSIDE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void change_player(const int playerModel)
|
||||
{
|
||||
if(!IS_MODEL_IN_CDIMAGE(playerModel))
|
||||
{
|
||||
Alert("~b~MD: ~s~Model missing, unable to change.",false);
|
||||
return;
|
||||
}
|
||||
REQUEST_MODEL(playerModel);
|
||||
float heading;
|
||||
Weapon savedWeapons[WEAPON_SLOT_THROWN+1];
|
||||
uint savedAmmo[WEAPON_SLOT_THROWN+1];
|
||||
uint key, health, armor, currentWeaponAmmo, seatIndex = 0;
|
||||
Weapon currentWeapon;
|
||||
Vehicle playerVehicle = 0;
|
||||
int i;
|
||||
|
||||
GET_CHAR_ARMOUR(pPlayer, &armor);
|
||||
GET_CHAR_HEALTH(pPlayer, &health);
|
||||
//health -= armor;
|
||||
//Weapons
|
||||
uint ammo1;
|
||||
//NEW v
|
||||
for(i = WEAPON_SLOT_UNARMED; i <= WEAPON_SLOT_THROWN; i++)
|
||||
{
|
||||
GET_CHAR_WEAPON_IN_SLOT(pPlayer, i, &savedWeapons[i], &savedAmmo[i], &ammo1);
|
||||
}
|
||||
GET_CURRENT_CHAR_WEAPON(pPlayer, ¤tWeapon);
|
||||
GET_AMMO_IN_CLIP(pPlayer, currentWeapon, ¤tWeaponAmmo);
|
||||
//Vehicle
|
||||
if(IS_CHAR_IN_ANY_CAR(pPlayer))
|
||||
{
|
||||
Ped pedInSeat = 0;
|
||||
int i;
|
||||
GET_CAR_CHAR_IS_USING(pPlayer, &playerVehicle);
|
||||
GET_DRIVER_OF_CAR(playerVehicle, &pedInSeat);
|
||||
if(pedInSeat == pPlayer)
|
||||
{
|
||||
seatIndex = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i = 0; i < 3; i++)
|
||||
{
|
||||
GET_CHAR_IN_CAR_PASSENGER_SEAT(playerVehicle, i, &pedInSeat);
|
||||
if(pPlayer == pedInSeat)
|
||||
{
|
||||
seatIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GET_CHAR_HEADING(pPlayer, &heading);
|
||||
GET_KEY_FOR_CHAR_IN_ROOM(pPlayer, &key);
|
||||
while(!HAS_MODEL_LOADED(playerModel)) WAIT(0);
|
||||
CHANGE_PLAYER_MODEL(iPlayer, playerModel);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(playerModel);
|
||||
pPlayer = GetPlayerPed(); //Get/set the new player ped ID
|
||||
ADD_ARMOUR_TO_CHAR(pPlayer, armor);
|
||||
SET_CHAR_HEALTH(pPlayer, health);
|
||||
//Weapons
|
||||
for(i = WEAPON_SLOT_UNARMED; i <= WEAPON_SLOT_THROWN; i++)
|
||||
{
|
||||
if(savedWeapons[i] != currentWeapon)
|
||||
{
|
||||
GIVE_WEAPON_TO_CHAR(pPlayer, savedWeapons[i], savedAmmo[i], false);
|
||||
}
|
||||
}
|
||||
if(currentWeapon)
|
||||
{
|
||||
uint ammo;
|
||||
GET_AMMO_IN_CHAR_WEAPON(pPlayer, currentWeapon, &ammo);
|
||||
REMOVE_WEAPON_FROM_CHAR(pPlayer, currentWeapon);
|
||||
GIVE_WEAPON_TO_CHAR(pPlayer, currentWeapon, ammo, false);
|
||||
SET_CURRENT_CHAR_WEAPON(pPlayer, currentWeapon, true);
|
||||
SET_AMMO_IN_CLIP(pPlayer, currentWeapon, currentWeaponAmmo);
|
||||
SET_CHAR_AMMO(pPlayer, currentWeapon, ammo);
|
||||
}
|
||||
|
||||
//Vehicle
|
||||
if(DOES_VEHICLE_EXIST(playerVehicle))
|
||||
{
|
||||
if(seatIndex == -1)
|
||||
WARP_CHAR_INTO_CAR(pPlayer, playerVehicle);
|
||||
else
|
||||
WARP_CHAR_INTO_CAR_AS_PASSENGER(pPlayer, playerVehicle, seatIndex);
|
||||
}
|
||||
SET_CHAR_HEADING(pPlayer, heading);
|
||||
if(IS_INTERIOR_SCENE()) SET_ROOM_FOR_CHAR_BY_KEY(pPlayer, key);
|
||||
SET_CHAR_RANDOM_COMPONENT_VARIATION(pPlayer);
|
||||
FORCE_FULL_VOICE(pPlayer);
|
||||
if(GetBit(pPlayerOptionsBitSet, PLAYER_OPTION_HELMET)) GIVE_PED_HELMET(pPlayer);
|
||||
BLOCK_PED_WEAPON_SWITCHING(pPlayer, true);
|
||||
if(playerModel == GET_PLAYERSETTINGS_MODEL_CHOICE())
|
||||
{
|
||||
SET_PLAYERSETTINGS_MODEL_VARIATIONS_CHOICE(iPlayer);
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_CHAR_RANDOM_COMPONENT_VARIATION(pPlayer);
|
||||
}
|
||||
}
|
||||
/*
|
||||
void LOAD_ANIMS(const char* set)
|
||||
{
|
||||
REQUEST_ANIMS(set);
|
||||
while(!HAVE_ANIMS_LOADED(set)) WAIT(0);
|
||||
}
|
||||
|
||||
void UNLOAD_ANIMS(const char* set)
|
||||
{
|
||||
REMOVE_ANIMS(set);
|
||||
}
|
||||
*/
|
||||
void pPlayer_strides(const char* set){
|
||||
REQUEST_ANIMS(set);
|
||||
while(!HAVE_ANIMS_LOADED(set)) WAIT(0);
|
||||
SET_ANIM_GROUP_FOR_CHAR(pPlayer,set);
|
||||
REMOVE_ANIMS(set);
|
||||
}
|
||||
|
||||
|
||||
void play_anims(const char* set, const char* anim, const int time1,const int time2){
|
||||
REQUEST_ANIMS(set);
|
||||
while(!HAVE_ANIMS_LOADED(set)) WAIT(0);
|
||||
TASK_PLAY_ANIM_WITH_FLAGS(pPlayer,anim,set,8.0,time1,time2); //yes anim then set.
|
||||
REMOVE_ANIMS(set); //unload
|
||||
}
|
||||
|
||||
int Number_of_BGuards(void){
|
||||
int i;
|
||||
int number_of_guards = 0;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
number_of_guards++;
|
||||
}
|
||||
return number_of_guards;
|
||||
}
|
||||
|
||||
void fix_group_for_guards(void){
|
||||
GET_PLAYER_GROUP(iPlayer,&BG_Group);
|
||||
if(!DOES_GROUP_EXIST(BG_Group)){
|
||||
CREATE_GROUP(0, &BG_Group, true);
|
||||
SET_GROUP_LEADER(BG_Group, pPlayer);
|
||||
SET_GROUP_FORMATION(BG_Group, group_formation);
|
||||
SET_GROUP_FORMATION_SPACING(BG_Group, group_spacing);
|
||||
int i;
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
SET_GROUP_MEMBER(BG_Group, BG_ped[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Guard_Check(void){
|
||||
fix_group_for_guards();
|
||||
bool guards_exist = (Number_of_BGuards() > 0);
|
||||
if(!guards_exist){
|
||||
Alert("~b~MD: ~s~No bodyguards exist!",false);
|
||||
}
|
||||
return guards_exist;
|
||||
}
|
||||
|
||||
void AnimationPlayer(bool pPlayer_Animation,const char* set, const char* anim, const int time1,const int time2){
|
||||
float animspeed;
|
||||
if(pPlayer_Animation){
|
||||
REQUEST_ANIMS(set);
|
||||
while(!HAVE_ANIMS_LOADED(set)) WAIT(0);
|
||||
GET_CHAR_MOVE_ANIM_SPEED_MULTIPLIER(pPlayer, &animspeed);
|
||||
SET_CHAR_ANIM_SPEED(pPlayer, set,anim, animspeed*animationspeed);
|
||||
TASK_PLAY_ANIM_WITH_FLAGS(pPlayer,anim,set,8.0,time1,time2); //yes anim then set.
|
||||
}
|
||||
else{
|
||||
if(!Guard_Check()) return;
|
||||
REQUEST_ANIMS(set);
|
||||
int i;
|
||||
while(!HAVE_ANIMS_LOADED(set)) WAIT(0);
|
||||
for(i = 0; i < MAX_SPAWNGUARDS; i++){
|
||||
if(!DOES_CHAR_EXIST(BG_ped[i])) continue;
|
||||
GET_CHAR_MOVE_ANIM_SPEED_MULTIPLIER(BG_ped[i], &animspeed);
|
||||
SET_CHAR_ANIM_SPEED(BG_ped[i], set,anim, animspeed*animationspeed);
|
||||
TASK_PLAY_ANIM_WITH_FLAGS(BG_ped[i],anim,set,8.0,time1,time2);
|
||||
}
|
||||
Alert("~b~MD: ~s~Bodyguards are now playing an animation.",false);
|
||||
}
|
||||
REMOVE_ANIMS(set);
|
||||
}
|
||||
|
||||
void delete_objects_on_ped(const int nigger) //Vehicle = int
|
||||
{ //Do not include this in universal delete as this will be handy usable seperately
|
||||
if(!DOES_CHAR_EXIST(nigger)) return;
|
||||
register int i;
|
||||
int z,object;
|
||||
for(z = 0; z < 2; z++)
|
||||
{ //i guess if we can grab control we'll get it almost immediately soo..
|
||||
for(i = 0; i < 6900; i++)
|
||||
{
|
||||
if(!DOES_OBJECT_EXIST_WITH_NETWORK_ID(i)) continue;
|
||||
GET_OBJECT_FROM_NETWORK_ID(i,&object);
|
||||
if(!IS_OBJECT_ATTACHED(object) || GET_PED_OBJECT_IS_ATTACHED_TO(object) != nigger) continue;
|
||||
REQUEST_CONTROL_OF_NETWORK_ID(i);
|
||||
if(!HAS_CONTROL_OF_NETWORK_ID(i)) continue;
|
||||
DELETE_OBJECT(&object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool MARK_OBJECT_FOR_NATHANS_PROTECTION(const int object)
|
||||
{
|
||||
if(!DOES_SCRIPT_EXIST("network_protection") || GET_NUMBER_OF_INSTANCES_OF_STREAMED_SCRIPT("network_protection") < 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int NetID;
|
||||
GET_NETWORK_ID_FROM_OBJECT(object,&NetID);
|
||||
if(HAS_CONTROL_OF_NETWORK_ID(NetID))
|
||||
{
|
||||
SET_NETWORK_ID_CAN_MIGRATE(NetID, false);
|
||||
SET_OBJECT_HEALTH(object, 165.0f);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void attach_object_to_player(const int player, const int model,int pedbone, float obj_x, float obj_y, float obj_z, float obj_rx, float obj_ry, float obj_rz, const int id){
|
||||
if (IS_MODEL_IN_CDIMAGE(model))
|
||||
{
|
||||
REQUEST_MODEL(model);
|
||||
while(!HAS_MODEL_LOADED(model)) WAIT(0);
|
||||
CREATE_OBJECT(model,0.0,0.0,0.0,&Attach_object[id],true);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
FREEZE_OBJECT_POSITION(Attach_object[id], false);
|
||||
SET_OBJECT_VISIBLE(Attach_object[id], true);
|
||||
SET_OBJECT_LIGHTS(Attach_object[id], true);
|
||||
SET_OBJECT_INVINCIBLE(Attach_object[id], true);
|
||||
SET_OBJECT_COLLISION(Attach_object[id], false);
|
||||
SET_OBJECT_DYNAMIC(Attach_object[id],true);
|
||||
while (!DOES_OBJECT_EXIST(Attach_object[id]))WAIT(0);
|
||||
int NetID;
|
||||
GET_NETWORK_ID_FROM_OBJECT(Attach_object[id],&NetID);
|
||||
if(HAS_CONTROL_OF_NETWORK_ID(NetID))
|
||||
{
|
||||
SET_NETWORK_ID_CAN_MIGRATE(NetID, false);
|
||||
SET_OBJECT_HEALTH(Attach_object[id], 165.0f);
|
||||
WAIT(100);
|
||||
ATTACH_OBJECT_TO_PED(Attach_object[id],player,pedbone, obj_x, obj_y, obj_z, obj_rx, obj_ry, obj_rz,false);
|
||||
}
|
||||
}
|
||||
else Alert("~BLIP_76~ ~COL_NET_4~Error! ~w~Model missing from your CD image",false);
|
||||
}
|
||||
|
||||
void GET_CHAR_COORDINATES_HEADING(const int ped, float *X, float *Y, float *Z, float *H)
|
||||
{
|
||||
GET_CHAR_COORDINATES(ped, &*X, &*Y, &*Z);
|
||||
GET_CHAR_HEADING(ped,&*H);
|
||||
}
|
||||
|
||||
void delete_transformers_on_vehicle(const int veh) //doesn't request control, our spawns (only if control = non migrate/locked to us) :D
|
||||
{
|
||||
if(!DOES_VEHICLE_EXIST(veh)) return;
|
||||
float vx,vy,vz;
|
||||
GET_CAR_COORDINATES(veh,&vx,&vy,&vz);
|
||||
int i, tmp_veh;
|
||||
for(i = 0; i < 8000; i++)
|
||||
{
|
||||
if(!DOES_VEHICLE_EXIST_WITH_NETWORK_ID(i)) continue;
|
||||
GET_VEHICLE_FROM_NETWORK_ID(i,&tmp_veh);
|
||||
if(!IS_CAR_ATTACHED(tmp_veh) || (tmp_veh == veh)) continue;
|
||||
float tx,ty,tz,distance;
|
||||
GET_CAR_COORDINATES(tmp_veh,&tx,&ty,&tz);
|
||||
GET_DISTANCE_BETWEEN_COORDS_3D(vx,vy,vz,tx,ty,tz,&distance);
|
||||
if( (distance > 2.0f) || !HAS_CONTROL_OF_NETWORK_ID(i) ) continue;
|
||||
DELETE_CAR(&tmp_veh);
|
||||
}
|
||||
SET_CAR_VISIBLE(veh,true);
|
||||
}
|
||||
|
||||
void delete_own_objects_on_vehicle(const int veh)
|
||||
{
|
||||
if(!DOES_VEHICLE_EXIST(veh)) return;
|
||||
int i,object;
|
||||
for(i = 0; i < 8000; i++)
|
||||
{
|
||||
if(!DOES_OBJECT_EXIST_WITH_NETWORK_ID(i)) continue;
|
||||
GET_OBJECT_FROM_NETWORK_ID(i,&object);
|
||||
if(!IS_OBJECT_ATTACHED(object) || GET_CAR_OBJECT_IS_ATTACHED_TO(object) != veh) continue;
|
||||
if(HAS_CONTROL_OF_NETWORK_ID(i))
|
||||
{
|
||||
//Run_Ptfx(object);
|
||||
DELETE_OBJECT(&object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MD_VEHICLE_SPAWNER_ON_ID(const int Player_ID ,const int model){
|
||||
Ped Player_Char;
|
||||
Vehicle Spawnvihicle;
|
||||
float Spawn_x, Spawn_y, Spawn_z, Spawn_h, Spawn_s;
|
||||
|
||||
if(PLAYER_HAS_CHAR(Player_ID))GET_PLAYER_CHAR(Player_ID, &Player_Char);
|
||||
else return Alert(Error_Char_Missing,false);
|
||||
|
||||
if(IS_MODEL_IN_CDIMAGE(model))REQUEST_MODEL(model);
|
||||
else return Alert(Error_Model_Missing,false);
|
||||
|
||||
/**Clean up peds in the weaponvehicle if a new vehicle is spawned**/
|
||||
int Pednr;
|
||||
for(Pednr = 0; Pednr < 4; Pednr++){
|
||||
if(DOES_CHAR_EXIST(WeaponVeh_ped[Pednr]))DELETE_CHAR(&WeaponVeh_ped[Pednr]);
|
||||
}
|
||||
|
||||
/**Get the data*/
|
||||
if(Player_ID == iPlayer){
|
||||
GET_CHAR_COORDINATES_HEADING(pPlayer,&Spawn_x,&Spawn_y,&Spawn_z,&Spawn_h);
|
||||
if(IS_CHAR_IN_ANY_CAR(pPlayer)){
|
||||
GET_CAR_CHAR_IS_USING(pPlayer,&Spawnvihicle);
|
||||
GET_CAR_SPEED(Spawnvihicle,&Spawn_s);
|
||||
delete_own_objects_on_vehicle(Spawnvihicle);
|
||||
delete_transformers_on_vehicle(Spawnvihicle);
|
||||
DELETE_CAR(&Spawnvihicle);
|
||||
}
|
||||
}
|
||||
else{
|
||||
GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS(Player_Char, 0, 6, 0, &Spawn_x, &Spawn_y, &Spawn_z);
|
||||
GET_CHAR_HEADING(Player_Char,&Spawn_h);
|
||||
}
|
||||
while(!HAS_MODEL_LOADED(model)) WAIT(0);
|
||||
/**Create that shit*/
|
||||
CREATE_CAR(model,Spawn_x,Spawn_y,Spawn_z,&Spawnvihicle,true);
|
||||
MARK_MODEL_AS_NO_LONGER_NEEDED(model);
|
||||
if(Player_ID == iPlayer){
|
||||
WARP_CHAR_INTO_CAR(pPlayer,Spawnvihicle);
|
||||
/**Settings*/
|
||||
SET_CAR_HEADING(Spawnvihicle,Spawn_h);
|
||||
}
|
||||
if(!IS_THIS_MODEL_A_HELI(model)){
|
||||
int rand_colours[4];
|
||||
int rand_i;
|
||||
for(rand_i = 0; rand_i < 4; rand_i++)
|
||||
{
|
||||
GENERATE_RANDOM_INT_IN_RANGE(0,134,&rand_colours[rand_i]);
|
||||
}
|
||||
CHANGE_CAR_COLOUR(Spawnvihicle,rand_colours[0],rand_colours[1]);
|
||||
SET_EXTRA_CAR_COLOURS(Spawnvihicle,rand_colours[2],rand_colours[3]);
|
||||
}
|
||||
else{
|
||||
SET_HELI_BLADES_FULL_SPEED(Spawnvihicle);
|
||||
}
|
||||
if(Coloursetting_Personal && Player_ID == iPlayer){
|
||||
CHANGE_CAR_COLOUR(Spawnvihicle,SavedColors1,SavedColors2);
|
||||
SET_EXTRA_CAR_COLOURS(Spawnvihicle,SavedColors3,SavedColors4);
|
||||
}
|
||||
if(Coloursetting_Net && Player_ID != iPlayer){
|
||||
CHANGE_CAR_COLOUR(Spawnvihicle,SavedColors5,SavedColors6);
|
||||
SET_EXTRA_CAR_COLOURS(Spawnvihicle,SavedColors7,SavedColors8);
|
||||
}
|
||||
if(Coloursetting_Personal && SavedColors1 == 134 && SavedColors2 == 134 && SavedColors3 == 134 && SavedColors4 == 134)Alert("~b~MD: ~s~You might want to save a personal vehicle colour in spawnsettings.",false);
|
||||
if(Coloursetting_Net && SavedColors5 == 134&& SavedColors6 == 134 && SavedColors7 == 134 && SavedColors8 == 134)Alert("~b~MD: ~s~You might want to save a vehicle colour for netplayers in spawnsettings.",false);
|
||||
SET_CAR_ENGINE_ON(Spawnvihicle,GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_ENGINE),GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_ENGINE));
|
||||
if(GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_ALL_UPGRADES))
|
||||
{
|
||||
int Extra;
|
||||
for(Extra=0;Extra<10;Extra++)TURN_OFF_VEHICLE_EXTRA(Spawnvihicle,Extra, false);
|
||||
}
|
||||
Run_Ptfx(Spawnvihicle);
|
||||
SET_CAR_FORWARD_SPEED(Spawnvihicle,Spawn_s);
|
||||
LOCK_CAR_DOORS(Spawnvihicle,VEHICLE_DOOR_UNLOCKED);
|
||||
SET_VEHICLE_DIRT_LEVEL(Spawnvihicle,0);
|
||||
WASH_VEHICLE_TEXTURES(Spawnvihicle,0);
|
||||
SET_CAR_CAN_BE_DAMAGED(Spawnvihicle,!GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_INVINCIBLE));
|
||||
SET_CAR_CAN_BE_VISIBLY_DAMAGED(Spawnvihicle,!GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_INVINCIBLE));
|
||||
SET_CAN_BURST_CAR_TYRES(Spawnvihicle,!GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_INVINCIBLE));
|
||||
SWITCH_CAR_SIREN(Spawnvihicle,GetBit(VehicleOptionsBitSet, VEHICLE_OPTION_SIREN));
|
||||
MARK_CAR_AS_NO_LONGER_NEEDED(&Spawnvihicle); //make the game able to delete it if it's not used..
|
||||
if(Player_ID != iPlayer) //--> No need to print this for urself! //true buddy!
|
||||
{
|
||||
/**Now lets print this shit**/
|
||||
char * buffer[32];
|
||||
Strcpy(buffer, "~b~MD: ~s~A "); //12 characters
|
||||
Strcat(buffer, GET_STRING_FROM_TEXT_FILE(GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(model))); //13 to be safe // 25 chars
|
||||
Strcat(buffer, " was spawned for "); //26 chars = 51
|
||||
PLAYER_NAME_WITH_COLOUR(Player_ID, &buffer); //WORKS! //69
|
||||
Strcat(buffer, "~s~."); //73 chars
|
||||
Alert(buffer, false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user