Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Main.c
- #include <natives.h>
- #include <common.h>
- #include <strings.h>
- #include <types.h>
- #include <consts.h>
- #include "settings.c"
- #include "functions.c"
- float line1=0.76000000;
- float line2=0.79000000;
- float line3=0.82000000;
- float line4=0.85000000;
- float x1, y1, z1;
- Ped carped, footped, delped;
- Vehicle pedcar, mycar;
- Object lights;
- int carmake, myspeed, pednet, object1, menuon = 0;
- bool Exist=0, weapswap=0 , curweap=0;
- Group mygroup;
- void Display(float LinePosition, char *Title) // For Displaying
- {
- set_up_draw(6, 0.40000000, 0.30000000, 242, 30, 242, 255 ); //Pink
- draw_text("STRING", 0.50, LinePosition, Title);
- }
- void neons(void)
- {
- REQUEST_MODEL(0xD20167BE);
- while (!HAS_MODEL_LOADED(0xD20167BE)) WAIT(0);
- CREATE_OBJECT(0xD20167BE, 0.0f, 0.0f, 0.0f, &lights, 1);
- WAIT(1);
- ATTACH_OBJECT_TO_CAR(lights,carmake,0.0f,0.0,0,0,-80,0,0.0);
- SET_OBJECT_LIGHTS(lights, true);
- SET_OBJECT_VISIBLE(lights, true);
- SET_OBJECT_INVINCIBLE(lights, 1);
- CREATE_OBJECT(0xD20167BE, 0.0f, 0.0f, 0.0f, &lights, 1);
- WAIT(1);
- ATTACH_OBJECT_TO_CAR(lights,carmake,0.0f,0.0,0,0,-80,0,0.0);
- SET_OBJECT_LIGHTS(lights, true);
- SET_OBJECT_VISIBLE(lights, true);
- SET_OBJECT_INVINCIBLE(lights, 1);
- CREATE_OBJECT(0xD20167BE, 0.0f, 0.0f, 0.0f, &lights, 1);
- WAIT(1);
- ATTACH_OBJECT_TO_CAR(lights,carmake,0.0f,0.0,0,0,-80,0,0.0);
- SET_OBJECT_LIGHTS(lights, true);
- SET_OBJECT_VISIBLE(lights, true);
- SET_OBJECT_INVINCIBLE(lights, 1);
- CREATE_OBJECT(0xD20167BE, 0.0f, 0.0f, 0.0f, &lights, 1);
- WAIT(1);
- ATTACH_OBJECT_TO_CAR(lights,carmake,0.0f,0.0,0,0,-80,0,0.0);
- SET_OBJECT_VISIBLE(lights, true);
- SET_OBJECT_INVINCIBLE(lights, 1);
- SET_OBJECT_VISIBLE(lights, true);
- CREATE_OBJECT(0xD20167BE, 0.0f, 0.0f, 0.0f, &lights, 1);
- WAIT(1);
- ATTACH_OBJECT_TO_CAR(lights,carmake,0.0f,0.0,0,0,-80,0,0.0);
- SET_OBJECT_VISIBLE(lights, true);
- SET_OBJECT_INVINCIBLE(lights, 1);
- SET_OBJECT_VISIBLE(lights, true);
- }
- void findme(void)
- {
- GET_CHAR_COORDINATES(GetPlayerPed(), &x1, &y1, &z1);
- GET_CAR_CHAR_IS_USING(GetPlayerPed(), &mycar);
- GET_CAR_MODEL(mycar, &carmake);
- }
- void CreateGroup(void)
- {
- if(Exist==0)
- {
- GET_PLAYER_GROUP(GetPlayerIndex(), &mygroup);
- if(!DOES_GROUP_EXIST(mygroup))
- {
- CREATE_GROUP(0, mygroup, true);
- SET_GROUP_LEADER(mygroup, GetPlayerPed());
- SET_GROUP_SEPARATION_RANGE(mygroup, 9999.9);
- SET_PLAYER_GROUP_TO_FOLLOW_ALWAYS(GetPlayerPed(),1);
- SET_GROUP_FOLLOW_STATUS(mygroup,1);
- SET_GROUP_FORMATION(mygroup,3);
- SET_GROUP_FORMATION_SPACING(mygroup, 5);
- Exist=1;
- }
- }
- }
- void carprefs(void)
- {
- //LOCK_CAR_DOORS(carmake,4);
- SET_CAR_ENGINE_ON(carmake, true, false);
- SET_CAR_CAN_BE_DAMAGED(carmake, false);
- SET_CAR_CAN_BE_VISIBLY_DAMAGED(carmake, false);
- SET_CAN_BURST_CAR_TYRES(carmake, false);
- SET_CAR_ALWAYS_CREATE_SKIDS(carmake, true);
- SET_CAR_STAY_IN_SLOW_LANE(carmake, false);
- neons();
- }
- void pedprefs(void)
- {
- SET_GROUP_MEMBER(mygroup, carped);
- SET_GROUP_CHAR_DUCKS_WHEN_AIMED_AT(carped, false);
- SET_CHAR_NEVER_LEAVES_GROUP(carped, true);
- SET_CHAR_ACCURACY(carped, 100);
- SET_CHAR_CAN_BE_SHOT_IN_VEHICLE(carped, false);
- SET_CHAR_WILL_DO_DRIVEBYS(carped, true);
- SET_CHAR_WILL_MOVE_WHEN_INJURED(carped, true);
- SET_CHAR_WILL_USE_COVER(carped, false);
- SET_CHAR_BULLETPROOF_VEST(carped, true);
- SET_CHAR_PROVIDE_COVERING_FIRE(carped, true);
- SET_CHAR_WILL_USE_CARS_IN_COMBAT(carped, true);
- SET_CHAR_WILL_LEAVE_CAR_IN_COMBAT(carped, false);
- SET_PED_DONT_DO_EVASIVE_DIVES(carped, true);
- UpdateWeaponOfPed(carped, WEAPON_M4);
- SET_PED_DIES_WHEN_INJURED(carped, false);
- SET_PED_IS_BLIND_RAGING(carped, true);
- SET_CHAR_RELATIONSHIP_GROUP(carped, RELATIONSHIP_GROUP_PLAYER);
- SET_CHAR_RELATIONSHIP(carped, RELATIONSHIP_RESPECT, RELATIONSHIP_GROUP_PLAYER);
- SET_CHAR_MOVE_ANIM_SPEED_MULTIPLIER(carped, 15);
- SET_CHAR_CANT_BE_DRAGGED_OUT(carped, true);
- SET_CHAR_WILL_FLY_THROUGH_WINDSCREEN(carped, false);
- SET_PED_PATH_MAY_USE_CLIMBOVERS(carped, true);
- SET_PED_PATH_MAY_USE_LADDERS(carped, true);
- SET_PED_PATH_MAY_DROP_FROM_HEIGHT(carped, true);
- SET_PED_DIES_WHEN_INJURED(carped, false);
- SET_CHAR_CAN_SMASH_GLASS(carped, true);
- GIVE_PED_HELMET(carped);
- }
- void createpeds(void)
- {
- findme();
- CreateGroup();
- REQUEST_MODEL(carmake);
- while (!HAS_MODEL_LOADED(carmake)) WAIT(0);
- CREATE_CAR(carmake, x1+10.0f, y1+15.0f, z1, &carmake, 1);
- REQUEST_MODEL(MODEL_M_M_FATCOP_01);
- while (!HAS_MODEL_LOADED(MODEL_M_M_FATCOP_01)) WAIT(0);
- CREATE_CHAR_INSIDE_CAR(carmake, 16, MODEL_M_M_FATCOP_01, &carped);
- carprefs();
- pedprefs();
- TASK_CAR_MISSION(carped, carmake, mycar, 2, 160, 2, 15, 10);
- SET_CHAR_WILL_LEAVE_CAR_IN_COMBAT(carped, false);
- SET_CHAR_CAN_BE_SHOT_IN_VEHICLE(carped, false);
- SET_CHAR_KEEP_TASK(carped, true);
- UpdateWeaponOfPed(carped, WEAPON_MP5);
- MARK_MODEL_AS_NO_LONGER_NEEDED(carmake);
- MARK_MODEL_AS_NO_LONGER_NEEDED(carped);
- {
- print("New member IN A CAR added to your gang");
- }
- }
- void footpeds(void)
- {
- GET_CHAR_COORDINATES(GetPlayerPed(), &x1, &y1, &z1);
- CreateGroup();
- REQUEST_MODEL(MODEL_IG_BRUCIE);
- while (!HAS_MODEL_LOADED(MODEL_IG_BRUCIE)) WAIT(0);
- CREATE_CHAR(16, MODEL_IG_BRUCIE, x1, y1+4.0f, z1, &carped, true);
- pedprefs();
- SET_CHAR_INVINCIBLE(carped, 1);
- UpdateWeaponOfPed(carped, WEAPON_M4);
- MARK_MODEL_AS_NO_LONGER_NEEDED(carped);
- {
- print("New member ON FOOT added to your gang");
- }
- }
- void pedspawner(void)
- {
- if (menuon==1);
- {
- Display(line1,"UP - Change ped weapon");
- Display(line2,"DOWN - Hippo bodyguards");
- Display(line3,"LEFT - Spawn peds on foot");
- Display(line4,"RIGHT - Spawn peds in cars");
- }
- if(IS_BUTTON_JUST_PRESSED(0, DPAD_RIGHT))
- {
- if (IS_CHAR_IN_ANY_CAR(GetPlayerPed()))
- {
- createpeds();
- }
- else
- {
- print("You need to be in a vehicle");
- }
- }
- if(IS_BUTTON_JUST_PRESSED(0, DPAD_LEFT))
- {
- if (IS_CHAR_IN_ANY_CAR(GetPlayerPed()))
- {
- print("You need to be on foot");
- }
- else
- {
- footpeds();
- }
- }
- if(IS_BUTTON_JUST_PRESSED(0, DPAD_DOWN))
- {
- if(DOES_CHAR_EXIST(carped))
- {
- DELETE_CHAR(&carped);
- DELETE_CAR(&carmake);
- print("Peds have been deleted");
- }
- else
- {
- uint pednet;
- GET_CHAR_COORDINATES(GetPlayerPed(), &x1, &y1, &z1);
- GET_CLOSEST_CHAR(x1, y1, z1, 300, 0, 70, &delped);
- if(DOES_CHAR_EXIST(delped))
- {
- GET_NETWORK_ID_FROM_PED(delped,&pednet);
- while(!REQUEST_CONTROL_OF_NETWORK_ID(pednet))
- {
- WAIT(0);
- DELETE_CHAR(&delped);
- }
- }
- }
- }
- if((IS_BUTTON_JUST_PRESSED(0,DPAD_UP)) && (DOES_CHAR_EXIST(carped)))
- {
- if(weapswap==3)
- {
- weapswap=0;
- curweap=0;
- }
- else
- {
- weapswap++;
- curweap=0;
- }
- if((weapswap==0) && (curweap==0))
- {
- UpdateWeaponOfPed(carped, WEAPON_MOLOTOV);
- weapswap=1;
- curweap=1;
- print("Peds now have molotovs");
- }
- else if((weapswap==1) && (curweap==0))
- {
- UpdateWeaponOfPed(carped, WEAPON_ROCKET);
- weapswap=2;
- curweap=1;
- print("Peds now have rockets");
- }
- else if((weapswap==2) && (curweap==0))
- {
- UpdateWeaponOfPed(carped, WEAPON_GRENADE);
- weapswap=3;
- curweap=1;
- print("Peds now have grenades");
- }
- }
- }
- void menutoggle(void)
- {
- if((IS_BUTTON_PRESSED(0,STICK_R)) && (menuon == 0))
- {
- menuon = 1;
- pedspawner();
- }
- else if((IS_BUTTON_PRESSED(0,STICK_R)) && (menuon == 1))
- {
- menuon = 0;
- }
- }
- void main(void)
- {
- THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
- while (TRUE)
- {
- WAIT(0);
- menutoggle();
- }
- }
- //Functions.c
- void draw_title(float x, float y, float width, float height, uint r, uint g, uint b, uint a, char *val)
- {
- #ifdef PC
- if (!IS_FONT_LOADED(7))
- {
- LOAD_TEXT_FONT(7);
- }
- SET_TEXT_FONT(7);
- #else
- if (!IS_FONT_LOADED(6))
- {
- LOAD_TEXT_FONT(6);
- }
- SET_TEXT_FONT(6);
- #endif
- SET_TEXT_BACKGROUND(0);
- SET_TEXT_DROPSHADOW(0, 0, 0, 0, 255);
- SET_TEXT_EDGE(1, 0, 0, 0, 255);
- SET_TEXT_PROPORTIONAL(1);
- SET_TEXT_WRAP(0.0000, 1.0000);
- SET_TEXT_COLOUR(r, g, b, a);
- SET_TEXT_SCALE(width, height);
- SET_TEXT_JUSTIFY(0);
- SET_TEXT_CENTRE(1);
- SET_TEXT_RIGHT_JUSTIFY(0);
- DISPLAY_TEXT_WITH_LITERAL_STRING(x, y, "STRING", val);
- }
- void set_up_draw(int type, float width, float height, uint r, uint g, uint b, uint a)
- {
- SET_TEXT_FONT(0);
- SET_TEXT_BACKGROUND(0);
- SET_TEXT_DROPSHADOW(0, 0, 0, 0, 255);
- SET_TEXT_EDGE(1, 0, 0, 0, 255);
- if (type == 1)
- {
- SET_TEXT_BACKGROUND(1);
- }
- else if (type == 2)
- {
- SET_TEXT_DROPSHADOW(1, 0, 0, 0, 255);
- }
- else if (type == 3)
- {
- SET_TEXT_EDGE(1, 0, 0, 0, 255);
- }
- SET_TEXT_COLOUR(r, g, b, a);
- SET_TEXT_SCALE(width, height);
- SET_TEXT_PROPORTIONAL(1);
- SET_TEXT_JUSTIFY(0);
- SET_TEXT_CENTRE(0);
- SET_TEXT_RIGHT_JUSTIFY(0);
- }
- float draw_text(char *gxtName, float x, float y, char *val)
- {
- float result;
- result = GET_STRING_WIDTH_WITH_STRING(gxtName, val);
- DISPLAY_TEXT_WITH_LITERAL_STRING(x, y, gxtName, val);
- return result;
- }
- void draw_number(char *gxtName, float x, float y, int val)
- {
- DISPLAY_TEXT_WITH_NUMBER(x, y, gxtName, val);
- }
- void draw_float(char *gxtName, float x, float y, float val)
- {
- DISPLAY_TEXT_WITH_FLOAT(x, y, gxtName, val, 4);
- }
- //Settings.c
- /****************************************************
- SCRIPT SETTINGS - Values and data that can be changed to
- suit your needs.
- *****************************************************/
- #define SUPER_SPEED_MULTIPLIER 10.0f
- ////#define NUMBER_OF_NETWORK_PLAYERS 16
- //#define DEBUG
- //############### Define Ps3 GamePad ################################//
- #define SELECT 0xD
- #define START 0xC
- #define SQUARE 0xE
- #define TRIANGLE 0xF
- #define X 0x10
- #define CIRCLE 0x11
- #define DPAD_UP 0x8
- #define DPAD_DOWN 0x9
- #define DPAD_LEFT 0xA
- #define DPAD_RIGHT 0xB
- #define L2 0x5
- #define R2 0x7
- #define L1 0x4
- #define R1 0x6
- #define STICK_L 0x12
- #define STICK_R 0x13
- //############### Define Ps3 GamePad ################################//
Advertisement
Add Comment
Please, Sign In to add comment