Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (84,879 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

Skorpro

Miscellaneous SCO Scripts

Recommended Posts

Skorpro

 

SCO Scripts

 

Hi folks,

 

I've decided to make a new topic for misc SCO scripts. So feel free to post your ideas and codes... biggrin.gif

 

Required tools:

Alexander Blade's SCOCL

OpenIV

 

Info:

How to use SCOCL

 

 

 

My "contribution" wink.gif (This are conversions of my own mods!)

 

 

Check my Top-Down-View biggrin.gif (used in many XBOX trainers...)

 

 

Bomb Mod (key: Num5)

 

-> on foot

user posted image

 

-> in heli

user posted image

 

 

Traffic Control (key: F5)

 

-> full traffic

user posted image

 

-> no traffic

user posted image

 

 

Small Speedo (in any vehicle)

user posted image

 

 

 

/*****************************************************   SCOCL project by Alexander Blade © 2011     **	This mod was created by Skorpro © 2008-2012   *****************************************************/#include <natives.h>#include <common.h>#include <strings.h>#include <types.h>#include <consts.h>//Bomb Modbool EB = 0;int HOCH, BREIT;Car helibomber;Object BOMB;float x, y, z, zground;float a, b, c, cground;float repeat, counter;uint heliBomb = 0x3E3783A1;uint onFootBomb = 0x7E339194;//Traffic Control	int CHANGETRAFFIC = 1;float TCX, TCY, TCZ;//SpeedoCar veh_speed;float fSpeed;int iSpeed;bool rep_speed = 0;void SkorproTrafficControl(void){if (CHANGETRAFFIC == 1){ GET_CHAR_COORDINATES(GetPlayerPed(), &TCX, &TCY, &TCZ); CLEAR_AREA_OF_CARS(TCX, TCY, TCZ, 400.0); CLEAR_AREA_OF_CHARS(TCX, TCY, TCZ, 400.0); CLEAR_AREA_OF_COPS(TCX, TCY, TCZ, 400.0); CHANGETRAFFIC = 2; PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING","No Traffic",3000,1); SET_CAR_DENSITY_MULTIPLIER(0.0); SET_PED_DENSITY_MULTIPLIER(0.0); SWITCH_GARBAGE_TRUCKS(0); SET_RANDOM_CAR_DENSITY_MULTIPLIER(0.0); SET_PARKED_CAR_DENSITY_MULTIPLIER(2.25); ALLOW_EMERGENCY_SERVICES(0);}else if (CHANGETRAFFIC == 2){ CHANGETRAFFIC = 3; PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING","Low Traffic",3000,1); SET_CAR_DENSITY_MULTIPLIER(0.25); SET_PED_DENSITY_MULTIPLIER(0.50); SWITCH_GARBAGE_TRUCKS(1); SET_RANDOM_CAR_DENSITY_MULTIPLIER(0.25); SET_PARKED_CAR_DENSITY_MULTIPLIER(2.25); ALLOW_EMERGENCY_SERVICES(1);}else if (CHANGETRAFFIC == 3){ CHANGETRAFFIC = 4; PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING","Standard",3000,1); SET_CAR_DENSITY_MULTIPLIER(1.25); SET_PED_DENSITY_MULTIPLIER(1.50); SWITCH_GARBAGE_TRUCKS(1); SET_RANDOM_CAR_DENSITY_MULTIPLIER(1.25); SET_PARKED_CAR_DENSITY_MULTIPLIER(2.25); ALLOW_EMERGENCY_SERVICES(1);}else if (CHANGETRAFFIC == 4){ CHANGETRAFFIC = 5; PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING","High Traffic",3000,1); SET_CAR_DENSITY_MULTIPLIER(3.25); SET_PED_DENSITY_MULTIPLIER(3.50); SWITCH_GARBAGE_TRUCKS(1); SET_RANDOM_CAR_DENSITY_MULTIPLIER(3.25); SET_PARKED_CAR_DENSITY_MULTIPLIER(2.25); ALLOW_EMERGENCY_SERVICES(1);}else if (CHANGETRAFFIC == 5){ CHANGETRAFFIC = 1; PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING","Full Traffic",3000,1); SET_CAR_DENSITY_MULTIPLIER(7.25); SET_PED_DENSITY_MULTIPLIER(7.50); SWITCH_GARBAGE_TRUCKS(1); SET_RANDOM_CAR_DENSITY_MULTIPLIER(7.25); SET_PARKED_CAR_DENSITY_MULTIPLIER(2.25); ALLOW_EMERGENCY_SERVICES(1);}}void BombType(float xc, float yc, float zc, int breit_var, int hoch_var, int abstand){hoch_var = hoch_var * abstand;breit_var = breit_var * abstand;for (HOCH = 0; HOCH <= hoch_var; HOCH += abstand) { // start position zc = zc + HOCH; ADD_EXPLOSION(xc, yc, zc, 4, 7.50, 1, 0, 1.01); WAIT(20);    // start position end for (BREIT = 4; BREIT <= breit_var; BREIT += 4)  {  xc = xc - BREIT;  WAIT(20);  ADD_EXPLOSION(xc, yc, zc, 4, 7.50, 1, 0, 1.01);  yc = yc + BREIT;  WAIT(20);  ADD_EXPLOSION(xc, yc, zc, 4, 7.50, 1, 0, 1.01);  xc = xc + BREIT;  WAIT(20);  ADD_EXPLOSION(xc, yc, zc, 4, 7.50, 1, 0, 1.01);  xc = xc + BREIT;  WAIT(20);  ADD_EXPLOSION(xc, yc, zc, 4, 7.50, 1, 0, 1.01);  yc = yc - BREIT;  WAIT(20);  ADD_EXPLOSION(xc, yc, zc, 4, 7.50, 1, 0, 1.01);  yc = yc - BREIT;  WAIT(20);  ADD_EXPLOSION(xc, yc, zc, 4, 7.50, 1, 0, 1.01);  xc = xc - BREIT;  WAIT(20);  ADD_EXPLOSION(xc, yc, zc, 4, 7.50, 1, 0, 1.01);  xc = xc - BREIT;  WAIT(20);  ADD_EXPLOSION(xc, yc, zc, 4, 7.50, 1, 0, 1.01);  WAIT(20);  yc = yc + BREIT;  xc = xc + BREIT;  WAIT(20); }}WAIT(20);}	void SpawnBomb(void){ if (IS_CHAR_IN_ANY_HELI(GetPlayerPed())) { 	GET_CAR_CHAR_IS_USING(GetPlayerPed(), &helibomber); 	// HELI_BOMB 	REQUEST_MODEL(heliBomb); 	while (!HAS_MODEL_LOADED(heliBomb)) { WAIT(10); } 	GET_CHAR_COORDINATES(GetPlayerPed(), &x, &y, &z);     GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS(GetPlayerPed(), 0.5, -2.1, -2.1, &x, &y, &z); 	CREATE_OBJECT(heliBomb, x, y, z, &BOMB, 1);     SET_OBJECT_HEALTH(BOMB, 100.0);     SET_OBJECT_ROTATION(BOMB, 90.0, 0.0, 0.0); 	 	GET_GROUND_Z_FOR_3D_COORD(x, y, z, &zground); 	repeat = z - zground; 	//repeat 	for (counter = 1; counter <= repeat; counter++)  	{   WAIT(27);   SLIDE_OBJECT(BOMB, x, y, zground, 0.0, 0.0, 1.3, 0); 	} 	// repeat end! 	WAIT(100);    //---------------- In Heli    // BombType(X, Y, Z, width, highness, spacing)    BombType(x, y, zground, 7, 2, 2);    DELETE_OBJECT(&BOMB);    MARK_MODEL_AS_NO_LONGER_NEEDED(heliBomb);    //---------------- } else if (EB == 0) { 	// ON_FOOT_BOMB 	REQUEST_MODEL(onFootBomb); 	while (!HAS_MODEL_LOADED(onFootBomb)) { WAIT(10); } 	GET_CHAR_COORDINATES(GetPlayerPed(), &a, &b, &c); 	GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS(GetPlayerPed(), 0.0, 0.9, 0.0, &a, &b, &c);     GET_GROUND_Z_FOR_3D_COORD(a, b, c, &cground);     CREATE_OBJECT(onFootBomb, a, b, cground, &BOMB, 1);     SET_OBJECT_HEALTH(BOMB, 1000.0); 	SET_OBJECT_ONLY_DAMAGED_BY_PLAYER(BOMB, 1); 	FREEZE_OBJECT_POSITION(BOMB, 1); 	PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", "Press  Num5 (default)  for detonation!", 2000, 1); 	WAIT(500);     EB = 1; } else if (EB == 1) { 	//---------------- On Foot     // BombType(X, Y, Z, width, highness, spacing)     BombType(a, b, cground, 4, 2, 2); 	DELETE_OBJECT(&BOMB); 	MARK_MODEL_AS_NO_LONGER_NEEDED(onFootBomb); 	//----------------     EB = 0; }WAIT(100);}void SkorproTextAndInt(float x1, float y1, int red1, int green1, int blue1, int num, float x2, float y2, int red2, int green2, int blue2){// TEXTSET_TEXT_FONT(1); // TEXTFONT_LEDSET_TEXT_BACKGROUND(0);SET_TEXT_SCALE(0.22, 0.27);SET_TEXT_COLOUR(red1, green1, blue1, 255);SET_TEXT_RIGHT_JUSTIFY(0);SET_TEXT_DROPSHADOW(0, 255, 255, 255, 255);DISPLAY_TEXT_WITH_LITERAL_STRING(x1, y1, "STRING", "Speed : ");// NUMSET_TEXT_FONT(1); // TEXTFONT_LEDSET_TEXT_BACKGROUND(0);SET_TEXT_SCALE(0.22, 0.27);SET_TEXT_COLOUR(red2, green2, blue2, 255);SET_TEXT_RIGHT_JUSTIFY(0);SET_TEXT_DROPSHADOW(0, 255, 255, 255, 255);DISPLAY_TEXT_WITH_NUMBER(x2, y2, "NUMBER", num);}// ############################### MAIN ####################################void main(void){FORCE_LOADING_SCREEN(TRUE);THIS_SCRIPT_SHOULD_BE_SAVED();SET_CAR_DENSITY_MULTIPLIER(1.0);SET_MAX_WANTED_LEVEL(6);SET_PLAYER_CONTROL(GetPlayerIndex(), TRUE);LOAD_SCENE(-420.245, 1137.605, 12.530);SET_CHAR_COORDINATES_NO_OFFSET(GetPlayerPed(), -420.245, 1137.605, 12.530);SET_CHAR_HEADING(GetPlayerPed(), 360.0);FORCE_TIME_OF_DAY(9, 21);RELEASE_TIME_OF_DAY();RELEASE_WEATHER();SET_CAM_BEHIND_PED(GetPlayerPed());WAIT(2000);FORCE_LOADING_SCREEN(FALSE);DO_SCREEN_FADE_IN_UNHACKED(4000);WAIT(2000);PRINT_STRING_WITH_LITERAL_STRING_NOW("string", "Scocl test!", 3000, 1);while (TRUE) { // Traffic Control if (IS_GAME_KEYBOARD_KEY_PRESSED(63)) // 63 =  F5 { 	SkorproTrafficControl(); 	WAIT(500); }  // Bomb Mod if (IS_GAME_KEYBOARD_KEY_PRESSED(76)) // 76 = Num 5 { 	SpawnBomb(); 	WAIT(500); }  // Speedo if (IS_CHAR_IN_ANY_CAR(GetPlayerPed())) { rep_speed = 1; }  else { rep_speed = 0; } if (rep_speed == 1) // LOOP start { 	if (!IS_CHAR_IN_ANY_CAR(GetPlayerPed())) 	{   rep_speed = 0; // LOOP end 	} 	GET_CAR_CHAR_IS_USING(GetPlayerPed(), &veh_speed); 	GET_CAR_SPEED(veh_speed, &fSpeed); 	fSpeed = fSpeed * 3.61;	// MaxSpeed (Default: 3.61)! 	iSpeed = (int) fSpeed; // float to int 	SkorproTextAndInt(0.01, 0.97, 0, 255, 0, iSpeed, 0.07, 0.97, 255, 0, 0); }	    // PAUSE WAIT(0);}}

 

 

Maybe it's useful - maybe not?!? Anyway - have fun wink.gif

Edited by Skorpro

Share this post


Link to post
Share on other sites
Frank.s

Great scripts. icon14.gif

This also gives good useful info to people who are learning SCO.

Share this post


Link to post
Share on other sites
Terreur69

it will help me a lot, thank you skorpro wink.gif

 

add blip on radar:

 

 

Blip testBlip;ADD_BLIP_FOR_COORD(cordX, cordY, cordZ, &testBlip);   CHANGE_BLIP_SPRITE(testBlip, BLIP_HOSPITAL);   CHANGE_BLIP_COLOUR(testBlip, 0);  CHANGE_BLIP_DISPLAY(testBlip, BLIP_DISPLAY_MAP_ONLY);   CHANGE_BLIP_NAME_FROM_ASCII(testBlip, "Hospital");

 

 

 

video editor :

 

boolean start_var = 0;while (TRUE){if ( (IS_GAME_KEYBOARD_KEY_PRESSED(65)))   // press F7{if  (start_var == 0){ACTIVATE_REPLAY_MENU();WAIT(500);start_var == 1;}else if (start_var == 1){return;WAIT(100);start_var == 0;}}WAIT(0);}

 

Edited by terreur69

Share this post


Link to post
Share on other sites
Skorpro

@terreur69 & Frank.s

 

Thanx smile.gif

Some new SCO scripts coming soon...

 

 

 

Share this post


Link to post
Share on other sites
Deluxe8900

to pickup up object:

 

 

void pickupitem(void)       {          if(IS_GAME_KEYBOARD_KEY_JUST_PRESSED(KEY_##))   {                   Ped Pped = GetPlayerPed();           GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS(Pped, 0, 0, 0, &BGx, &BGy, &BGz);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup1 , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup2 , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup3 , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup4 , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup5 , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup6 , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup7 , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup8 , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup9 , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup10 , TRUE);           CREATE_OBJECT(##, BGx, BGy, BGz,&pickup11 , TRUE);                         SET_OBJECT_AS_STEALABLE(pickup, true);           SET_OBJECT_AS_STEALABLE(pickup1, true);           SET_OBJECT_AS_STEALABLE(pickup2, true);           SET_OBJECT_AS_STEALABLE(pickup3, true);           SET_OBJECT_AS_STEALABLE(pickup4, true);           SET_OBJECT_AS_STEALABLE(pickup5, true);           SET_OBJECT_AS_STEALABLE(pickup6, true);           SET_OBJECT_AS_STEALABLE(pickup7, true);           SET_OBJECT_AS_STEALABLE(pickup8, true);           SET_OBJECT_AS_STEALABLE(pickup9, true);           SET_OBJECT_AS_STEALABLE(pickup10, true);           SET_OBJECT_AS_STEALABLE(pickup11, true);           Print("Pick object up");}                      }

 

 

Just replace the ## with a object hex or hash whatever, and it will work, and change your game key press smile.gif

Share this post


Link to post
Share on other sites
Skorpro

@Deluxe8900

Thanx for your script biggrin.gif

 

You want to stop the heli animation just for fun... My way to do this:

 

/*****************************************************   SCOCL project by Alexander Blade © 2011     **	This mod was created by Skorpro © 2008-2012   *****************************************************/#include <natives.h>#include <common.h>#include <strings.h>#include <types.h>#include <consts.h>#define heliKey 35 // 35 = HVehicle currentHeli, attachedHeli;uint heliModel;float hx, hy, hz;int heliCol1, heliCol2, heliSCol1, heliSCol2;	// Heli Colorsbool heliAnim = 0;void SkorproHeliAnimStop(void){ if (IS_CHAR_IN_ANY_HELI(GetPlayerPed())) { 	if (IS_GAME_KEYBOARD_KEY_PRESSED(heliKey)) // default "H" 	{   if (heliAnim == 0)   {   	GET_CAR_CHAR_IS_USING(GetPlayerPed(), &currentHeli);   	TURN_OFF_VEHICLE_EXTRA(currentHeli, 1, 1);   	TURN_OFF_VEHICLE_EXTRA(currentHeli, 3, 1);   	GET_CAR_COLOURS(currentHeli, &heliCol1, &heliCol2);   	GET_EXTRA_CAR_COLOURS(currentHeli, &heliSCol1, &heliSCol2);   	GET_CAR_MODEL(currentHeli, &heliModel);   	REQUEST_MODEL(heliModel);   	while(!HAS_MODEL_LOADED(heliModel)) { WAIT(0); }   	CREATE_CAR(heliModel, hx, hy, hz, &attachedHeli, true);   	GET_CAR_COORDINATES(currentHeli, &hx, &hy, &hz);   	ATTACH_CAR_TO_CAR(attachedHeli, currentHeli, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);   	SET_CAR_VISIBLE(currentHeli, 0);   	CHANGE_CAR_COLOUR(attachedHeli, heliCol1, heliCol2);   	SET_EXTRA_CAR_COLOURS(attachedHeli, heliSCol1, heliSCol2);   	PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING","Stop Heli Anim",1000,1);   	heliAnim = 1;   	WAIT(500);   }   else if (heliAnim == 1)   {   	GET_CAR_CHAR_IS_USING(GetPlayerPed(), &currentHeli);   	SET_CAR_VISIBLE(currentHeli, 1);   	TURN_OFF_VEHICLE_EXTRA(currentHeli, 1, 0);   	TURN_OFF_VEHICLE_EXTRA(currentHeli, 3, 0);   	DELETE_CAR(&attachedHeli);   	PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING","Reset Heli Anim",1000,1);   	heliAnim = 0;   	WAIT(500);   } 	} }}// ############################### MAIN ####################################void main(void){FORCE_LOADING_SCREEN(TRUE);THIS_SCRIPT_SHOULD_BE_SAVED();SET_CAR_DENSITY_MULTIPLIER(1.0);SET_MAX_WANTED_LEVEL(6);SET_PLAYER_CONTROL(GetPlayerIndex(), TRUE);LOAD_SCENE(-420.245, 1137.605, 12.530);SET_CHAR_COORDINATES_NO_OFFSET(GetPlayerPed(), -420.245, 1137.605, 12.530);SET_CHAR_HEADING(GetPlayerPed(), 360.0);FORCE_TIME_OF_DAY(9, 21);RELEASE_TIME_OF_DAY();RELEASE_WEATHER();SET_CAM_BEHIND_PED(GetPlayerPed());WAIT(2000);FORCE_LOADING_SCREEN(FALSE);DO_SCREEN_FADE_IN_UNHACKED(4000);WAIT(2000);PRINT_STRING_WITH_LITERAL_STRING_NOW("string", "Scocl test!", 3000, 1);while (TRUE) { SkorproHeliAnimStop();  // PAUSE WAIT(0);}}

 

 

Hope you like it smile.gif

 

NOTE: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" (in your Readme.txt and/or Topic)! Thanx smile.gif

Edited by Skorpro

Share this post


Link to post
Share on other sites
Skorpro

@Xxchr0m3kingxX

 

This is the conversion of my "Undercover Police Car" mod! (converted by iHaZ for XBOX - thank you)

Note: It is still not tested!!

 

 

/*-------------------------------------  Undercover Police Mod by SKORPRO   -------------------------------------*/#include <natives.h>#include <common.h>#include <strings.h>#include <types.h>#include <consts.h>#define key1 76 // F5#define key2 77 // F6#define key3 78 //F7#define upc_horn 1bool ULight = 0; // upc_light_varbool LRepeat = 0; // light_repeatbool USiren = 0; // upc_siren_varbool USiren2= 0;// upc_siren_var2bool copcar = 0;  // upc_policeCarbool coprepeat = 0; // policeCar_repeatObject UCarLight; // upc_car_lightuint m_ObjectModel = 0xCB26803D;Vehicle UCar; // upc_carVehicle UCar2; // upc_car2Ped ped; // peduint USound; // upc_sounduint USound2; // upc_sound2uint USound3; // upc_sound3int UColorHigh = 250; // upc_color_high int UColorLow = 0; // int upc_color_lowfloat u_x, u_y, u_z; // upco_x, upco_y, upco_z//MODbool DoesPlayerCharExist(void){return DOES_CHAR_EXIST(GetPlayerPed());}void WaitUntilPlayerCharExists(void){while(!DoesPlayerCharExist()) { WAIT(0); }}void Police_Delete(void){if ( (ULight == 1) && (USiren == 1) ){       DELETE_OBJECT(&UCarLight);    FORCE_CAR_LIGHTS(UCar, VEHICLE_LIGHTS_0);    SET_VEH_HAZARDLIGHTS(UCar, 0);    ULight = 0;	 LRepeat = 0; STOP_SOUND(USound); RELEASE_SOUND_ID(USound); USiren = 0;}}void Police_Light(void){if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen!{ Police_Delete();}GET_CAR_COORDINATES(UCar, &u_x, &u_y, &u_z);DRAW_LIGHT_WITH_RANGE(u_x, u_y, u_z, UColorHigh, UColorLow, UColorLow, 27.0f, 18.0f); // redFORCE_CAR_LIGHTS(UCar, VEHICLE_LIGHTS_2);SET_OBJECT_ALPHA(UCarLight, 0);WAIT(80);if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen!{ Police_Delete();}WAIT(80);if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen!{ Police_Delete();}GET_CAR_COORDINATES(UCar, &u_x, &u_y, &u_z);DRAW_LIGHT_WITH_RANGE(u_x, u_y, u_z, UColorHigh, UColorHigh, UColorHigh, 27.0f, 18.0f); // whiteFORCE_CAR_LIGHTS(UCar, VEHICLE_LIGHTS_1);SET_OBJECT_ALPHA(UCar, 255);WAIT(80);if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen!{ Police_Delete();}WAIT(80);if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen!{ Police_Delete();}  GET_CAR_COORDINATES(UCar, &u_x, &u_y, &u_z);DRAW_LIGHT_WITH_RANGE(u_x, u_y, u_z, UColorLow, UColorLow, UColorHigh, 27.0f, 18.0f); // blueSET_OBJECT_ALPHA(ULight, 0);WAIT(80);if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen!{ Police_Delete();}WAIT(80);if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen!{ Police_Delete();}SET_OBJECT_ALPHA(ULight, 255);}void Police_Sound(void){if (USiren == 0){ USiren = 1; USound = GET_SOUND_ID(); PLAY_SOUND_FROM_VEHICLE(USound, "AMBIENT_HORNS_REGULAR_SIRENS_COP_SIREN_LOOP", UCar); WAIT(100);}else if (USiren == 1){ USiren = 0; STOP_SOUND(USound); RELEASE_SOUND_ID(USound);}WAIT(100);}void Police_Horn(void){USound2 = GET_SOUND_ID();PLAY_SOUND_FROM_VEHICLE(USound2, "BC3_BUOYS_AHOY_HARBOUR_PATROL_SIREN", UCar);}void Police_PoliceCar(void){SWITCH_CAR_SIREN(UCar2, 1);WAIT(11);SWITCH_CAR_SIREN(UCar2, 0);WAIT(0);if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_POLICE_VEHICLE(GetPlayerPed())) ){ copcar = 0;	 coprepeat = 0; SET_VEH_HAZARDLIGHTS(UCar2, 0); USiren2 = 0; STOP_SOUND(USound3); RELEASE_SOUND_ID(USound3); WAIT(100);}}void StartMods1(void){if ( (IS_CHAR_IN_ANY_CAR(GetPlayerPed())) && (!IS_CHAR_ON_ANY_BIKE(GetPlayerPed())) && (!IS_CHAR_IN_ANY_POLICE_VEHICLE(GetPlayerPed())) ){ GET_CAR_CHAR_IS_USING(GetPlayerPed(), &UCar); 	// Polizei Blaulicht if (IS_GAME_KEYBOARD_KEY_JUST_PRESSED(key1))    { 	if (ULight == 0) 	{   // Blaulicht AN!   SET_VEH_HAZARDLIGHTS(UCar, 1);      REQUEST_MODEL(m_ObjectModel);   while(!HAS_MODEL_LOADED(m_ObjectModel))   {   WAIT(10);   }   CREATE_OBJECT(m_ObjectModel, 0.0, 0.0, 0.0, &UCarLight, true);   ATTACH_OBJECT_TO_PED(ULight, GetPlayerPed(), BONE_ROOT, 0.55f, 1.09f, -0.07f, 0.77f, 0.0f, 0.0f, 0);   DELETE_OBJECT(&UCarLight); // 2x erstellen!!   WAIT(10);   CREATE_OBJECT(m_ObjectModel, 0.0, 0.0, 0.0, UCarLight, true);   ATTACH_OBJECT_TO_PED(UCarLight, GetPlayerPed(), BONE_ROOT, 0.55f, 1.09f, -0.07f, 0.77f, 0.0f, 0.0f, 0);   	ULight = 1;   LRepeat = 1; 	} 	else if (ULight == 1) 	{   // Blaulicht AUS!   DELETE_OBJECT(&UCarLight);   FORCE_CAR_LIGHTS(UCar, VEHICLE_LIGHTS_0);   SET_VEH_HAZARDLIGHTS(UCar, 0);   ULight = 0;	   LRepeat = 0; 	} 	else if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen! 	{   Police_Delete(); 	} } // Repeat LIGHT AN if (LRepeat == 1) { 	Police_Light(); } // Repeat LIGHT AUS // Polizei Sound if (IS_GAME_KEYBOARD_KEY_JUST_PRESSED(key2)) { 	Police_Sound(); }  	// Sound mit Horn if ( (IS_PLAYER_PRESSING_HORN(CONVERT_INT_TO_PLAYERINDEX(GET_PLAYER_ID())) == 1) && (!IS_CHAR_IN_ANY_POLICE_VEHICLE(GetPlayerPed())) ) { 	if (upc_horn == 1) 	{   if ( (ULight == 1) && (USiren == 1) )   {   	Police_Horn();   } 	} } // Flashlight mit Horn if (IS_PLAYER_PRESSING_HORN(IS_PLAYER_PRESSING_HORN(CONVERT_INT_TO_PLAYERINDEX(GET_PLAYER_ID())) == 1)) { 	if ( (ULight == 1) && (USiren == 1) ) 	{   FORCE_CAR_LIGHTS(UCar, VEHICLE_LIGHTS_2);   WAIT(7);   FORCE_CAR_LIGHTS(UCar, VEHICLE_LIGHTS_1);   WAIT(7); 	} } else if (!IS_PLAYER_PRESSING_HORN(IS_PLAYER_PRESSING_HORN(CONVERT_INT_TO_PLAYERINDEX(GET_PLAYER_ID())) == 1)) { 	FORCE_CAR_LIGHTS(UCar, VEHICLE_LIGHTS_0); } // Aussteigen if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen! { 	Police_Delete(); }  if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen! { 	Police_Delete(); } // Polizeiauto LIGHT without SOUND if (IS_CHAR_IN_ANY_POLICE_VEHICLE(GetPlayerPed())) { 	GET_CAR_CHAR_IS_USING(GetPlayerPed(), &UCar2); 	if (IS_GAME_KEYBOARD_KEY_JUST_PRESSED(key1)) 	{   if (copcar == 0)   {   	SET_VEH_HAZARDLIGHTS(UCar2, 1);   	copcar = 1;   	coprepeat = 1;   	WAIT(100);   }   else if (copcar == 1)   {   	SET_VEH_HAZARDLIGHTS(UCar2, 0);   	copcar = 0;	   	coprepeat = 0;   	WAIT(100);   } 	} 	// Polizei Sound im POLICECAR! 	if (IS_GAME_KEYBOARD_KEY_JUST_PRESSED(key2)) 	{   if (USiren2 == 0)   {   	USiren2 = 1;   	USound3 = GET_SOUND_ID();   	PLAY_SOUND_FROM_VEHICLE(USound3, "AMBIENT_HORNS_REGULAR_SIRENS_COP_SIREN_LOOP", UCar2);   	WAIT(100);   }	   else if (USiren2 == 1)   {   	USiren2 = 0;   	STOP_SOUND(USound3);   	RELEASE_SOUND_ID(USound3);   } 	} 	else if ((IS_CONTROL_PRESSED(2, 3)) && (!IS_CHAR_IN_ANY_CAR(GetPlayerPed()))) // Key zum Aussteigen! 	{   USiren2 = 0;   STOP_SOUND(USound3);   RELEASE_SOUND_ID(USound3); 	} 	// Flashlight mit Horn 	if (IS_PLAYER_PRESSING_HORN(IS_PLAYER_PRESSING_HORN(CONVERT_INT_TO_PLAYERINDEX(GET_PLAYER_ID())) == 1)) 	{   FORCE_CAR_LIGHTS(UCar2, VEHICLE_LIGHTS_2);   WAIT(7);   FORCE_CAR_LIGHTS(UCar2, VEHICLE_LIGHTS_1);   WAIT(7); 	} 	else if (!IS_PLAYER_PRESSING_HORN(IS_PLAYER_PRESSING_HORN(CONVERT_INT_TO_PLAYERINDEX(GET_PLAYER_ID())) == 1)) 	{   FORCE_CAR_LIGHTS(UCar2, VEHICLE_LIGHTS_0); 	} } // Repeat LIGHT AN if (coprepeat == 1) { 	Police_PoliceCar(); } // Repeat LIGHT AU WAIT(10);}}void Init(void){THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();WaitUntilPlayerCharExists();//THIS_SCRIPT_SHOULD_BE_SAVED();}void main(void){Init();while(TRUE){ Police_Light(); Police_Sound(); Police_Horn(); Police_Delete(); Police_PoliceCar(); WAIT(100); StartMods1();}}

 

 

EDIT: New code w/o #include "Helpers.c"...

 

PS: Please could someone test it for me ... I'm sooo lazy... tounge2.gif

 

 

 

Have fun biggrin.gif

 

NOTE: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" (in your Readme.txt and/or Topic)! Thanx smile.gif

Edited by Skorpro

Share this post


Link to post
Share on other sites
Skorpro

@Deluxe8900

 

A simple weapon trainer... (Original Alice (LUA) script by Alexander Blade! icon14.gif )

 

 

void GiveWeapon(Ped ped,eWeapon weapon){if (HAS_CHAR_GOT_WEAPON(ped, weapon) == true ){ SET_CHAR_AMMO(ped, weapon, 30000);}else {	 GIVE_WEAPON_TO_CHAR(ped, weapon, 30000, 0);}}	void WeaponTrainer(void){  Ped p;  GET_PLAYER_CHAR(GetPlayerIndex(), &p);  SET_PLAYER_FAST_RELOAD(GetPlayerIndex(), true);  GiveWeapon(p, WEAPON_KNIFE);  GiveWeapon(p, WEAPON_GRENADE);  GiveWeapon(p, WEAPON_DEAGLE);  GiveWeapon(p, WEAPON_SHOTGUN);  GiveWeapon(p, WEAPON_MICRO_UZI);  GiveWeapon(p, WEAPON_M4);  GiveWeapon(p, WEAPON_SNIPERRIFLE);  GiveWeapon(p, WEAPON_RLAUNCHER);    if (GET_CURRENT_EPISODE() == 2) // only TBoGT!  { 	GiveWeapon(p, WEAPON_EPISODIC_21); // PARACHUTE  }}

 

 

List of Weapons (GTA4) (www.gtamodding.com)

 

Have fun smile.gif

 

EDIT: Add "SET_PLAYER_FAST_RELOAD"

 

NOTE: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" (in your Readme.txt and/or Topic)! Thanx smile.gif

Edited by Skorpro

Share this post


Link to post
Share on other sites
Terreur69

hey skorpro , thank you for all the script, it will help many people icon14.gif

you remember when you're asking me to add the fov of IV, its still not working:

 

 

Camera camera;   // NOT long!CREATE_CAM(14, &camera);SET_CAM_FOV(camera, 50.0); 

 

Share this post


Link to post
Share on other sites
AgentWD40

Very useful indeed, thank you Skorpro. Just hope the xbox360 community gives you credit and don't make money off you.

Share this post


Link to post
Share on other sites
Chr0m3 x MoDz
Very useful indeed, thank you Skorpro. Just hope the xbox360 community gives you credit and don't make money off you.

You can bet some little leech will try it i already used some scripts of his in a release and credited him

Share this post


Link to post
Share on other sites
Chr0m3 x MoDz

 

@Xxchr0m3kingxX

 

This is the conversion of my "Undercover Police Car" mod! (converted by iHaZ for XBOX - thank you)

Note: It is still not tested!!

 

NOTE: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" (in your Readme.txt and/or Topic)! Thanx smile.gif

This mod works but it activates instantly when in car no button press and freezes after about 3 seconds

Edited by Xxchr0m3kingxX

Share this post


Link to post
Share on other sites
Deluxe8900

 

@Xxchr0m3kingxX

 

This mod works but it activates instantly when in car no button press and freezes after about 3 seconds

Have you converted the natives from 1.7 to 1.4?

Edited by Deluxe8900

Share this post


Link to post
Share on other sites
Terreur69

please , remove the code in your comment.

Share this post


Link to post
Share on other sites
jdmalex2

here is the source code for my simple trainer...

 

there is 2 versions .

 

source pack

 

 

Video of the 1st trainer

 

compile 1_newscript.c with scocl

 

tested in all version except complete but shouldn't be a problem

Share this post


Link to post
Share on other sites
jdmalex2

 

Vehicle Spawner code: needs some source files from above file pack mainly for display.. check out 1_newscript.c and add this script in the top portion.

 

 

//single's#define SELECT_NEXT_BUTTON          	DPAD_RIGHT#define SELECT_PREVIOUS_BUTTON          DPAD_LEFT#define CATEGORY_BUTTON_SELECT          DPAD_UP#define SPAWN_VEH_BUTTON          	DPAD_DOWN#define BOOST_BUTTON            X#define BOOST_ONOFF            	STICK_L//combo's#define SPAWNER_ON_OFF_BUTTON_1          R1#define SPAWNER_ON_OFF_BUTTON_2          STICK_Lint vehicle ,vehiclemodel , numbermodels;int PlayerDriver , forceX , forceY , forceZ;int isCarSpawnMenuOn = 0,boostready=true;int models[100] , vehCounter = 0 , Option=1;bool boost=0;Vehicle Spawned_Vehicle ,InvVehicle , Spawned_Vehicle ,PlayerVehicle;float x, y, z ,CarSpeed , VehSpeed;float PositonLineBot=0.55000000;  //Vehicle Category:float PositonLineTop=0.58000000;  //Vehicle Category: ""catagory""float VehicleDispLine=0.61000000;  // displayes Modelfloat Boostline=0.65000000;        // boost on or offfloat PositonLineOne=0.68000000; //Speed:float PositonLineTwo=0.71000000; // float speedvoid printname(void){if(isCarSpawnMenuOn == 1){ SET_TEXT_FONT(6); 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.00000000, 1.00000000);	 //SET_TEXT_COLOUR(253, 160, 35, 255); YELLOW SET_TEXT_COLOUR(255, 20, 147, 255); //PINK SET_TEXT_SCALE(0.30000000, 0.30000000); SET_TEXT_JUSTIFY(true); SET_TEXT_RIGHT_JUSTIFY(0); char* carName = GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(vehiclemodel); vehiclemodel = models[vehCounter]; DISPLAY_TEXT_WITH_LITERAL_STRING(0.05000000, VehicleDispLine, "STRING", carName); //draw_title(0.15000000, VehicleDispLine, 0.30000000, 0.30000000, 255, 20, 147, 255, carName);}	}void displaySpeed(void){if(IS_CHAR_ON_FOOT(GetPlayerPed())){ GET_CHAR_SPEED(GetPlayerPed(), &VehSpeed); set_up_draw(2, 0.30000000, 0.30000000, 253, 69, 0, 255); //orange 255-69-0 draw_text("STRING", 0.05000000, PositonLineOne, "Foot Speed:");  set_up_draw(2, 0.30000000, 0.30000000, 255, 0, 0, 200); // red draw_float("NUMBR", 0.05000000, PositonLineTwo, VehSpeed); }if(IS_CHAR_IN_ANY_CAR(GetPlayerPed())) {	 set_up_draw(2, 0.30000000, 0.30000000,  253, 69, 0, 255); //orange draw_text("STRING", 0.05000000, PositonLineOne, "Vehicle Speed:");  set_up_draw(2, 0.30000000, 0.30000000, 255, 0, 0, 200); // red draw_float("NUMBR", 0.05000000, PositonLineTwo, CarSpeed); }}void modelslist(void){if(Option==1){numbermodels = 9;models[1]=MODEL_SULTANRS; //Sports cars and Supercarsmodels[2]=MODEL_SUPERGT; //Sports cars and Supercarsmodels[3]=MODEL_INFERNUS; //Sports cars and Supercarsmodels[4]=MODEL_TURISMO;//Sports cars and Supercarsmodels[5]=MODEL_COMET; //Sports cars and Supercarsmodels[6]=MODEL_COQUETTE; //Sports cars and Supercarsmodels[7]=MODEL_BANSHEE;  //Sports cars and Supercarsmodels[8]=MODEL_TURISMO;//Sports cars and Supercarsmodels[9]=MODEL_FELTZER;}if(Option==2){numbermodels = 7;models[1]=MODEL_BOBBER; //Motorcyclesmodels[2]=MODEL_FAGGIO; //Motorcyclesmodels[3]=MODEL_HELLFURY;//Motorcyclesmodels[4]=MODEL_NRG900;//Motorcyclesmodels[5]=MODEL_PCJ;//Motorcyclesmodels[6]=MODEL_SANCHEZ;//Motorcyclesmodels[7]=MODEL_ZOMBIEB;//Motorcycles}if(Option==3){numbermodels = 13;models[1]=MODEL_VIGERO; //Muscle Cars and Vintagemodels[2]=MODEL_VIGERO2; //Muscle Cars and Vintagemodels[3]=MODEL_VOODOO; //Muscle Cars and Vintagemodels[4]=MODEL_STALION; //Muscle Cars and Vintagemodels[5]=MODEL_RUINER; //Muscle Cars and Vintagemodels[6]=MODEL_SABRE; //Muscle Cars and Vintagemodels[7]=MODEL_SABRE2; //Muscle Cars and Vintagemodels[8]=MODEL_SABREGT; //Muscle Cars and Vintagemodels[9]=MODEL_PEYOTE; //Muscle Cars and Vintagemodels[10]=MODEL_MANANA; //Muscle Cars and Vintagemodels[11]=MODEL_FACTION; //Muscle Cars and Vintagemodels[12]=MODEL_DUKES; //Muscle Cars and Vintagemodels[13]=MODEL_BUCCANEER; //Muscle Cars and Vintage}if(Option==4){numbermodels = 6;models[1]=MODEL_FUTO; //Two-Doors and Hatchbacksmodels[2]=MODEL_FORTUNE; //Two-Doors and Hatchbacksmodels[3]=MODEL_URANUS; //Two-Doors and Hatchbacksmodels[4]=MODEL_SENTINEL; //Two-Doors and Hatchbacksmodels[5]=MODEL_BLISTA; //Two-Doors and Hatchbacksmodels[6]=MODEL_VIRGO;}if(Option==5){numbermodels = 33;models[1]=MODEL_SOLAIR;//Four-Door Sedans/Saloons and Station Wagonsmodels[2]=MODEL_SULTAN; //Four-Door Sedans/Saloons and Station Wagonsmodels[3]=MODEL_VINCENT;//Four-Door Sedans/Saloons and Station Wagonsmodels[4]=MODEL_WASHINGTON;//Four-Door Sedans/Saloons and Station Wagonsmodels[5]=MODEL_WILLARD;//Four-Door Sedans/Saloons and Station Wagonsmodels[6]=MODEL_STRATUM;//Four-Door Sedans/Saloons and Station Wagonsmodels[7]=MODEL_STRETCH;//Four-Door Sedans/Saloons and Station Wagonmodels[8]=MODEL_ROM;//Four-Door Sedans/Saloons and Station Wagonsmodels[9]=MODEL_SCHAFTER;//Four-Door Sedans/Saloons and Station Wagonsmodels[10]=MODEL_PREMIER;//Four-Door Sedans/Saloons and Station Wagonsmodels[11]=MODEL_PINNACLE;models[12]=MODEL_PRES;//Four-Door Sedans/Saloons and Station Wagonsmodels[13]=MODEL_PRIMO;//Four-Door Sedans/Saloons and Station Wagons	models[14]=MODEL_PMP600;//Four-Door Sedans/Saloons and Station Wagonsmodels[15]=MODEL_ORACLE;//Four-Door Sedans/Saloons and Station Wagonsmodels[16]=MODEL_MERIT;//Four-Door Sedans/Saloons and Station Wagonsmodels[17]=MODEL_MARBELLA;//Four-Door Sedans/Saloons and Station Wagonsmodels[18]=MODEL_LOKUS;//Four-Door Sedans/Saloons and Station Wagonsmodels[19]=MODEL_INGOT;//Four-Door Sedans/Saloons and Station Wagonsmodels[20]=MODEL_INTRUDER;//Four-Door Sedans/Saloons and Station Wagonsmodels[21]=MODEL_HAKUMAI;//Four-Door Sedans/Saloons and Station Wagonsmodels[22]=MODEL_FEROCI;//Four-Door Sedans/Saloons and Station Wagonsmodels[23]=MODEL_FEROCI2;//Four-Door Sedans/Saloons and Station Wagonsmodels[24]=MODEL_EMPEROR;//Four-Door Sedans/Saloons and Station Wagonsmodels[25]=MODEL_EMPEROR2;//Four-Door Sedans/Saloons and Station Wagonsmodels[26]=MODEL_ESPERANTO;//Four-Door Sedans/Saloons and Station Wagonsmodels[27]=MODEL_FEROCI;//Four-Door Sedans/Saloons and Station Wagonsmodels[28]=MODEL_FEROCI2;//Four-Door Sedans/Saloons and Station Wagonsmodels[29]=MODEL_DF8;//Four-Door Sedans/Saloons and Station Wagonsmodels[30]=MODEL_DILETTANTE;//Four-Door Sedans/Saloons and Station Wagonsmodels[31]=MODEL_CHAVOS;//Four-Door Sedans/Saloons and Station Wagonsmodels[32]=MODEL_COGNOSCENTI;//Four-Door Sedans/Saloons and Station Wagonsmodels[33]=MODEL_ADMIRAL;  //Four-Door Sedans/Saloons and Station Wagons}if(Option==6){numbermodels = 13;models[1]=MODEL_RANCHER;//SUVs/Crossovers, Pick-ups and Vansmodels[2]=MODEL_REBLA;//SUVs/Crossovers, Pick-ups and Vansmodels[3]=MODEL_PATRIOT;//SUVs/Crossovers, Pick-ups and Vansmodels[4]=MODEL_PERENNIAL;//SUVs/Crossovers, Pick-ups and Vansmodels[5]=MODEL_PERENNIAL2;//SUVs/Crossovers, Pick-ups and Vansmodels[6]=MODEL_LANDSTALKER;//SUVs/Crossovers, Pick-ups and Vansmodels[7]=MODEL_MINIVAN;//SUVs/Crossovers, Pick-ups and Vansmodels[8]=MODEL_MOONBEAM;//SUVs/Crossovers, Pick-ups and Vansmodels[9]=MODEL_FXT;//SUVs/Crossovers, Pick-ups and Vansmodels[10]=MODEL_HABANERO;//SUVs/Crossovers, Pick-ups and Vansmodels[11]=MODEL_HUNTLEY;//SUVs/Crossovers, Pick-ups and Vansmodels[12]=MODEL_BOBCAT; //SUVs/Crossovers, Pick-ups and Vansmodels[13]=MODEL_CAVALCADE;//SUVs/Crossovers, Pick-ups and Vans}if(Option==7){numbermodels = 19;models[1]=MODEL_FLATBED;//Commercial/Industrialmodels[2]=MODEL_FORKLIFT;//Commercial/Industrialmodels[3]=MODEL_BURRITO;//Commercial/Industrialmodels[4]=MODEL_BURRITO2;//Commercial/Industrialmodels[5]=MODEL_BENSON;//Commercial/Industrialmodels[6]=MODEL_BIFF;//Commercial/Industrialmodels[7]=MODEL_BOXVILLE; //Commercial/Industrialmodels[8]=MODEL_MRTASTY;//Commercial/Industrialmodels[9]=MODEL_MULE;//Commercial/Industrialmodels[10]=MODEL_PACKER;//Commercial/Industrialmodels[11]=MODEL_PHANTOM;//Commercial/Industrialmodels[12]=MODEL_PONY;//Commercial/Industrialmodels[13]=MODEL_RIPLEY;//Commercial/Industrialmodels[14]=MODEL_SPEEDO;//Commercial/Industrialmodels[15]=MODEL_YANKEE;//Commercial/Industrialmodels[16]=MODEL_STEED;//Commercial/Industrialmodels[17]=MODEL_AIRTUG; //Commercial/Industriamodels[18]=MODEL_ROMERO; //Commercial/Industriamodels[19]=MODEL_E109; //Commercial/Industria}if(Option==8){numbermodels = 15;	models[1]=MODEL_NOOSE; //Emergencymodels[2]=MODEL_AMBULANCE; //Emergencymodels[3]=MODEL_POLICE;  //Emergencymodels[4]=MODEL_POLICE2; //Emergencymodels[5]=MODEL_POLPATRIOT; //Emergencymodels[6]=MODEL_PSTOCKADE; //Emergencymodels[7]=MODEL_AMBULANCE; //Emergencymodels[8]=MODEL_POLICEB; //Emergencymodels[9]=MODEL_POLICE3; //Emergencymodels[10]=MODEL_POLICE4; //Emergencymodels[11]=MODEL_POLICEW; //Emergencymodels[12]=MODEL_FBI;models[13]=MODEL_FIRETRUK;models[14]=MODEL_NSTOCKADE;models[15]=MODEL_STOCKADE;}if(Option==9){numbermodels = 5;models[1]=MODEL_BUS;//Public Servicmodels[2]=MODEL_CABBY;//Public Servicemodels[3]=MODEL_TAXI;//Public Servicemodels[4]=MODEL_TAXI2;//Public Servicemodels[5]=MODEL_TRASH;//Public Service}if(Option==10){numbermodels = 4;models[1]=MODEL_ANNIHILATOR;//Aircraftmodels[2]=MODEL_MAVERICK;//Aircraftmodels[3]=MODEL_POLMAV;//Aircraftmodels[4]=MODEL_TOURMAV;//Aircraft}if(Option==11){numbermodels = 8;models[1]=MODEL_DINGHY;//Boatsmodels[2]=MODEL_JETMAX;//Boatsmodels[3]=MODEL_MARQUIS;//Boatsmodels[4]=MODEL_PREDATOR;//Boatsmodels[5]=MODEL_REEFER;//Boatsmodels[6]=MODEL_SQUALO;//Boatsmodels[7]=MODEL_TUGA;//Boatsmodels[8]=MODEL_TROPIC;//Boats//models[LAST_MODEL]=MODEL_SUBWAY_LO;//models[LAST_MODEL]=MODEL_SUBWAY_HI;}if(Option==12){numbermodels = 39;//EFLCmodels[1]=MODEL_APC;models[2]=MODEL_AVAN;models[3]=MODEL_BUFFALO;models[4]=MODEL_BULLET;models[5]=MODEL_CADDY;models[6]=MODEL_CAVCADE2;models[7]=MODEL_F620;models[8]=MODEL_GBURRITO;models[9]=MODEL_STRETCH2;models[10]=MODEL_PBUS;models[11]=MODEL_SCHAFTER2;models[12]=MODEL_SCHAFTER3;models[13]=MODEL_SERRANO;models[14]=MODEL_SERRANO2;models[15]=MODEL_SLAMVAN;models[16]=MODEL_SUPERD;models[17]=MODEL_SUPERD2;models[18]=MODEL_TAMPA;models[19]=MODEL_TOWTRUCK;models[20]=MODEL_AKUMA;models[21]=MODEL_ANGEL;models[22]=MODEL_BATI2;models[23]=MODEL_DAEMON;models[24]=MODEL_DIABO;models[25]=MODEL_DOUBLE;models[26]=MODEL_FAGGIO2;models[27]=MODEL_HAKUCH;models[28]=MODEL_HEXER;models[29]=MODEL_LYCAN;models[30]=MODEL_NIGHTBL;models[31]=MODEL_REVENANT;models[32]=MODEL_VADER;models[33]=MODEL_WOLFS;models[34]=MODEL_BUZZARD;models[35]=MODEL_SWIFT;models[36]=MODEL_SKYLIFT;models[37]=MODEL_SMUGGLER;models[38]=MODEL_FLOATER;models[39]=MODEL_BLADE;//MODEL_CKER2//MODEL_REGINA//MODEL_RHAPSODY//MODEL_YANKEE2//MODEL_BATI//MODEL_DOUBLE2//MODEL_WAYFARER//MODEL_INNOV//MODEL_HAKUCH2}}void SetCarspawnmenuon(void){if((IS_BUTTON_PRESSED(0,SPAWNER_ON_OFF_BUTTON_1)) && (IS_BUTTON_PRESSED(0,SPAWNER_ON_OFF_BUTTON_2))){ 	if (isCarSpawnMenuOn == 0){	isCarSpawnMenuOn = 1;	 	//Print("Car Spawner ON"); 	WAIT(150); 	} 	else if(isCarSpawnMenuOn == 1){isCarSpawnMenuOn = 0; 	//Print("Car Spawner OFF"); 	WAIT(150);  	 	}}}void BoostToggle(void){if((boost==0)&&(IS_CHAR_IN_ANY_CAR(GetPlayerPed()))){ set_up_draw(2, 0.30000000, 0.30000000, 255, 20, 147, 110); //orange  //pink 255-20-147 draw_text("STRING", 0.05000000, Boostline, "Boost OFF"); if(IS_BUTTON_JUST_PRESSED(0, BOOST_ONOFF)) { 	boost=1; } }else if((boost==1)&&(IS_CHAR_IN_ANY_CAR(GetPlayerPed()))){ set_up_draw(2, 0.30000000, 0.30000000, 255, 20, 147, 255); //orange draw_text("STRING", 0.05000000, Boostline, "Boost ON"); if(IS_BUTTON_JUST_PRESSED(0, BOOST_ONOFF)) { 	boost=0; 	 }}  }void Boost(void){   Vehicle PlayerVehicle;   int PlayerDriver , forceX , forceY , forceZ;   CarSpeed = 0.00000000;if (IS_CHAR_IN_ANY_CAR(GetPlayerPed())){ GET_CAR_CHAR_IS_USING(GetPlayerPed(), &PlayerVehicle);   GET_DRIVER_OF_CAR(PlayerVehicle, &PlayerDriver ); 	 if (((GetPlayerPed() == PlayerDriver) && (IS_VEH_DRIVEABLE( PlayerVehicle )) && (DOES_VEHICLE_EXIST( PlayerVehicle )))) { 	 	GET_CAR_SPEED( PlayerVehicle, &CarSpeed); 	 	if(boost==1) 	{   //START_PTFX_ON_VEH( "fire_gas_burner_glow", PlayerVehicle, ptX,ptY,ptZ, 0, 1, 1, 1.00000000 );   //uint stopfxone = TRIGGER_PTFX_ON_VEH( "fire_gas_burner_glow", PlayerVehicle, ptX,ptY,ptZ, 0, 1, 1, 1.00000000);   //START_PTFX_ON_VEH( "fire_gas_burner_flames", PlayerVehicle, ptX,ptY,ptZ, 0, 1, 1, 1.00000000 );   //uint stopptfx = TRIGGER_PTFX_ON_VEH( "fire_gas_burner_flames", PlayerVehicle, ptX,ptY,ptZ, 0, 1, 1, 1.00000000);   //stopfxone; 	if ((IS_VEHICLE_ON_ALL_WHEELS( PlayerVehicle )) && (!IS_CAR_IN_AIR_PROPER( PlayerVehicle ))) 	{      if((IS_BUTTON_JUST_PRESSED(0,BOOST_BUTTON)) && (boostready==true))   {   	if ((CarSpeed > 1.50000000) && (CarSpeed < 55.00000000))   	{	          forceX = 0.00000000*CarSpeed*22.60000000;     forceY = -1.00000000-CarSpeed-22.60000000;     forceZ = 0.00000000*CarSpeed*22.60000000;          APPLY_FORCE_TO_CAR(PlayerVehicle, 0, forceX, forceY, forceZ, 0.00000000,0.00000000,0.00000000, 0, 1, 1, 1 );                            TRIGGER_PTFX_ON_VEH( "nitro_splutter", PlayerVehicle, 0.03000000, -0.05000000, 0.00000000, 0.00000000 , 0.00000000 , 0.00000000 , 1.00000000 );     START_PTFX_ON_VEH("nitro_burst", PlayerVehicle, 0.03000000, -0.05000000, 0.00000000, 0.00000000 , 0.00000000 , 0.00000000 , 1.00000000 );     SET_CAR_FORWARD_SPEED(PlayerVehicle, CarSpeed+10.0f);     Cam camaraC;     GET_GAME_CAM(&camaraC);        	     //START_PTFX_ON_VEH( "fire_gas_burner_flames", PlayerVehicle, ptX,ptY,ptZ, 0, 1, 1, 1.00000000 );     //uint stopptfx = TRIGGER_PTFX_ON_VEH( "fire_gas_burner_flames", PlayerVehicle, ptX,ptY,ptZ, 0, 1, 1, 1.00000000);     //stopptfx;     boostready=false;	   	}   }   else if(boostready==false)   {   	//STOP_PTFX(stopptfx);   	boostready=true;   	   } 	}                	}       }   }}void SpawnerToggleListControl(void){if( isCarSpawnMenuOn == 1){if(IS_BUTTON_JUST_PRESSED(0,SELECT_NEXT_BUTTON)){ if(vehCounter < numbermodels) { //vehCounter = (vehCounter+1)%NUMBER_OF_MODELS; vehCounter+=1; } }else if(IS_BUTTON_JUST_PRESSED(0,SELECT_PREVIOUS_BUTTON)){ if(vehCounter > 1 ) { //vehCounter = (vehCounter-1)%NUMBER_OF_MODELS; vehCounter-=1; }}}}void ShowLineDisp(char *Category){set_up_draw(2, 0.30000000, 0.30000000, 255, 0, 0, 200); //reddraw_text("STRING", 0.05000000, PositonLineTop, Category); }void SpawnerToggleListView(void){if( isCarSpawnMenuOn == 1){ 	 set_up_draw(2, 0.30000000, 0.30000000, 253, 69, 0, 255); //orange 255-69-0 draw_text("STRING", 0.05000000, PositonLineBot, "Vehicle Category:");   /*if( Option == 0) {   ShowLineDisp("All avalible vehicles");       if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1;    	Option = 1;   }    }*/ if( Option == 1) {   ShowLineDisp("Sports cars and Supercars");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1;    	Option = 2;   } } else if( Option == 2) {   ShowLineDisp("Motorcycles");   if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {     	vehCounter = 1; // 9 to 15 //Motorcycles   	Option = 3;   } } else if( Option == 3) {   ShowLineDisp("Muscle Cars and Vintage");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {     	vehCounter = 1; //16 to 28 //Muscle Cars and Vintage   	Option = 4;   } } else if( Option == 4) {   ShowLineDisp( "Two-Doors and Hatchbacks");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1; //29 to 34 //Two-Doors and Hatchbacks   	Option = 5;   } } else if( Option == 5) {   ShowLineDisp("Four-Door Sedans and Station Wagons");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1; //35 to 67 //Four-Door Sedans/Saloons and Station Wagons   	Option = 6;   } } else if( Option == 6) {   ShowLineDisp("SUVs,Crossovers, Pick-ups and Vans");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1; //68 to 80 //SUVs/Crossovers, Pick-ups and Vans   	Option = 7;   } } else if( Option == 7) {   ShowLineDisp( "Commercial/Industrial");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1; //81 to 99 //Commercial/Industrial   	Option = 8;   } } else if( Option == 8) {   ShowLineDisp("Emergency");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1; // 100 to 114 //Emergency   	Option = 9;   } } else if( Option == 9) {   ShowLineDisp("Public Service");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1; // 115 to 119 //Public Service   	Option = 10;   } } else if( Option == 10) {   ShowLineDisp("Aircraft");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1; // 120 to 123 //Aircraft   	Option = 11;   } } else if( Option == 11) {   ShowLineDisp("Boats");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1; //124 to 131 //Boats   	Option = 12;   } } else if( Option == 12) {   ShowLineDisp("EFLC Vehicles");    if(IS_BUTTON_JUST_PRESSED(0,CATEGORY_BUTTON_SELECT))   {   	vehCounter = 1; // 132 to 170// EFLC   	Option = 1;   } }}}void DeleteVehicle(void){float fX, fY, fZ;Vehicle charVehicle;if(IS_CHAR_IN_ANY_CAR(GetPlayerPed())){	 GET_CHAR_COORDINATES(GetPlayerPed(), &fX, &fY, &fZ); GET_CAR_CHAR_IS_USING(GetPlayerPed(), &charVehicle); if(DOES_VEHICLE_EXIST(charVehicle)) { 	WARP_CHAR_FROM_CAR_TO_COORD(GetPlayerPed(), fX, fY, fZ); 	DELETE_CAR(&charVehicle); }}	}void PressButtonToSpawn(void){if( isCarSpawnMenuOn == 1){ if(IS_BUTTON_JUST_PRESSED(0, SPAWN_VEH_BUTTON)) { 	vehicle = models[vehCounter]; 	DeleteVehicle(); 	REQUEST_MODEL(vehicle); 	if (IS_MODEL_IN_CDIMAGE(vehicle)) 	{ 	while (!HAS_MODEL_LOADED(vehicle)) WAIT(0); 	MARK_MODEL_AS_NO_LONGER_NEEDED(vehicle); 	GET_CHAR_COORDINATES(GetPlayerPed(), &x, &y, &z); 	CREATE_CAR(vehicle, x, y, z, &Spawned_Vehicle, true); 	SET_CAR_ENGINE_ON(Spawned_Vehicle, 0, true); 	WARP_CHAR_INTO_CAR(GetPlayerPed(), Spawned_Vehicle); 	SET_CAR_AS_MISSION_CAR(Spawned_Vehicle); 	 	} 	else 	{ 	Print("Error , Cannot Find Model In Vehicles.img"); 	} 	 }}}bool inheli=0;void HeliBladesFull(void) {Vehicle modveh;if((IS_CHAR_IN_ANY_HELI(GetPlayerPed())) & (inheli==1)){	 GET_CAR_CHAR_IS_USING(GetPlayerPed(), &modveh); if(DOES_VEHICLE_EXIST(modveh)) { 	SET_HELI_BLADES_FULL_SPEED(modveh); 	inheli=0;	 } }else if((!IS_CHAR_IN_ANY_HELI(GetPlayerPed())) & (inheli==0)){ inheli=1;}}/*// Not Needed For Final Product  STARTbool finishedspawn = 0; // USED FOR TESTING JUST SPAWNS U AT THE AIRPORT AND BREAKS THE LOOP SO YOU ARNT STUCK IN INF SPAWN MODEvoid spawnatairportonce(void) // Not really needed Used for testing {if(finishedspawn == 0){SET_CHAR_COORDINATES(GetPlayerPed(), 2242.19,  727.24,  5.91);// AIRPORTfinishedspawn = 1;}}// Not Needed For Final Product  END*/void DoNewScript(void){printname();modelslist();SetCarspawnmenuon();SpawnerToggleListControl();SpawnerToggleListView();BoostToggle();Boost();HeliBladesFull();displaySpeed();PressButtonToSpawn();//spawnatairportonce();// USED FOR TESTING JUST SPAWNS U AT THE AIRPORT//PrintHelp();}

 

 

 

My vehicle spawner I made while back.. has its own categories for picking what you want faster

Edited by jdmalex2

Share this post


Link to post
Share on other sites
Skorpro

Hi folks, hi terreur69!

 

It's been a looong time! But after my New Safehouses project I decided to make some codes in SCO again wink.gif

 

This time I tried to make a Simple Traffic Loader in SCO... and this is the result:

 

 

// Simple Traffic Loader by SKORPRO#include <natives.h>#include <common.h>#include <strings.h>#include <types.h>#include <consts.h>#define ALLMODELS 95  // number of ALL car models#define WAITING 5000  // interval = time between LOAD and UNLOAD model#define RNDCARCOUNT 10  // number of LOADED carsboolean taxiUNLOAD = true;  // oppress taxisboolean supOwnCar = true;  // suppress OWN current caruint globRndModel[RNDCARCOUNT];uint random;int iRnd1, iRnd2;typedef struct _ModelDataSet{uint cars;} ModelDataSet;ModelDataSet rndModel[ALLMODELS];void SkorproRandomCarLoad(int rndCars, int count) // ##################{rndModel[0].cars = MODEL_ADMIRAL;rndModel[1].cars = MODEL_BANSHEE;rndModel[2].cars = MODEL_BENSON;rndModel[3].cars = MODEL_BIFF;	rndModel[4].cars = MODEL_BLISTA;rndModel[5].cars = MODEL_BOBCAT;rndModel[6].cars = MODEL_BOXVILLE;rndModel[7].cars = MODEL_BUCCANEER;rndModel[8].cars = MODEL_BURRITO;rndModel[9].cars = MODEL_BUS;	rndModel[10].cars = MODEL_CAVALCADE;rndModel[11].cars = MODEL_CHAVOS;rndModel[12].cars = MODEL_COGNOSCENTI;rndModel[13].cars = MODEL_COMET;	rndModel[14].cars = MODEL_COQUETTE;rndModel[15].cars = MODEL_DF8;	rndModel[16].cars = MODEL_DILETTANTE;rndModel[17].cars = MODEL_DUKES;	rndModel[18].cars = MODEL_E109;	rndModel[19].cars = MODEL_EMPEROR;rndModel[20].cars = MODEL_EMPEROR2;rndModel[21].cars = MODEL_ESPERANTO;rndModel[22].cars = MODEL_FACTION;rndModel[23].cars = MODEL_FELTZER;rndModel[24].cars = MODEL_FEROCI;rndModel[25].cars = MODEL_FLATBED;rndModel[26].cars = MODEL_FORTUNE;rndModel[27].cars = MODEL_FUTO;	rndModel[28].cars = MODEL_FXT;	rndModel[29].cars = MODEL_HABANERO;rndModel[30].cars = MODEL_HAKUMAI;rndModel[31].cars = MODEL_HUNTLEY;rndModel[32].cars = MODEL_INFERNUS;rndModel[33].cars = MODEL_INGOT;	rndModel[34].cars = MODEL_INTRUDER;rndModel[35].cars = MODEL_LANDSTALKER;rndModel[36].cars = MODEL_LOKUS;	rndModel[37].cars = MODEL_MANANA;rndModel[38].cars = MODEL_MARBELLA;rndModel[39].cars = MODEL_MERIT;	rndModel[40].cars = MODEL_MINIVAN;rndModel[41].cars = MODEL_MOONBEAM;rndModel[42].cars = MODEL_MRTASTY;rndModel[43].cars = MODEL_MULE;	rndModel[44].cars = MODEL_ORACLE;rndModel[45].cars = MODEL_PACKER;rndModel[46].cars = MODEL_PATRIOT;rndModel[47].cars = MODEL_PERENNIAL;rndModel[48].cars = MODEL_PEYOTE;rndModel[49].cars = MODEL_PHANTOM;rndModel[50].cars = MODEL_PINNACLE;rndModel[51].cars = MODEL_PMP600;rndModel[52].cars = MODEL_PONY;	rndModel[53].cars = MODEL_PREMIER;rndModel[54].cars = MODEL_PRES;	rndModel[55].cars = MODEL_PRIMO;	rndModel[56].cars = MODEL_RANCHER;rndModel[57].cars = MODEL_REBLA;	rndModel[58].cars = MODEL_BUS;rndModel[59].cars = MODEL_ROMERO;rndModel[60].cars = MODEL_ROM;	rndModel[61].cars = MODEL_RUINER;rndModel[62].cars = MODEL_SABRE;	rndModel[63].cars = MODEL_SABRE2;rndModel[64].cars = MODEL_SABREGT;rndModel[65].cars = MODEL_SCHAFTER;rndModel[66].cars = MODEL_SENTINEL;rndModel[67].cars = MODEL_SOLAIR;rndModel[68].cars = MODEL_SPEEDO;rndModel[69].cars = MODEL_STALION;rndModel[70].cars = MODEL_STEED;	rndModel[71].cars = MODEL_STOCKADE;rndModel[72].cars = MODEL_STRATUM;rndModel[73].cars = MODEL_STRETCH;rndModel[74].cars = MODEL_SULTAN;rndModel[75].cars = MODEL_SULTANRS;rndModel[76].cars = MODEL_SUPERGT;rndModel[77].cars = MODEL_TRASH;	rndModel[78].cars = MODEL_TURISMO;rndModel[79].cars = MODEL_URANUS;rndModel[80].cars = MODEL_VIGERO;rndModel[81].cars = MODEL_VIGERO2;rndModel[82].cars = MODEL_VINCENT;rndModel[83].cars = MODEL_VIRGO;	rndModel[84].cars = MODEL_VOODOO;rndModel[85].cars = MODEL_WASHINGTON;rndModel[86].cars = MODEL_WILLARD;rndModel[87].cars = MODEL_YANKEE;rndModel[88].cars = MODEL_BOBBER;rndModel[89].cars = MODEL_FAGGIO;rndModel[90].cars = MODEL_HELLFURY;rndModel[91].cars = MODEL_NRG900;rndModel[92].cars = MODEL_PCJ;	rndModel[93].cars = MODEL_SANCHEZ;rndModel[94].cars = MODEL_ZOMBIEB;uint model = rndModel[rndCars].cars;// Request ModelREQUEST_MODEL(model);while(!HAS_MODEL_LOADED(model)) { WAIT(10); }globRndModel[count] = model; }void SkorproKillModels() {if (supOwnCar == true) {   Vehicle currCar; uint currModel; GET_CAR_CHAR_IS_USING(GetPlayerPed(), &currCar); GET_CAR_MODEL(currCar, &currModel); SUPPRESS_CAR_MODEL(currModel); MARK_MODEL_AS_NO_LONGER_NEEDED(currModel);}if (taxiUNLOAD == true){ MARK_MODEL_AS_NO_LONGER_NEEDED(MODEL_TAXI); MARK_MODEL_AS_NO_LONGER_NEEDED(MODEL_TAXI2); MARK_MODEL_AS_NO_LONGER_NEEDED(MODEL_CABBY);}}void main(void){while (TRUE){ for (iRnd1 = 0; iRnd1 < RNDCARCOUNT; iRnd1++) { 	GENERATE_RANDOM_INT_IN_RANGE(0, ALLMODELS - 1, &random); 	SkorproRandomCarLoad(random, iRnd1); 	WAIT(100); 	SkorproKillModels(); } WAIT(WAITING); for (iRnd2 = 0; iRnd2 < RNDCARCOUNT; iRnd2++) { 	MARK_MODEL_AS_NO_LONGER_NEEDED(globRndModel[iRnd2]); 	SkorproKillModels(); } WAIT(10);}}

 

 

...I have tried the rndModel[ALLMODELS] as a array like

 

rndModel[ALLMODELS] = { MODEL_ADMIRAL, MODEL_BANSHEE... };

 

...and it worked perfectly in C++ (ScriptHook) but not in SCO! Why? I have no idea.

Anyway! With typedef struct it works perfectly too.

 

@terreur69:

Hope this is what you want smile.gif If not, PM me!

 

@ALL:

NOTE: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" (in your Readme.txt and/or Topic)! Thanx smile.gif

 

Share this post


Link to post
Share on other sites
spadger

Yes the array initializing is broken on scocl, it should work of course, and does with any other compiler. You can also auto initialize a whole array to one value like thus: int array[20] = { 0 };

 

 

Share this post


Link to post
Share on other sites
Skorpro
Yes the array initializing is broken on scocl, it should work of course, and does with any other compiler. You can also auto initialize a whole array to one value like thus: int array[20] = { 0 };

Thanx smile.gif

Share this post


Link to post
Share on other sites
Skorpro

Hi,
this time I post a small demonstration how to enter cutscene rooms like Tony's apartment (TBOGT only!) without any trainer(s).
Visit the red X on map and then press "T" to enter.

// Cutscene Room: Tony's apartment by SKORPRO// Thanx to Alexander Blade, sjaak327 and Billsy93#include <natives.h>#include <common.h>#include <strings.h>#include <types.h>#include <consts.h>void main(void){if (GET_CURRENT_EPISODE() == 2) // 2=TBOGT{ Blip CSBlip; Object CSObject; REQUEST_MODEL(0xCFC254FA); while(!HAS_MODEL_LOADED(0xCFC254FA)) { WAIT(0); } // Obj CREATE_OBJECT_NO_OFFSET(0xCFC254FA, -74.3f, -223.7f, 13.6f, &CSObject, 1); // z-1 SET_OBJECT_VISIBLE(CSObject, 0); SET_OBJECT_COLLISION(CSObject, 0); // Blip ADD_BLIP_FOR_OBJECT(CSObject, &CSBlip); CHANGE_BLIP_SPRITE(CSBlip, BLIP_PLAYBOY_X_RED); CHANGE_BLIP_SCALE(CSBlip, 0.5f); CHANGE_BLIP_DISPLAY(CSBlip, 4); SET_BLIP_AS_SHORT_RANGE(CSBlip, 1); CHANGE_BLIP_NAME_FROM_ASCII(CSBlip, "Tony's apartment"); while(TRUE)  // The real script LOOP ! {  if (LOCATE_CHAR_ON_FOOT_3D(GetPlayerPed(), -74.3f, -223.7f, 14.6f, 2.0f, 2.0f, 2.0f, 0))  {   PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", "Press  'T'  to enter Tony's apartment!", 500, 1);   if (IS_GAME_KEYBOARD_KEY_PRESSED(20)) // Press "T"   {    DO_SCREEN_FADE_OUT(1000);    WAIT(1000);    CLEAR_NAMED_CUTSCENE("tony");    SET_PLAYER_CONTROL(GetPlayerIndex(), 1);    SET_CHAR_COORDINATES_NO_OFFSET(GetPlayerPed(), -74.933f, -204.725f, 32.81f);    SET_CHAR_HEADING(GetPlayerPed(), 180.0f);    LOAD_ALL_OBJECTS_NOW();    INIT_CUTSCENE("tony");    WAIT(1200);    SET_CAM_BEHIND_PED(GetPlayerPed());    DO_SCREEN_FADE_IN(1000);   }  }  if (LOCATE_CHAR_ON_FOOT_3D(GetPlayerPed(), -74.549f, -199.814f, 32.809f, 2.0f, 2.0f, 2.0f, 0))  {   FREEZE_CHAR_POSITION(GetPlayerPed(), 1);   DO_SCREEN_FADE_OUT(1000);   WAIT(1000);   CLEAR_NAMED_CUTSCENE("tony");   SET_PLAYER_CONTROL(GetPlayerIndex(), 1);   SET_CHAR_COORDINATES_NO_OFFSET(GetPlayerPed(), -74.213f, -226.05f, 14.652f);   SET_CHAR_HEADING(GetPlayerPed(), 180.0f);   SET_CAM_BEHIND_PED(GetPlayerPed());   WAIT(1200);   FREEZE_CHAR_POSITION(GetPlayerPed(), 0);   DO_SCREEN_FADE_IN(1000);  }  // Wait!  WAIT(0); }}WAIT(0);}

Special thanx to Alexander Blade, sjaak327 and Billsy93cookie.gifcookie.gifcookie.gif

@ALL:
NOTE: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" (in your Readme.txt and/or Topic)! Thanx
smile.gif

Edited by Skorpro

Share this post


Link to post
Share on other sites
Skorpro

Hi modders smile.gif

This time I've made an example "script.img" for all people who want to learn SCO coding smile.gif
The source codes are included...

Please download this Script.IMG example!

If you want to test it first, copy the script.img to your GTA IV folder (eg. "C:\Program Files (x86)\Rockstar Games\Grand Theft Auto IV\common\data\cdimages")
Then remove all your savegames (C:\Users\USERNAME\Documents\Rockstar Games\GTA IV\SGTA*.*)
Now start GTA IV...

IMPORTANT: Don't forget to make backups of your savegames & original script.img!!!





-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-How to use source codes-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-


1. Create in drive "C:\" two folders called "Input" and "Output".
2. Copy the included 5 source files (main.c, ...) into "C:\Input".
3. Copy the included compile.bat to "...\Scocl\bin" (e.g. "C:\Scocl\bin") and start it!
4. Now you will find 5 SCO files in your Output folder.
5. Download and install OpenIV and start it.
6. Open the File menu and choose Create... (or press CTRL+N) then IMG archive, type "script.img" as name and save it. Next press "Yes".
7. Now you get a clean window. Press the green "+" button and choose the 5 compiled SCO files (C:\Output).
8. Open the File menu and choose Rebuild (or press Shift+CTRL+R) and press "Rebuild" then "OK" and "Yes".
9. Close OpenIV.
10. Make a BACKUP of your savegames folder (C:\Users\USERNAME\Documents\Rockstar Games\GTA IV\) then delete all "SGTA... files" (NOT "ControlMap.dat")!
11. Make a BACKUP of the original script.img (eg. in C:\Program Files\Rockstar Games\EFLC\TLAD\common\data\cdimages)!
12. Copy YOUR self-made script.img into the game folder (eg. in C:\Program Files\Rockstar Games\EFLC\TLAD\common\data\cdimages).
13. Start the game -> a new game will starts...

It's a little bit tricky... but if you follow my instruction step by step you will get it rightwink.gif





-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-How to change coords & keys-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-


To change spawn coords open "startup.c". Then edit this lines:

#define PLY_X 2783.87 // x#define PLY_Y 426.42 // y#define PLY_Z 5.82 // z#define PLY_A 45.0 // heading

 

To change keys open "trainer.c". Then edit this lines:

if (IS_GAME_KEYBOARD_KEY_PRESSED(63)) // press F5

to eg. ...

if (IS_GAME_KEYBOARD_KEY_PRESSED(67)) // 67 = F9

and ...

if (IS_GAME_KEYBOARD_KEY_PRESSED(64)) // press F6

to eg. ...

if (IS_GAME_KEYBOARD_KEY_PRESSED(68)) // 68 = F10

To get the right KEY CODES for "IS_GAME_KEYBOARD_KEY_PRESSED" simply use my SCO KeysCodes Tool!






-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-How to add own scripts-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-


Open scriptlauncher.c and search this line...

CheckScript("trainer", FALSE);

...copy and paste it below!
Now change "trainer" to the name of your own SCO script! E.g.:

CheckScript("trainer", FALSE);CheckScript("myfirstmod", FALSE); // for YOUR myfirstmod.sco!

Make a copy of "compile.bat" ("...\Scocl\bin") and rename it to "compile new.bat" and edit it like this:

@echo offclsecho .echo .echo . Compiling NEW script(s) for GTA IV...echo .echo .pausescocl.exe GTAIV "C:\Input\scriptlauncher.c" "C:\Output\" DEBUGOUTPUTscocl.exe GTAIV "C:\Input\myfirstmod.c" "C:\Output\" DEBUGOUTPUTclsecho .echo .echo . READY! Now add the SCOs to script.img!echo .echo .pause

Ok, start "compile new.bat"!
Add the 2 new SCOs to your script.img (see "How to use source codes") alien.gif



That was it for today! Have fun biggrin.gif

Skorpro


NOTE: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" (in your Readme.txt and/or Topic)! Thanx smile.gif

Edited by Skorpro

Share this post


Link to post
Share on other sites
pedro2555

Great content on this topics. I've seen some functions used but not documented, can anyone add those to GTAModding?

 

I've just added something like 50+ native functions documentations, it would be extremely useful if people here do the same.

Share this post


Link to post
Share on other sites
Fastvido

I would like someone to make a mod like this

but more updated and also if they can convert it for the xbox360/ps3 too?

Share this post


Link to post
Share on other sites
lilToki

 

I would like someone to make a mod like this
but more updated and also if they can convert it for the xbox360/ps3 too?

There is a Mod Request Post. Quit spamming the PC forums with your console needs & you already asked this in the console forums suicidal.gif...

Edited by lilToki

Share this post


Link to post
Share on other sites
Michael Wojtanis

@Skorpro

This is possible to check normal functions what is not in missions but in normal game?

 

Share this post


Link to post
Share on other sites
Skorpro

 

@Skorpro

This is possible to check normal functions what is not in missions but in normal game?

I'm sorry but don't understand exactly what you mean!?! (I'm afraid my English is a bit rusty.)

Do you mean hardcoded functions??

 

If you want explain it in Polish (I speak German and a little bit Polish too wink.gif)

 

PS: I like your GTA 5 Weapon HUD in GTA 4 0.905 mod! Very cool idea cookie.gif

Share this post


Link to post
Share on other sites
LordOfTheBongs

thanks for your hard work SkorPro ;)

Share this post


Link to post
Share on other sites
Skorpro

thanks for your hard work SkorPro ;)

You're welcome ch3y... wooops! I mean you're welcome YourGrace ;):D

Share this post


Link to post
Share on other sites
LordOfTheBongs

xD

 

Yeah I finally got a chance to test out your Tony's Apartment code... was very helpful, thanks. Im guessing no collision files were created since it was just meant to be a cutscene but would have been cool if there was a way to load collision in that apartment. Scripthookdotnet has a method to load the environment and I tried to use that instead of just Loading all objects now... the method i described actually calls that native. These are the natives it wraps...

 

REQUEST_COLLISION_AT_POSN

LOAD_ALL_OBJECTS_NOW

LOAD_SCENE
POPULATE_NOW

 

But no dice :/

 

Either way, the Tony's Apt mod taught me a thing or two, thanks for getting back to me with that info ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.