Quantcast

Jump to content

» «
Photo

Miscellaneous SCO Scripts

33 replies to this topic
Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#31

Posted 25 February 2014 - 08:39 PM

REQUEST_COLLISION_AT_POSN

LOAD_ALL_OBJECTS_NOW

LOAD_SCENE
POPULATE_NOW

 

But no dice :/

 

I've tried many natives & methods (originally I wanted to integrate them into my New Safehouses Mod) but to no effect! Cutscene rooms are w/o any collision... :(
 

Nice that you could use somewhat :)


Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#32

Posted 21 June 2014 - 06:44 AM

Hi modders, it's been a looong time...

 

My ParkedCars 2.0 mod is almost finished but now I've got the f*ckin' taxi bug. So I decided to create a new "Traffic Loader" - I know IKT made one but his mod is unstable and crashes the game after ~30 min. Here is a first try in SCO (more stable than ScriptHook ;))...

 

TrafficLoader.h

/***********************************************************************
	SCO Traffic Loader (c) Skorpro

	This mod based on the idea (NOT source!) by IKT!

	Scripted with SCOCL by Alexander Blade!

	Special thanx to IKT, Alexander Blade, ARU and OpenIV Team!

	
	NOTE:	If you want to use/change this script always mention
			Skorpro (me) and IKT in your readme/presentation! Thanx :)

***********************************************************************/

#pragma once

#include "natives.h"
#include "consts.h"
#include "strings.h"
#include "types.h"
#include "consts.h"



// FUNCTIONS	###########################

Player GetPlayerIndex(void)
{
	return GET_PLAYER_ID();
}


Ped GetPlayerPed(void)
{
	Ped playerped = INVALID_HANDLE;
	if ( PLAYER_HAS_CHAR(GetPlayerIndex()) )
		GET_PLAYER_CHAR(GetPlayerIndex(), &playerped);
	return playerped;
}


void LoadModel(uint lModel)
{
	REQUEST_MODEL(lModel);
	while(!HAS_MODEL_LOADED(lModel)) { WAIT(100); }
}


void SkorproPrint(void *printText, uint printTime, bool printWait)
{
	PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", printText, printTime, 1);
	if (printWait == 1) { WAIT(printTime); }
}


void SkorproNumText(int num, float ntx, float nty)
{
	SET_TEXT_BACKGROUND(0);
	SET_TEXT_SCALE(0.27, 0.27);
	SET_TEXT_JUSTIFY(1);
	SET_TEXT_EDGE(1, 0, 0, 0, 255);
	SET_TEXT_FONT(1); // LED
	SET_TEXT_COLOUR(255, 255, 255, 255);
	DISPLAY_TEXT_WITH_NUMBER(ntx, nty, "NUMBER", num);
}


// DEFINITIONS	###########################

#define ply GetPlayerIndex()
#define ich GetPlayerPed()
#define skpp SkorproPrint
#define key IS_GAME_KEYBOARD_KEY_PRESSED
#define skpn SkorproNumText

TrafficLoader.c

/***********************************************************************
	SCO Traffic Loader (c) Skorpro

	This mod based on the idea (NOT source!) by IKT!

	Scripted with SCOCL by Alexander Blade!

	Special thanx to IKT, Alexander Blade, ARU and OpenIV Team!

	
	NOTE:	If you want to use/change this script always mention
			Skorpro (me) and IKT in your readme/presentation! Thanx :)

***********************************************************************/


#include <TrafficLoader.h>


// VARS

int waiting = 15000;		// cycle interval (in ms)
int amount = 10;			// load cars per cycle
int taxiUNLOAD = 1;			// 0=off // 1=Unload // 2=Unload & Suppress T // 3==Unload & Suppress T&P
boolean supOwnCar = 1;		// 0=off // 1=suppress OWN car
boolean mission = 1;		// 0=off // 1=is a mission active disable random cars
boolean speedChk = 1;		// 0=off // 1=Speed Check
int stopTime = 10000;		// random waiting during dead or in mission (in ms)
boolean drunkCam = 1;		// 0=off // 1=on
boolean busOnce = 1;		// 0=off // 1=on (1=Load the BUS as first Model!)
boolean traffic = 0;		// 0=off // 1=Traffic Adjustment

boolean stop = 0;
uint rndListModel = 0;
int allcars = 0;
uint random = 0;
Vehicle currCar;
uint currModel;
boolean rc[150] = { 0 };	// Random Check (für max 150 mögliche Models -> siehe "SkorproCarList")
int rcount = 0;				// Zählt alle "gezogenen"
int rndTemp[50] = { 0 };	// Speichert die aktuell Gezogenen! Nötig für's Löschen!
boolean bLog = 1;			// Log, dass Random für 10 Sekunden gestoppt wird
uint eRoomKey;				// Checkt, ob Player in irgendeinem Raum (...dann nicht RANDOM)
boolean bMission = 0;		// Var für MissionCheck
boolean bCarSlow = 0;		// Var für Car-Slow-Check
float speed = 0.0f;			// Var für Car Speed
boolean areaChk = 1;		// Var für Area-Check
uint mapArea, tmpArea;		// Var für Area
float ax, ay, az;			// Var für Player Area Coords




// FUNCTIONS

void SkorproRandomCars(uint rndLoadModel, boolean delete0_create1)
{
	if (delete0_create1 == 1) LoadModel(rndLoadModel);	// Request Model
	else if (delete0_create1 == 0)
	{
		if (rndLoadModel != MODEL_BUS) 
		{
			MARK_MODEL_AS_NO_LONGER_NEEDED(rndLoadModel);
		}
	}
}


void SkorproKillModels(boolean own_taxi)
{
	if ( (supOwnCar > 0) && (own_taxi == 0) && (IS_CHAR_IN_ANY_CAR(ich)) )
	{  
		GET_CAR_CHAR_IS_USING(ich, &currCar);
		GET_CAR_MODEL(currCar, &currModel);
		SUPPRESS_CAR_MODEL(currModel);
		MARK_MODEL_AS_NO_LONGER_NEEDED(currModel);
	}
	if ( (taxiUNLOAD > 0)  && (own_taxi == 1) )
	{
		MARK_MODEL_AS_NO_LONGER_NEEDED(MODEL_TAXI);
		MARK_MODEL_AS_NO_LONGER_NEEDED(MODEL_TAXI2);
		MARK_MODEL_AS_NO_LONGER_NEEDED(MODEL_CABBY);
		if (taxiUNLOAD > 1)
		{
			SUPPRESS_CAR_MODEL(MODEL_TAXI);
			SUPPRESS_CAR_MODEL(MODEL_TAXI2);
			SUPPRESS_CAR_MODEL(MODEL_CABBY);
			if (taxiUNLOAD > 2)
			{
				SUPPRESS_CAR_MODEL(MODEL_POLICE);
				SUPPRESS_CAR_MODEL(MODEL_POLICE2);
			}
		}
	}
}


boolean SkorproRandomStop(int iALLCARS)
{
	GET_KEY_FOR_CHAR_IN_ROOM(ich, &eRoomKey);

	if (speedChk == 1)
	{
		Vehicle slowCar;

		if (IS_CHAR_IN_ANY_CAR(ich))
		{
			GET_CAR_CHAR_IS_USING(ich, &slowCar);
			GET_CAR_SPEED(slowCar, &speed);

			if (speed < 10.0) bCarSlow = 1;
			else bCarSlow = 0;
		}
	}

	if (mission == 1)
	{
		if ((GET_MISSION_FLAG()) == 1) bMission = 1;
		else bMission = 0;
	}

	// If WANTED(>3), DEAD, NOT EXIST, IN MISSION or IN A BUILDING then STOP RANDOM!
	if ( (IS_WANTED_LEVEL_GREATER(ply, 3) == 1) || (IS_PLAYER_DEAD(ply) == 1) || (DOES_CHAR_EXIST(ich) == 0) || (bMission != 0) || (bCarSlow != 0) || (eRoomKey != 0) ) 
	{
		stop = true;
	}
	else stop = false;

	if (areaChk == 1)
	{
		GET_CHAR_COORDINATES(ich, &ax, &ay, &az);
		mapArea = GET_MAP_AREA_FROM_COORDS(ax, ay, az);
		if (mapArea != tmpArea)
		{
			//SkorproPrint("Area Break!", 3000, 0); // Nur zum testen ;)
			tmpArea = mapArea;
			stop = true;
		}
	}

	return stop;
}


uint SkorproCarList(int carNum)
{
	// GTA IV CARS
	if (carNum == 1) rndListModel = MODEL_ADMIRAL;
	if (carNum == 2) rndListModel = MODEL_BANSHEE;
	if (carNum == 3) rndListModel = MODEL_BENSON;
	if (carNum == 4) rndListModel = MODEL_BIFF;
	if (carNum == 5) rndListModel = MODEL_BLISTA;
	if (carNum == 6) rndListModel = MODEL_BOBCAT;
	if (carNum == 7) rndListModel = MODEL_BOXVILLE;
	if (carNum == 8) rndListModel = MODEL_BUCCANEER;
	if (carNum == 9) rndListModel = MODEL_BURRITO;
	if (carNum == 10) rndListModel = MODEL_AMBULANCE;				// MODEL_BUS soll nur EINMALIG geladen werden
	if (carNum == 11) rndListModel = MODEL_CAVALCADE;
	if (carNum == 12) rndListModel = MODEL_CHAVOS;
	if (carNum == 13) rndListModel = MODEL_COGNOSCENTI;
	if (carNum == 14) rndListModel = MODEL_COMET;
	if (carNum == 15) rndListModel = MODEL_COQUETTE;
	if (carNum == 16) rndListModel = MODEL_DF8;
	if (carNum == 17) rndListModel = MODEL_DILETTANTE;
	if (carNum == 18) rndListModel = MODEL_DUKES;
	if (carNum == 19) rndListModel = MODEL_E109;
	if (carNum == 20) rndListModel = MODEL_EMPEROR;
	if (carNum == 21) rndListModel = MODEL_EMPEROR2;
	if (carNum == 22) rndListModel = MODEL_ESPERANTO;
	if (carNum == 23) rndListModel = MODEL_FACTION;
	if (carNum == 24) rndListModel = MODEL_FELTZER;
	if (carNum == 25) rndListModel = MODEL_FEROCI;
	if (carNum == 26) rndListModel = MODEL_FLATBED;
	if (carNum == 27) rndListModel = MODEL_FORTUNE;
	if (carNum == 28) rndListModel = MODEL_FUTO;
	if (carNum == 29) rndListModel = MODEL_FXT;
	if (carNum == 30) rndListModel = MODEL_HABANERO;
	if (carNum == 31) rndListModel = MODEL_HAKUMAI;
	if (carNum == 32) rndListModel = MODEL_HUNTLEY;
	if (carNum == 33) rndListModel = MODEL_INFERNUS;
	if (carNum == 34) rndListModel = MODEL_INGOT;
	if (carNum == 35) rndListModel = MODEL_INTRUDER;
	if (carNum == 36) rndListModel = MODEL_LANDSTALKER;
	if (carNum == 37) rndListModel = MODEL_LOKUS;
	if (carNum == 38) rndListModel = MODEL_MANANA;
	if (carNum == 39) rndListModel = MODEL_MARBELLA;
	if (carNum == 40) rndListModel = MODEL_MERIT;
	if (carNum == 41) rndListModel = MODEL_MINIVAN;
	if (carNum == 42) rndListModel = MODEL_MOONBEAM;
	if (carNum == 43) rndListModel = MODEL_MRTASTY;
	if (carNum == 44) rndListModel = MODEL_MULE;
	if (carNum == 45) rndListModel = MODEL_ORACLE;
	if (carNum == 46) rndListModel = MODEL_PACKER;
	if (carNum == 47) rndListModel = MODEL_PATRIOT;
	if (carNum == 48) rndListModel = MODEL_PERENNIAL;
	if (carNum == 49) rndListModel = MODEL_PEYOTE;
	if (carNum == 50) rndListModel = MODEL_PHANTOM;
	if (carNum == 51) rndListModel = MODEL_PINNACLE;
	if (carNum == 52) rndListModel = MODEL_PMP600;
	if (carNum == 53) rndListModel = MODEL_PONY;
	if (carNum == 54) rndListModel = MODEL_PREMIER;
	if (carNum == 55) rndListModel = MODEL_PRES;
	if (carNum == 56) rndListModel = MODEL_PRIMO;
	if (carNum == 57) rndListModel = MODEL_RANCHER;
	if (carNum == 58) rndListModel = MODEL_REBLA;
	if (carNum == 59) rndListModel = MODEL_PSTOCKADE;			// BUS war hier DOPPELT!
	if (carNum == 60) rndListModel = MODEL_ROMERO;
	if (carNum == 61) rndListModel = MODEL_ROM;
	if (carNum == 62) rndListModel = MODEL_RUINER;
	if (carNum == 63) rndListModel = MODEL_SABRE;
	if (carNum == 64) rndListModel = MODEL_SABRE2;
	if (carNum == 65) rndListModel = MODEL_SABREGT;
	if (carNum == 66) rndListModel = MODEL_SCHAFTER;
	if (carNum == 67) rndListModel = MODEL_SENTINEL;
	if (carNum == 68) rndListModel = MODEL_SOLAIR;
	if (carNum == 69) rndListModel = MODEL_SPEEDO;
	if (carNum == 70) rndListModel = MODEL_STALION;
	if (carNum == 71) rndListModel = MODEL_STEED;
	if (carNum == 72) rndListModel = MODEL_STOCKADE;
	if (carNum == 73) rndListModel = MODEL_STRATUM;
	if (carNum == 74) rndListModel = MODEL_STRETCH;
	if (carNum == 75) rndListModel = MODEL_SULTAN;
	if (carNum == 76) rndListModel = MODEL_SULTANRS;
	if (carNum == 77) rndListModel = MODEL_SUPERGT;
	if (carNum == 78) rndListModel = MODEL_TRASH;
	if (carNum == 79) rndListModel = MODEL_TURISMO;
	if (carNum == 80) rndListModel = MODEL_URANUS;
	if (carNum == 81) rndListModel = MODEL_VIGERO;
	if (carNum == 82) rndListModel = MODEL_VIGERO2;
	if (carNum == 83) rndListModel = MODEL_VINCENT;
	if (carNum == 84) rndListModel = MODEL_VIRGO;
	if (carNum == 85) rndListModel = MODEL_VOODOO;
	if (carNum == 86) rndListModel = MODEL_WASHINGTON;
	if (carNum == 87) rndListModel = MODEL_WILLARD;
	if (carNum == 88) rndListModel = MODEL_YANKEE;
	// GTA IV BIKES
	if (carNum == 89) rndListModel = MODEL_BOBBER;
	if (carNum == 90) rndListModel = MODEL_FAGGIO;
	if (carNum == 91) rndListModel = MODEL_HELLFURY;
	if (carNum == 92) rndListModel = MODEL_NRG900;
	if (carNum == 93) rndListModel = MODEL_PCJ;
	if (carNum == 94) rndListModel = MODEL_SANCHEZ;
	if (carNum == 95) rndListModel = MODEL_ZOMBIEB;


	// GTA TLAD
	if (GET_CURRENT_EPISODE() == 1)
	{
		if (carNum == 96) rndListModel = MODEL_BATI;
		if (carNum == 97) rndListModel = MODEL_DAEMON;
		if (carNum == 98) rndListModel = MODEL_DOUBLE2;
		if (carNum == 99) rndListModel = MODEL_GBURRITO;
		if (carNum == 100) rndListModel = MODEL_HAKUCHOU2;
		if (carNum == 101) rndListModel = MODEL_INNOVATION;
		if (carNum == 102) rndListModel = MODEL_PACKER2;
		if (carNum == 103) rndListModel = MODEL_REGINA;
		if (carNum == 104) rndListModel = MODEL_RHAPSODY;
		if (carNum == 105) rndListModel = MODEL_TOWTRUCK;
		if (carNum == 106) rndListModel = MODEL_WAYFARER;
		if (carNum == 107) rndListModel = MODEL_YANKEE2;
		if (carNum == 108) rndListModel = MODEL_WOLFSBANE;
		if (carNum == 109) rndListModel = MODEL_HEXER;
		if (carNum == 110) rndListModel = MODEL_LYCAN;
		if (carNum == 111) rndListModel = MODEL_NIGHTBLADE;
		if (carNum == 112) rndListModel = MODEL_REVENANT;
		if (carNum == 113) rndListModel = MODEL_DIABOLUS;
		if (carNum == 114) rndListModel = MODEL_ANGEL;
	}


	// GTA TBOGT
	if (GET_CURRENT_EPISODE() == 2)
	{
		if (carNum == 96) rndListModel = MODEL_AKUMA;
		if (carNum == 97) rndListModel = MODEL_BATI2;
		if (carNum == 98) rndListModel = MODEL_BUFFALO;
		if (carNum == 99) rndListModel = MODEL_BULLET;
		if (carNum == 100) rndListModel = MODEL_DOUBLE;
		if (carNum == 101) rndListModel = MODEL_F620;
		if (carNum == 102) rndListModel = MODEL_SCHAFTER2;
		if (carNum == 103) rndListModel = MODEL_SCHAFTER3;
		if (carNum == 104) rndListModel = MODEL_SERRANO2;
		if (carNum == 105) rndListModel = MODEL_SLAMVAN;
		if (carNum == 106) rndListModel = MODEL_LIMO2;
		if (carNum == 107) rndListModel = MODEL_SUPERD;
		if (carNum == 108) rndListModel = MODEL_TAMPA;
	}

	return rndListModel;
}






// ################################## MAIN ##################################

void main(void)
{
	WAIT(5000);

	// Kill drunken Cam
	if (drunkCam > 0)
	{
		Camera cam;
		GET_ROOT_CAM(&cam);
		SET_DRUNK_CAM(cam, 0.0, 0);
	}

	// Episode and max RND!
	if (GET_CURRENT_EPISODE() == 0) allcars = 95;	// GTA IV
	if (GET_CURRENT_EPISODE() == 1) allcars = 114;	// TLAD
	if (GET_CURRENT_EPISODE() == 2) allcars = 108;	// TBOGT

	// Traffic Adjustment
	if (traffic == 1)
	{
		SET_CAR_DENSITY_MULTIPLIER(1.20);
		SET_PED_DENSITY_MULTIPLIER(1.11);
		SET_RANDOM_CAR_DENSITY_MULTIPLIER(1.25);
		SET_PARKED_CAR_DENSITY_MULTIPLIER(1.0);
	}

	// Einmaliger Bus-Load
	if (busOnce == 1) LoadModel(MODEL_BUS);	// Request Model

	// Area Check
	if (areaChk == 1)
	{
		GET_CHAR_COORDINATES(ich, &ax, &ay, &az);
		tmpArea = GET_MAP_AREA_FROM_COORDS(ax, ay, az);
	}

	// Nur zum testen ;)
	//SkorproPrint("Random Cars START!", 3000, 0); 



	while (true)
	{
		// If WANTED(>3), DEAD, NOT EXIST, IN MISSION or IN A BUILDING then STOP RANDOM!
		if (SkorproRandomStop(allcars) == false)
		{
			// Create Random Cars
			int iRnd;
			for (iRnd = 1; iRnd < amount+1; iRnd++)
			{
				// rc wird genullt, wenn rcount (zählt alle "gezogenen") >= max Anzahle an Models (=allcars) -> also alle durch sind ;)
				if (rcount >= allcars)
				{
					int i;
					for (i = 1; i < allcars+1; i++)
					{
						rc[i] = 0;
					}
					rcount = 0;
				}

				while (true)
				{
					// Random 1 bis allcars
					GENERATE_RANDOM_INT_IN_RANGE(1, allcars, &random);

					// rc prüfen, ob FREI, dann auf 1 setzen, damit nicht wieder gezogen!
					if (rc[random] == 0) 
					{
						rc[random] = 1;
						rcount++;
						break;		// Wenn Platz frei war, dann raus aus while-Schleife!
					}
				}
				// Create RANDOM car
				rndTemp[iRnd] = random;
				SkorproRandomCars(SkorproCarList(random), 1);
			}

			WAIT(waiting);				// Interval per cycle!
			SkorproKillModels(1);		// Kill Taxi
			SkorproKillModels(0);		// Kill own Car

			// Delete Random Cars
			int iDel;
			for (iDel = 1; iDel < amount+1; iDel++)
			{
				SkorproRandomCars(SkorproCarList(rndTemp[iDel]), 0);
				//rndTemp[iDel] = 0;
				WAIT(0);
			}
			bLog = 1;
		}
		else
		{
			if (bLog == 1) 
			{
				//SkorproPrint("Random stopped!", 3000, 0);	// Nur zum testen ;)
				bLog = 0;
			}
			WAIT(stopTime);
		}



		WAIT(10);
	}
}

As distinct from IKT's mod I added a 'area', 'car speed', 'building' and 'on foot' check (all this prevent a game crash). The 'random' and 'vehicle loading' segments were changed too!

 

Note: Some comments are in German, so use google for translation ;)

 

If anyone has improvement suggestions - please give it to me! Thanx :D

  • hardsty1e likes this

Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#33

Posted 3 weeks ago

Hi folks & stef538 (referring to: "SCO Saving Game and Keeping Track")

 

This is an example how to save the game and load missions at start! Do not simply copy and paste it! You must adapt this code to your own.

/*
	SAVE SCRIPT & MISSION LOAD EXAMPLE by Skorpro
	Thanx to Alexander Blade (SCOCL)
*/
#include <natives.h>
#include <common.h>
#include <strings.h>
#include <types.h>
#include <consts.h>


// Vars
#define F1 59
#define PP GetPlayerPed()




// New Funcs
void skpp(char *printText, uint printTime, bool printWait)
{
	PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", printText, printTime, 1);
	if (printWait == 1) { WAIT(printTime); }
}


void LoadScript(char *cName)
{
	if (GET_NUMBER_OF_INSTANCES_OF_STREAMED_SCRIPT(cName) == 0)
	{
		uint uScript;
		if (DOES_SCRIPT_EXIST(cName))
		{
			REQUEST_SCRIPT(cName);
			while (!HAS_SCRIPT_LOADED(cName)) WAIT(0);
			uScript = START_NEW_SCRIPT(cName, 1024);
			MARK_SCRIPT_AS_NO_LONGER_NEEDED(cName);
		}
		else
		{
			skpp("~r~! ERROR !", 2000, 1);
			skpp(cName, 2000, 1);
			skpp("~r~Script NOT found!", 4000, 0);
		}
	}
	else skpp("~r~Script is already running!", 2500, 0);
}


// Main
void main(void)
{
	// BEGIN: main.sco part
	THIS_SCRIPT_SHOULD_BE_SAVED();
	SET_THIS_SCRIPT_CAN_REMOVE_BLIPS_CREATED_BY_ANY_SCRIPT(TRUE);
	SET_CHAR_COORDINATES(PP, 2360.88, 389.94, 6.09); // Airport Coords
	SET_CHAR_HEADING(PP, 90.0);
	LOAD_SCENE(2360.88, 389.94, 6.09);
	SET_CAM_BEHIND_PED(PP);
	SET_PLAYER_CONTROL(GetPlayerIndex(), TRUE);
	RELEASE_WEATHER();
	RELEASE_TIME_OF_DAY();
	SPECIFY_SCRIPT_POPULATION_ZONE_NUM_PEDS(100); 
	SPECIFY_SCRIPT_POPULATION_ZONE_NUM_SCENARIO_PEDS(100);
	ACTIVATE_SCRIPT_POPULATION_ZONE();
	WAIT(2000);
	FORCE_LOADING_SCREEN(FALSE);
	DO_SCREEN_FADE_IN_UNHACKED(4000);
	WAIT(4500);
	// END: main.sco part

	
	
	// Check Mission Status
	uint uStat; // Check your script(s) maybe it's better to set this variable GLOBAL!
	uStat = GET_INT_STAT(253); // C++ -->> STAT_MISSIONS_PASSED = 253 (eIntStatistic) -->> Missions passed
	
	if (uStat == 0)
	{
		skpp("New Game", 3000, 1);
		LoadScript("Mission1"); // Start Mission1.sco
	}
	else if (uStat == 1)
	{
		skpp("Mission 1 passed!", 3000, 1);
		LoadScript("Mission2"); // Start Mission2.sco
	}
	else if (uStat == 2)
	{
		skpp("Mission 2 passed!", 3000, 1);
		LoadScript("Mission3"); // Start Mission3.sco
	}
	//
	// . . . .
	//
	else if (uStat > 2) skpp("Mission NOT found!", 3000, 0);
	


	while (TRUE)
	{
		// Activate Save Menu
		if (IS_GAME_KEYBOARD_KEY_PRESSED(F1)) // Key <F1>
		{
			if (GET_MISSION_FLAG() == 0)
			{
				ACTIVATE_SAVE_MENU();
				WAIT(0);
				if (IS_PLAYER_PLAYING(GetPlayerIndex())) SET_USE_LEG_IK(GetPlayerIndex(), FALSE);
			
				if (DID_SAVE_COMPLETE_SUCCESSFULLY())
				{
					#ifdef DEBUG
					skpp("Game saved!", 3000, 0);
					#endif
				}
				else 
				{
					#ifdef DEBUG
					skpp("Game NOT saved!", 3000, 0);
					#endif
					SET_CAM_BEHIND_PED(PP);
				}
			}
			else skpp("You can't save during a mission!", 2000, 0);
		}
		
		WAIT(100);
	}
}

I prefer to use this script as main.sco but you decide...

 

Have fun :)

  • hardsty1e and stef538 like this

Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#34

Posted 3 weeks ago

Oops! I've forgotten s.t.:

 

After successful mission increase the '253' Stat (+1):

INCREMENT_INT_STAT(253, 1);

Important note:  Always make a backup of your savegames! Playing around with ingame statistics (STAT natives) and save them may damage your savegames!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users