2019-06-12 11:46:02 +00:00
|
|
|
#include "common.h"
|
2020-04-17 13:31:11 +00:00
|
|
|
|
2019-06-12 11:46:02 +00:00
|
|
|
#include "Script.h"
|
2019-07-07 21:32:54 +00:00
|
|
|
#include "ScriptCommands.h"
|
2019-06-12 11:46:02 +00:00
|
|
|
|
2020-04-19 16:34:08 +00:00
|
|
|
#include "AnimBlendAssociation.h"
|
2019-07-14 09:49:03 +00:00
|
|
|
#include "Boat.h"
|
2020-01-03 16:48:13 +00:00
|
|
|
#include "BulletInfo.h"
|
2019-07-03 22:16:24 +00:00
|
|
|
#include "Camera.h"
|
2020-01-03 16:48:13 +00:00
|
|
|
#include "CarAI.h"
|
2019-07-03 22:16:24 +00:00
|
|
|
#include "CarCtrl.h"
|
2019-07-27 18:28:18 +00:00
|
|
|
#include "CarGen.h"
|
2019-07-14 09:49:03 +00:00
|
|
|
#include "CivilianPed.h"
|
2019-07-14 11:49:27 +00:00
|
|
|
#include "Clock.h"
|
2019-07-14 09:49:03 +00:00
|
|
|
#include "CopPed.h"
|
2019-10-21 21:39:59 +00:00
|
|
|
#include "Coronas.h"
|
2019-10-13 11:46:09 +00:00
|
|
|
#include "Cranes.h"
|
2020-02-16 20:08:54 +00:00
|
|
|
#include "Credits.h"
|
2019-10-21 21:39:59 +00:00
|
|
|
#include "CutsceneMgr.h"
|
2020-06-21 10:46:23 +00:00
|
|
|
#include "Debug.h"
|
2019-07-03 22:16:24 +00:00
|
|
|
#include "DMAudio.h"
|
2020-04-19 16:34:08 +00:00
|
|
|
#include "Darkel.h"
|
2019-07-14 09:49:03 +00:00
|
|
|
#include "EmergencyPed.h"
|
2019-10-21 21:39:59 +00:00
|
|
|
#include "Explosion.h"
|
2019-07-07 16:00:02 +00:00
|
|
|
#include "FileMgr.h"
|
2020-04-19 16:34:08 +00:00
|
|
|
#include "Fire.h"
|
2020-02-15 11:53:42 +00:00
|
|
|
#include "Frontend.h"
|
2019-10-21 21:39:59 +00:00
|
|
|
#include "Gangs.h"
|
2019-07-27 18:28:18 +00:00
|
|
|
#include "Garages.h"
|
2019-07-14 09:49:03 +00:00
|
|
|
#include "General.h"
|
2020-05-26 21:25:12 +00:00
|
|
|
#ifdef MISSION_REPLAY
|
|
|
|
#include "GenericGameStorage.h"
|
|
|
|
#endif
|
2019-07-14 11:49:27 +00:00
|
|
|
#include "HandlingMgr.h"
|
2019-10-21 21:39:59 +00:00
|
|
|
#include "Heli.h"
|
2019-07-03 22:16:24 +00:00
|
|
|
#include "Hud.h"
|
2020-02-24 18:17:15 +00:00
|
|
|
#include "Lines.h"
|
2019-07-07 21:05:24 +00:00
|
|
|
#include "Messages.h"
|
2019-07-03 22:16:24 +00:00
|
|
|
#include "ModelIndices.h"
|
2019-07-07 21:05:24 +00:00
|
|
|
#include "Pad.h"
|
2020-02-16 20:08:54 +00:00
|
|
|
#include "Particle.h"
|
2019-10-27 09:51:09 +00:00
|
|
|
#include "ParticleObject.h"
|
2019-10-13 11:46:09 +00:00
|
|
|
#include "PedRoutes.h"
|
2019-10-21 21:39:59 +00:00
|
|
|
#include "Phones.h"
|
2019-07-25 20:34:29 +00:00
|
|
|
#include "Pickups.h"
|
2020-01-03 16:48:13 +00:00
|
|
|
#include "Plane.h"
|
2019-07-03 22:16:24 +00:00
|
|
|
#include "PlayerInfo.h"
|
|
|
|
#include "PlayerPed.h"
|
2019-10-21 21:39:59 +00:00
|
|
|
#include "PointLights.h"
|
2019-07-03 22:16:24 +00:00
|
|
|
#include "Pools.h"
|
|
|
|
#include "Population.h"
|
2020-01-20 16:53:21 +00:00
|
|
|
#include "PowerPoints.h"
|
2019-12-31 23:35:54 +00:00
|
|
|
#include "ProjectileInfo.h"
|
2020-04-19 16:34:08 +00:00
|
|
|
#include "Radar.h"
|
2020-01-03 16:48:13 +00:00
|
|
|
#include "Record.h"
|
2019-07-25 20:34:29 +00:00
|
|
|
#include "Remote.h"
|
2019-07-07 17:57:00 +00:00
|
|
|
#include "Replay.h"
|
2020-04-19 16:34:08 +00:00
|
|
|
#include "Restart.h"
|
2020-02-02 11:47:03 +00:00
|
|
|
#include "RpAnimBlend.h"
|
2020-02-15 11:53:42 +00:00
|
|
|
#include "Rubbish.h"
|
2019-08-03 13:01:13 +00:00
|
|
|
#include "Shadows.h"
|
2020-02-15 11:53:42 +00:00
|
|
|
#include "SpecialFX.h"
|
2019-12-31 23:35:54 +00:00
|
|
|
#include "Stats.h"
|
2019-07-03 22:16:24 +00:00
|
|
|
#include "Streaming.h"
|
2019-07-14 11:49:27 +00:00
|
|
|
#include "Text.h"
|
2020-02-02 11:47:03 +00:00
|
|
|
#include "TxdStore.h"
|
2019-07-03 22:16:24 +00:00
|
|
|
#include "User.h"
|
2019-12-31 23:35:54 +00:00
|
|
|
#include "WaterLevel.h"
|
2019-07-03 22:16:24 +00:00
|
|
|
#include "Weather.h"
|
|
|
|
#include "World.h"
|
2019-07-14 09:49:03 +00:00
|
|
|
#include "Zones.h"
|
2020-04-19 16:34:08 +00:00
|
|
|
#include "main.h"
|
2020-06-21 10:46:23 +00:00
|
|
|
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
|
|
|
#include <stdarg.h>
|
|
|
|
#endif
|
2019-06-20 00:31:03 +00:00
|
|
|
|
2020-01-03 16:48:13 +00:00
|
|
|
#define PICKUP_PLACEMENT_OFFSET 0.5f
|
|
|
|
#define PED_FIND_Z_OFFSET 5.0f
|
|
|
|
|
2020-02-15 11:53:42 +00:00
|
|
|
#define SPHERE_MARKER_R 0
|
|
|
|
#define SPHERE_MARKER_G 128
|
|
|
|
#define SPHERE_MARKER_B 255
|
|
|
|
#define SPHERE_MARKER_A 128
|
|
|
|
#define SPHERE_MARKER_PULSE_PERIOD 2048
|
|
|
|
#define SPHERE_MARKER_PULSE_FRACTION 0.1f
|
|
|
|
|
2020-02-16 20:08:54 +00:00
|
|
|
#ifdef USE_PRECISE_MEASUREMENT_CONVERTION
|
2020-02-22 23:29:38 +00:00
|
|
|
#define METERS_IN_FOOT 0.3048f
|
2020-02-16 20:08:54 +00:00
|
|
|
#define FEET_IN_METER 3.28084f
|
|
|
|
#else
|
2020-02-22 23:29:38 +00:00
|
|
|
#define METERS_IN_FOOT 0.3f
|
2020-02-16 20:08:54 +00:00
|
|
|
#define FEET_IN_METER 3.33f
|
|
|
|
#endif
|
|
|
|
|
2020-04-17 05:54:14 +00:00
|
|
|
uint8 CTheScripts::ScriptSpace[SIZE_SCRIPT_SPACE];
|
|
|
|
CRunningScript CTheScripts::ScriptsArray[MAX_NUM_SCRIPTS];
|
|
|
|
int32 CTheScripts::BaseBriefIdForContact[MAX_NUM_CONTACTS];
|
|
|
|
int32 CTheScripts::OnAMissionForContactFlag[MAX_NUM_CONTACTS];
|
|
|
|
intro_text_line CTheScripts::IntroTextLines[MAX_NUM_INTRO_TEXT_LINES];
|
|
|
|
intro_script_rectangle CTheScripts::IntroRectangles[MAX_NUM_INTRO_RECTANGLES];
|
|
|
|
CSprite2d CTheScripts::ScriptSprites[MAX_NUM_SCRIPT_SRPITES];
|
|
|
|
script_sphere_struct CTheScripts::ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES];
|
|
|
|
tCollectiveData CTheScripts::CollectiveArray[MAX_NUM_COLLECTIVES];
|
|
|
|
tUsedObject CTheScripts::UsedObjectArray[MAX_NUM_USED_OBJECTS];
|
|
|
|
int32 CTheScripts::MultiScriptArray[MAX_NUM_MISSION_SCRIPTS];
|
|
|
|
tBuildingSwap CTheScripts::BuildingSwapArray[MAX_NUM_BUILDING_SWAPS];
|
|
|
|
CEntity* CTheScripts::InvisibilitySettingArray[MAX_NUM_INVISIBILITY_SETTINGS];
|
|
|
|
CStoredLine CTheScripts::aStoredLines[MAX_NUM_STORED_LINES];
|
|
|
|
bool CTheScripts::DbgFlag;
|
|
|
|
uint32 CTheScripts::OnAMissionFlag;
|
|
|
|
int32 CTheScripts::StoreVehicleIndex;
|
|
|
|
bool CTheScripts::StoreVehicleWasRandom;
|
|
|
|
CRunningScript *CTheScripts::pIdleScripts;
|
|
|
|
CRunningScript *CTheScripts::pActiveScripts;
|
|
|
|
uint32 CTheScripts::NextFreeCollectiveIndex;
|
|
|
|
int32 CTheScripts::LastRandomPedId;
|
|
|
|
uint16 CTheScripts::NumberOfUsedObjects;
|
|
|
|
bool CTheScripts::bAlreadyRunningAMissionScript;
|
|
|
|
bool CTheScripts::bUsingAMultiScriptFile;
|
|
|
|
uint16 CTheScripts::NumberOfMissionScripts;
|
|
|
|
uint32 CTheScripts::LargestMissionScriptSize;
|
|
|
|
uint32 CTheScripts::MainScriptSize;
|
|
|
|
uint8 CTheScripts::FailCurrentMission;
|
|
|
|
uint8 CTheScripts::CountdownToMakePlayerUnsafe;
|
|
|
|
uint8 CTheScripts::DelayMakingPlayerUnsafeThisTime;
|
|
|
|
uint16 CTheScripts::NumScriptDebugLines;
|
|
|
|
uint16 CTheScripts::NumberOfIntroRectanglesThisFrame;
|
|
|
|
uint16 CTheScripts::NumberOfIntroTextLinesThisFrame;
|
|
|
|
uint8 CTheScripts::UseTextCommands;
|
|
|
|
CMissionCleanup CTheScripts::MissionCleanup;
|
|
|
|
CUpsideDownCarCheck CTheScripts::UpsideDownCars;
|
|
|
|
CStuckCarCheck CTheScripts::StuckCars;
|
|
|
|
uint16 CTheScripts::CommandsExecuted;
|
|
|
|
uint16 CTheScripts::ScriptsUpdated;
|
|
|
|
int32 ScriptParams[32];
|
2019-07-03 22:16:24 +00:00
|
|
|
|
2020-05-26 21:25:12 +00:00
|
|
|
#ifdef MISSION_REPLAY
|
|
|
|
|
|
|
|
static const char* nonMissionScripts[] = {
|
|
|
|
"copcar",
|
|
|
|
"ambulan",
|
|
|
|
"taxi",
|
|
|
|
"firetru",
|
|
|
|
"rampage",
|
|
|
|
"t4x4_1",
|
|
|
|
"t4x4_2",
|
|
|
|
"t4x4_3",
|
|
|
|
"rc1",
|
|
|
|
"rc2",
|
|
|
|
"rc3",
|
|
|
|
"rc4",
|
|
|
|
"hj",
|
|
|
|
"usj",
|
|
|
|
"mayhem"
|
|
|
|
};
|
|
|
|
|
|
|
|
int AllowMissionReplay;
|
|
|
|
uint32 NextMissionDelay;
|
|
|
|
uint32 MissionStartTime;
|
|
|
|
uint32 WaitForMissionActivate;
|
|
|
|
uint32 WaitForSave;
|
|
|
|
float oldTargetX;
|
|
|
|
float oldTargetY;
|
|
|
|
int missionRetryScriptIndex;
|
|
|
|
bool doingMissionRetry;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2020-06-21 10:46:23 +00:00
|
|
|
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
|
|
|
|
|
|
|
#define REGISTER_COMMAND(command, in, out, cond, ovrd, visual) { command, #command, in, out, cond, ovrd, visual }
|
|
|
|
#define INPUT_ARGUMENTS(...) { __VA_ARGS__ ARGTYPE_NONE }
|
|
|
|
#define OUTPUT_ARGUMENTS(...) { __VA_ARGS__ ARGTYPE_NONE }
|
|
|
|
const tScriptCommandData commands[] = {
|
|
|
|
REGISTER_COMMAND(COMMAND_NOP, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_WAIT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GOTO, INPUT_ARGUMENTS(ARGTYPE_LABEL,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SHAKE_CAM, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_VAR_INT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_VAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_LVAR_INT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_LVAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_VAL_TO_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_VAL_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_VAL_TO_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_VAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_VAL_FROM_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_VAL_FROM_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_VAL_FROM_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_VAL_FROM_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_INT_VAR_BY_VAL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_FLOAT_VAR_BY_VAL, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_INT_LVAR_BY_VAL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_FLOAT_LVAR_BY_VAL, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_INT_VAR_BY_VAL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_FLOAT_VAR_BY_VAL, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_INT_LVAR_BY_VAL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_FLOAT_LVAR_BY_VAL, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_GREATER_THAN_NUMBER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_LVAR_GREATER_THAN_NUMBER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_NUMBER_GREATER_THAN_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_NUMBER_GREATER_THAN_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_GREATER_THAN_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_LVAR_GREATER_THAN_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_GREATER_THAN_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_LVAR_GREATER_THAN_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_GREATER_THAN_NUMBER, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_LVAR_GREATER_THAN_NUMBER, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_NUMBER_GREATER_THAN_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_NUMBER_GREATER_THAN_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_GREATER_THAN_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_LVAR_GREATER_THAN_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_GREATER_THAN_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_LVAR_GREATER_THAN_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >"),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_GREATER_OR_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_LVAR_GREATER_OR_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_NUMBER_GREATER_OR_EQUAL_TO_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_NUMBER_GREATER_OR_EQUAL_TO_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " >="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " =="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_LVAR_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " =="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_EQUAL_TO_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " =="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_LVAR_EQUAL_TO_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " =="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_EQUAL_TO_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " =="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_NOT_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " !="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_LVAR_NOT_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " !="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_NOT_EQUAL_TO_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " !="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_LVAR_NOT_EQUAL_TO_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " !="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_INT_VAR_NOT_EQUAL_TO_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, 0, " !="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " =="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_LVAR_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " =="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_EQUAL_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " =="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_LVAR_EQUAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " =="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_EQUAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " =="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_NOT_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " !="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_LVAR_NOT_EQUAL_TO_NUMBER, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " !="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_NOT_EQUAL_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " !="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_LVAR_NOT_EQUAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " !="),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FLOAT_VAR_NOT_EQUAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, 0, " !="),
|
|
|
|
REGISTER_COMMAND(COMMAND_GOTO_IF_TRUE, INPUT_ARGUMENTS(ARGTYPE_LABEL,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GOTO_IF_FALSE, INPUT_ARGUMENTS(ARGTYPE_LABEL,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_TERMINATE_THIS_SCRIPT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_NEW_SCRIPT, INPUT_ARGUMENTS(ARGTYPE_LABEL,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GOSUB, INPUT_ARGUMENTS(ARGTYPE_LABEL,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RETURN, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LINE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_PLAYER_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_INT_VAR_TO_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_FLOAT_VAR_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_INT_LVAR_TO_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_FLOAT_LVAR_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_INT_VAR_TO_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_FLOAT_VAR_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_INT_LVAR_TO_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_FLOAT_LVAR_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " +="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_INT_VAR_FROM_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_FLOAT_VAR_FROM_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_INT_LVAR_FROM_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_FLOAT_LVAR_FROM_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_INT_VAR_FROM_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_FLOAT_VAR_FROM_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_INT_LVAR_FROM_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_FLOAT_LVAR_FROM_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_INT_VAR_BY_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_FLOAT_VAR_BY_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_INT_LVAR_BY_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_FLOAT_LVAR_BY_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_INT_VAR_BY_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_FLOAT_VAR_BY_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_INT_LVAR_BY_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_MULT_FLOAT_LVAR_BY_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " *="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_INT_VAR_BY_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_FLOAT_VAR_BY_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_INT_LVAR_BY_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_FLOAT_LVAR_BY_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_INT_VAR_BY_INT_LVAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_FLOAT_VAR_BY_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_INT_LVAR_BY_INT_VAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIV_FLOAT_LVAR_BY_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " /="),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_TIMED_VAL_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_TIMED_VAL_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_VAR_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_LVAR_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_LVAR_TO_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_TIMED_FLOAT_VAR_TO_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_TIMED_VAL_FROM_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_TIMED_VAL_FROM_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_TIMED_FLOAT_VAR_FROM_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_VAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUB_TIMED_FLOAT_VAR_FROM_FLOAT_LVAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " -=@"),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_VAR_INT_TO_VAR_INT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_LVAR_INT_TO_LVAR_INT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_VAR_FLOAT_TO_VAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_LVAR_FLOAT_TO_LVAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_VAR_FLOAT_TO_LVAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_LVAR_FLOAT_TO_VAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_VAR_INT_TO_LVAR_INT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_LVAR_INT_TO_VAR_INT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " ="),
|
|
|
|
REGISTER_COMMAND(COMMAND_CSET_VAR_INT_TO_VAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " =#"),
|
|
|
|
REGISTER_COMMAND(COMMAND_CSET_VAR_FLOAT_TO_VAR_INT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " =#"),
|
|
|
|
REGISTER_COMMAND(COMMAND_CSET_LVAR_INT_TO_LVAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " =#"),
|
|
|
|
REGISTER_COMMAND(COMMAND_CSET_LVAR_FLOAT_TO_LVAR_INT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " =#"),
|
|
|
|
REGISTER_COMMAND(COMMAND_CSET_VAR_INT_TO_LVAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " =#"),
|
|
|
|
REGISTER_COMMAND(COMMAND_CSET_VAR_FLOAT_TO_LVAR_INT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " =#"),
|
|
|
|
REGISTER_COMMAND(COMMAND_CSET_LVAR_INT_TO_VAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " =#"),
|
|
|
|
REGISTER_COMMAND(COMMAND_CSET_LVAR_FLOAT_TO_VAR_INT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " =#"),
|
|
|
|
REGISTER_COMMAND(COMMAND_ABS_VAR_INT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " ABS"),
|
|
|
|
REGISTER_COMMAND(COMMAND_ABS_LVAR_INT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, 0, " ABS"),
|
|
|
|
REGISTER_COMMAND(COMMAND_ABS_VAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " ABS"),
|
|
|
|
REGISTER_COMMAND(COMMAND_ABS_VAR_FLOAT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, 0, " ABS"),
|
|
|
|
REGISTER_COMMAND(COMMAND_GENERATE_RANDOM_FLOAT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GENERATE_RANDOM_INT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_PED_HANDLE,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DELETE_CHAR, INPUT_ARGUMENTS(ARGTYPE_PED_HANDLE,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHAR_WANDER_DIR, INPUT_ARGUMENTS(ARGTYPE_PED_HANDLE, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHAR_WANDER_RANGE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHAR_FOLLOW_PATH, INPUT_ARGUMENTS(ARGTYPE_PED_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHAR_SET_IDLE, INPUT_ARGUMENTS(ARGTYPE_PED_HANDLE,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CHAR_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_PED_HANDLE,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_PED_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_STILL_ALIVE, INPUT_ARGUMENTS(ARGTYPE_PED_HANDLE,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_PED_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_PED_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DELETE_CAR, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CAR_GOTO_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CAR_WANDER_RANDOMLY, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CAR_SET_IDLE, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CAR_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_STILL_ALIVE, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_CRUISE_SPEED, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_DRIVING_STYLE, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_MISSION, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_VEHICLE_HANDLE, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SPECIAL_0, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SPECIAL_1, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SPECIAL_2, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SPECIAL_3, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SPECIAL_4, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SPECIAL_5, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SPECIAL_6, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SPECIAL_7, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_BIG, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_NOW, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_SOON, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_PRINTS, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_TIME_OF_DAY, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TIME_OF_DAY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_MINUTES_TO_TIME_OF_DAY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_POINT_ON_SCREEN, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DEBUG_ON, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DEBUG_OFF, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RETURN_TRUE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RETURN_FALSE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_VAR_INT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_VAR_FLOAT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LVAR_INT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LVAR_FLOAT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LBRACKET, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RBRACKET, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REPEAT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ENDREPEAT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IF, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IFNOT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ELSE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ENDIF, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_WHILE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_WHILENOT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ENDWHILE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ANDOR, INPUT_ARGUMENTS(ARGTYPE_ANDOR,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
2020-06-28 08:59:20 +00:00
|
|
|
REGISTER_COMMAND(COMMAND_LAUNCH_MISSION, INPUT_ARGUMENTS(ARGTYPE_LABEL,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
2020-06-21 10:46:23 +00:00
|
|
|
REGISTER_COMMAND(COMMAND_MISSION_HAS_FINISHED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STORE_CAR_CHAR_IS_IN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STORE_CAR_PLAYER_IS_IN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_MODEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_MODEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_ANY_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_ANY_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_BUTTON_PRESSED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_PAD_STATE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ANY_MEANS_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_PLAYER_ANY_MEANS_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_PLAYER_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_PLAYER_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ANY_MEANS_CHAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ON_FOOT_CHAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_IN_CAR_CHAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ANY_MEANS_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_CHAR_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_CHAR_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ANY_MEANS_CHAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ON_FOOT_CHAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_IN_CAR_CHAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ANY_MEANS_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ON_FOOT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_IN_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_PLAYER_ANY_MEANS_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_PLAYER_ON_FOOT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_PLAYER_IN_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ANY_MEANS_CHAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ON_FOOT_CHAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_IN_CAR_CHAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ANY_MEANS_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ON_FOOT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_IN_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_CHAR_ON_FOOT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_CHAR_IN_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ANY_MEANS_CHAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ON_FOOT_CHAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_IN_CAR_CHAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DELETE_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_SCORE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_SCORE_GREATER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STORE_SCORE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GIVE_REMOTE_CONTROLLED_CAR_TO_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ALTER_WANTED_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ALTER_WANTED_LEVEL_NO_DROP, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_WANTED_LEVEL_GREATER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_WANTED_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_DEATHARREST_STATE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_DEATHARREST_BEEN_EXECUTED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_AMMO_TO_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_AMMO_TO_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_AMMO_TO_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STILL_ALIVE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_DEAD, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_DEAD, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_DEAD, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_THREAT_SEARCH, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_THREAT_REACTION, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_NO_OBJ, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ORDER_DRIVER_OUT_OF_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ORDER_CHAR_TO_DRIVE_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_PATROL_POINT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_GANGZONE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_ZONE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_PRESSING_HORN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_CHAR_SPOTTED_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ORDER_CHAR_TO_BACKDOOR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_CHAR_TO_GANG, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_OBJECTIVE_PASSED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_DRIVE_AGGRESSION, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_MAX_DRIVESPEED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_CHAR_INSIDE_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_WARP_PLAYER_FROM_CAR_TO_COORD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MAKE_CHAR_DO_NOTHING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_INVINCIBLE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_INVINCIBLE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_GRAPHIC_TYPE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_GRAPHIC_TYPE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_PLAYER_BEEN_ARRESTED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STOP_CHAR_DRIVING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_KILL_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_FAVOURITE_CAR_MODEL_FOR_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OCCUPATION, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHANGE_CAR_LOCK, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SHAKE_CAM_WITH_POINT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_MODEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_REMAP, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_CAR_JUST_SUNK, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_NO_COLLIDE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_DEAD_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_DEAD_IN_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_TRAILER_ATTACHED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_ON_TRAILER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_CAR_GOT_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PARK, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_PARK_FINISHED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_KILL_ALL_PASSENGERS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_BULLETPROOF, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_FLAMEPROOF, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_ROCKETPROOF, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CARBOMB_ACTIVE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GIVE_CAR_ALARM, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PUT_CAR_ON_TRAILER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_CRUSHED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_GANG_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_CAR_GENERATOR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_CAR_GENERATOR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_PAGER_MESSAGE, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
2020-06-22 11:07:19 +00:00
|
|
|
REGISTER_COMMAND(COMMAND_DISPLAY_ONSCREEN_TIMER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
2020-06-21 10:46:23 +00:00
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_ONSCREEN_TIMER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DISPLAY_ONSCREEN_COUNTER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_ONSCREEN_COUNTER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ZONE_CAR_INFO, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_GANG_ZONE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_ZONE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_DENSITY, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PED_DENSITY, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_POINT_CAMERA_AT_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_POINT_CAMERA_AT_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_POINT_CAMERA_AT_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RESTORE_CAMERA, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SHAKE_PAD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ZONE_PED_INFO, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TIME_SCALE, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_IN_AIR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_FIXED_CAMERA_POSITION, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_POINT_CAMERA_AT_POINT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_CAR_OLD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_CHAR_OLD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_OBJECT_OLD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_BLIP, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHANGE_BLIP_COLOUR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DIM_BLIP, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_COORD_OLD, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHANGE_BLIP_SCALE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_FADING_COLOUR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DO_FADE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_FADING_STATUS, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_HOSPITAL_RESTART, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_POLICE_RESTART, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_OVERRIDE_NEXT_RESTART, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DRAW_SHADOW, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_PLAYER_HEADING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_HEADING, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CHAR_HEADING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_HEADING, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CAR_HEADING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_HEADING, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_OBJECT_HEADING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_OBJECT_HEADING, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_TOUCHING_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_TOUCHING_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_AMMO, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_AMMO, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_AMMO, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_CAMERA_SPLINE, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MOVE_CAMERA_ALONG_SPLINE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CAMERA_POSITION_ALONG_SPLINE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DECLARE_MISSION_FLAG, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DECLARE_MISSION_FLAG_FOR_CONTACT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DECLARE_BASE_BRIEF_ID_FOR_CONTACT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_HEALTH_GREATER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_HEALTH_GREATER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_HEALTH_GREATER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_CONTACT_POINT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_COORD, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHANGE_BLIP_DISPLAY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_ONE_OFF_SOUND, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_CONTINUOUS_SOUND, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_SOUND, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_STUCK_ON_ROOF, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_UPSIDEDOWN_CAR_CHECK, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_UPSIDEDOWN_CAR_CHECK, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_WAIT_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FLEE_ON_FOOT_TILL_SAFE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_GUARD_SPOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_GUARD_AREA, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_WAIT_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_AREA_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_AREA_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_AREA_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_AREA_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_AREA_ON_FOOT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_AREA_IN_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_AREA_ON_FOOT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_AREA_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_AREA_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_STOPPED_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_STOPPED_IN_AREA_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_AREA_ON_FOOT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_AREA_IN_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_STOPPED_IN_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_STOPPED_IN_AREA_IN_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_STOPPED_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_STOPPED_IN_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GIVE_WEAPON_TO_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GIVE_WEAPON_TO_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GIVE_WEAPON_TO_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_CONTROL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FORCE_WEATHER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FORCE_WEATHER_NOW, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RELEASE_WEATHER, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CURRENT_PLAYER_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CURRENT_CHAR_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CURRENT_CAR_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_OBJECT_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_OBJECT_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_GAME_TIMER, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_TURN_CHAR_TO_FACE_COORD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_TURN_PLAYER_TO_FACE_COORD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STORE_WANTED_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_STOPPED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MARK_CHAR_AS_NO_LONGER_NEEDED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MARK_CAR_AS_NO_LONGER_NEEDED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MARK_OBJECT_AS_NO_LONGER_NEEDED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DONT_REMOVE_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DONT_REMOVE_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DONT_REMOVE_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_CHAR_AS_PASSENGER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_KILL_CHAR_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_KILL_CHAR_ANY_MEANS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_KILL_PLAYER_ANY_MEANS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FLEE_CHAR_ON_FOOT_TILL_SAFE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FLEE_PLAYER_ON_FOOT_TILL_SAFE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FLEE_CHAR_ON_FOOT_ALWAYS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FLEE_PLAYER_ON_FOOT_ALWAYS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_GOTO_CHAR_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_GOTO_PLAYER_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_LEAVE_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_ENTER_CAR_AS_PASSENGER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_ENTER_CAR_AS_DRIVER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FOLLOW_CAR_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FIRE_AT_OBJECT_FROM_VEHICLE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_DESTROY_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_DESTROY_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_GOTO_AREA_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_GOTO_AREA_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FOLLOW_CAR_ON_FOOT_WITH_OFFSET, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_GUARD_ATTACK, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_AS_LEADER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_AS_LEADER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LEAVE_GROUP, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FOLLOW_ROUTE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_ROUTE_POINT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_NUMBER_BIG, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_NUMBER, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_NUMBER_NOW, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_NUMBER_SOON, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_ROADS_ON, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_ROADS_OFF, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_NUMBER_OF_PASSENGERS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_MAXIMUM_NUMBER_OF_PASSENGERS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_DENSITY_MULTIPLIER, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_HEAVY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_CHAR_THREAT_SEARCH, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ACTIVATE_CRANE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DEACTIVATE_CRANE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_MAX_WANTED_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SAVE_VAR_INT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SAVE_VAR_FLOAT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_IN_AIR_PROPER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_UPSIDEDOWN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_PLAYER_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CANCEL_OVERRIDE_RESTART, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_POLICE_IGNORE_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_PAGER_MESSAGE_WITH_NUMBER, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_KILL_FRENZY, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_READ_KILL_FRENZY_STATUS, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SQRT, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ANY_MEANS_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ON_FOOT_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_IN_CAR_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ANY_MEANS_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_ON_FOOT_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_PLAYER_IN_CAR_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ANY_MEANS_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ON_FOOT_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_IN_CAR_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ANY_MEANS_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ON_FOOT_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_IN_CAR_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GENERATE_RANDOM_FLOAT_IN_RANGE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GENERATE_RANDOM_INT_IN_RANGE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCK_CAR_DOORS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_EXPLODE_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_EXPLOSION, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_UPRIGHT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_TURN_CHAR_TO_FACE_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_TURN_CHAR_TO_FACE_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_TURN_PLAYER_TO_FACE_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_GOTO_COORD_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_GOTO_COORD_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_PICKUP, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_PICKUP_BEEN_COLLECTED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_PICKUP, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TAXI_LIGHTS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_BIG_Q, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_NUMBER_BIG_Q, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GARAGE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GARAGE_WITH_CAR_MODEL, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TARGET_CAR_FOR_MISSION_GARAGE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_IN_MISSION_GARAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_FREE_BOMBS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_POWERPOINT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ALL_TAXI_LIGHTS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_ARMED_WITH_ANY_BOMB, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_APPLY_BRAKES_TO_PLAYERS_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_HEALTH, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_HEALTH, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_HEALTH, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_PLAYER_HEALTH, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CHAR_HEALTH, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CAR_HEALTH, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_ARMED_WITH_BOMB, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHANGE_CAR_COLOUR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_PED_ROADS_ON, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_PED_ROADS_OFF, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHAR_LOOK_AT_CHAR_ALWAYS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHAR_LOOK_AT_PLAYER_ALWAYS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PLAYER_LOOK_AT_CHAR_ALWAYS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STOP_CHAR_LOOKING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STOP_PLAYER_LOOKING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_HELICOPTER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GANG_ATTITUDE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GANG_GANG_ATTITUDE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GANG_PLAYER_ATTITUDE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GANG_PED_MODELS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GANG_CAR_MODEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GANG_WEAPONS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_RUN_TO_AREA, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_RUN_TO_COORD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_TOUCHING_OBJECT_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_TOUCHING_OBJECT_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_SPECIAL_CHARACTER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_SPECIAL_CHARACTER_LOADED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FLASH_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FLASH_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FLASH_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_REMOTE_MODE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ARM_CAR_WITH_BOMB, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_PERSONALITY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CUTSCENE_OFFSET, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ANIM_GROUP_FOR_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ANIM_GROUP_FOR_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REQUEST_MODEL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_MODEL_LOADED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MARK_MODEL_AS_NO_LONGER_NEEDED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GRAB_PHONE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_REPEATED_PHONE_MESSAGE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PHONE_MESSAGE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_PHONE_DISPLAYED_MESSAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_TURN_PHONE_OFF, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DRAW_CORONA, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DRAW_LIGHT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STORE_WEATHER, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RESTORE_WEATHER, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STORE_CLOCK, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RESTORE_CLOCK, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RESTART_CRITICAL_MISSION, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_PLAYING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_NO_OBJ, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_WAIT_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_FLEE_ON_FOOT_TILL_SAFE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_GUARD_SPOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_GUARD_AREA, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_WAIT_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_KILL_CHAR_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_KILL_PLAYER_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_KILL_CHAR_ANY_MEANS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_KILL_PLAYER_ANY_MEANS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_FLEE_CHAR_ON_FOOT_TILL_SAFE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_FLEE_PLAYER_ON_FOOT_TILL_SAFE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_FLEE_CHAR_ON_FOOT_ALWAYS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_FLEE_PLAYER_ON_FOOT_ALWAYS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_GOTO_CHAR_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_GOTO_PLAYER_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_LEAVE_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_ENTER_CAR_AS_PASSENGER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_ENTER_CAR_AS_DRIVER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_FOLLOW_CAR_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_FIRE_AT_OBJECT_FROM_VEHICLE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_DESTROY_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_DESTROY_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_GOTO_AREA_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_GOTO_AREA_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_FOLLOW_CAR_ON_FOOT_WITH_OFFSET, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_GUARD_ATTACK, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_FOLLOW_ROUTE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_GOTO_COORD_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_GOTO_COORD_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_RUN_TO_AREA, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_RUN_TO_COORD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_PEDS_IN_AREA_TO_COLL, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_PEDS_IN_VEHICLE_TO_COLL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_COLL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_COLL_IN_CARS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_ANY_MEANS_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_COLL_ANY_MEANS_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_COLL_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_STOPPED_COLL_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_ANY_MEANS_CHAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_ON_FOOT_CHAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_IN_CAR_CHAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_ANY_MEANS_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_ON_FOOT_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_IN_CAR_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_ANY_MEANS_PLAYER_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_ON_FOOT_PLAYER_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_COLL_IN_CAR_PLAYER_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_COLL_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_COLL_IN_AREA_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_COLL_IN_AREA_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_COLL_STOPPED_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_COLL_STOPPED_IN_AREA_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_COLL_STOPPED_IN_AREA_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_NUMBER_OF_PEDS_IN_COLL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_HEED_THREATS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_HEED_THREATS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CONTROLLER_MODE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAN_RESPRAY_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_TAXI, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_UNLOAD_SPECIAL_CHARACTER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RESET_NUM_OF_MODELS_KILLED_BY_PLAYER, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_NUM_OF_MODELS_KILLED_BY_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ACTIVATE_GARAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_TAXI_TIMER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_OBJECT_NO_OFFSET, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_BOAT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_GOTO_AREA_ANY_MEANS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_GOTO_AREA_ANY_MEANS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_STOPPED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MESSAGE_WAIT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_PARTICLE_EFFECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_WIDESCREEN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_SPRITE_BLIP_FOR_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_SPRITE_BLIP_FOR_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_SPRITE_BLIP_FOR_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_SPRITE_BLIP_FOR_CONTACT_POINT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_SPRITE_BLIP_FOR_COORD, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_ONLY_DAMAGED_BY_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_ONLY_DAMAGED_BY_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_PROOFS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_PROOFS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_ANGLED_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_ANGLED_AREA_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_ANGLED_AREA_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_ON_FOOT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_IN_CAR_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_ANGLED_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_ANGLED_AREA_ON_FOOT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_ANGLED_AREA_IN_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_ON_FOOT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_IN_CAR_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DEACTIVATE_GARAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_NUMBER_OF_CARS_COLLECTED_BY_GARAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_CAR_BEEN_TAKEN_TO_GARAGE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_SWAT_REQUIRED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_FBI_REQUIRED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ARMY_REQUIRED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_IN_WATER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CLOSEST_CHAR_NODE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CLOSEST_CAR_NODE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CAR_GOTO_COORDINATES_ACCURATE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_PACMAN_RACE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_PACMAN_RECORD, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_NUMBER_OF_POWER_PILLS_EATEN, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_PACMAN, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_PACMAN_SCRAMBLE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_NUMBER_OF_POWER_PILLS_CARRIED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_NUMBER_OF_POWER_PILLS_CARRIED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_ON_SCREEN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_ON_SCREEN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_OBJECT_ON_SCREEN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GOSUB_FILE, INPUT_ARGUMENTS(ARGTYPE_LABEL, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_GROUND_Z_FOR_3D_COORD, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_SCRIPT_FIRE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_SCRIPT_FIRE_EXTINGUISHED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_SCRIPT_FIRE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COMEDY_CONTROLS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_BOAT_GOTO_COORDS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_BOAT_STOP, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_SHOOTING_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_SHOOTING_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CURRENT_PLAYER_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CURRENT_CHAR_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_NUMBER_OF_POWER_PILLS_EATEN, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_POWER_PILL, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_BOAT_CRUISE_SPEED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_RANDOM_CHAR_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_RANDOM_CHAR_IN_ZONE, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_TAXI, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_SHOOTING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_SHOOTING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_MONEY_PICKUP, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_ACCURACY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CAR_SPEED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_CUTSCENE, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_CUTSCENE_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CUTSCENE_ANIM, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_CUTSCENE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CUTSCENE_TIME, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_CUTSCENE_FINISHED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_CUTSCENE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_RESTORE_CAMERA_JUMPCUT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_COLLECTABLE1, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLLECTABLE1_TOTAL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PROJECTILE_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DESTROY_PROJECTILES_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DROP_MINE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DROP_NAUTICAL_MINE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_MODEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_SPECIAL_MODEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_CUTSCENE_HEAD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CUTSCENE_HEAD_ANIM, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SIN, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_COS, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CAR_FORWARD_X, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CAR_FORWARD_Y, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHANGE_GARAGE_TYPE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ACTIVATE_CRUSHER_CRANE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_2_NUMBERS, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_2_NUMBERS_NOW, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_2_NUMBERS_SOON, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_3_NUMBERS, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_3_NUMBERS_NOW, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_3_NUMBERS_SOON, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_4_NUMBERS, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_4_NUMBERS_NOW, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_4_NUMBERS_SOON, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_5_NUMBERS, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_5_NUMBERS_NOW, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_5_NUMBERS_SOON, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_6_NUMBERS, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_6_NUMBERS_NOW, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_6_NUMBERS_SOON, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FOLLOW_CHAR_IN_FORMATION, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PLAYER_MADE_PROGRESS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PROGRESS_TOTAL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_JUMP_DISTANCE, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_JUMP_HEIGHT, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_JUMP_FLIPS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_JUMP_SPINS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_JUMP_STUNT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_UNIQUE_JUMP_FOUND, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_UNIQUE_JUMPS_TOTAL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_PASSENGER_DROPPED_OFF_TAXI, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_MONEY_MADE_TAXI, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_MISSION_GIVEN, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_MISSION_PASSED, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_RUNNING, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_ALL_SCRIPT_FIRES, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FIRST_CAR_COLOUR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_SECOND_CAR_COLOUR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_CHAR_BEEN_DAMAGED_BY_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_CAR_BEEN_DAMAGED_BY_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_CHARS_GROUP, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_PLAYERS_GROUP, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_EXPLODE_CHAR_HEAD, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_EXPLODE_PLAYER_HEAD, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ANCHOR_BOAT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ZONE_GROUP, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_CAR_FIRE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_CHAR_FIRE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_RANDOM_CAR_OF_TYPE_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_RANDOM_CAR_OF_TYPE_IN_ZONE, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_RESPRAY_HAPPENED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAMERA_ZOOM, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_PICKUP_WITH_AMMO, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_RAM_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_BLOCK_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_CATCH_TRAIN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_CATCH_TRAIN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_NEVER_GETS_TIRED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_FAST_RELOAD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_BLEEDING, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_FUNNY_SUSPENSION, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_BIG_WHEELS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_FREE_RESPRAYS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_VISIBLE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_VISIBLE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_VISIBLE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_AREA_OCCUPIED, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_DRUG_RUN, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_DRUG_RUN_BEEN_COMPLETED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_DRUG_PLANE_BEEN_SHOT_DOWN, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SAVE_PLAYER_FROM_FIRES, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DISPLAY_TEXT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_SCALE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_COLOUR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_JUSTIFY, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_CENTRE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_WRAPX, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_CENTRE_SIZE, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_BACKGROUND, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_BACKGROUND_COLOUR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_BACKGROUND_ONLY_TEXT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_PROPORTIONAL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_FONT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_INDUSTRIAL_PASSED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_COMMERCIAL_PASSED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SUBURBAN_PASSED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ROTATE_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SLIDE_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_CHAR_ELEGANTLY, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_STAY_IN_SAME_PLACE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_NASTY_GAME, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_UNDRESS_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DRESS_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_CHASE_SCENE, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STOP_CHASE_SCENE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_EXPLOSION_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_EXPLOSION_IN_ZONE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_DRUG_DROP_OFF, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_DROP_OFF_PLANE_BEEN_SHOT_DOWN, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FIND_DROP_OFF_PLANE_COORDINATES, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_FLOATING_PACKAGE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PLACE_OBJECT_RELATIVE_TO_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MAKE_OBJECT_TARGETTABLE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_ARMOUR_TO_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_ARMOUR_TO_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_OPEN_GARAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLOSE_GARAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_WARP_CHAR_FROM_CAR_TO_COORD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_CHAR_SPOTTED_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_HAIL_TAXI, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_OBJECT_BEEN_DAMAGED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_KILL_FRENZY_HEADSHOT, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ACTIVATE_MILITARY_CRANE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_WARP_PLAYER_INTO_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_WARP_CHAR_INTO_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_CAR_RADIO, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_AUDIO_STREAM, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_2_NUMBERS_BIG, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_3_NUMBERS_BIG, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_4_NUMBERS_BIG, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_5_NUMBERS_BIG, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_WITH_6_NUMBERS_BIG, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_WAIT_STATE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAMERA_BEHIND_PLAYER, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_MOTION_BLUR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_STRING_IN_STRING, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_RANDOM_CHAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_STEAL_ANY_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_2_REPEATED_PHONE_MESSAGES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_2_PHONE_MESSAGES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_3_REPEATED_PHONE_MESSAGES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_3_PHONE_MESSAGES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_4_REPEATED_PHONE_MESSAGES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_4_PHONE_MESSAGES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_SNIPER_BULLET_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GIVE_PLAYER_DETONATOR, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_COLL_OBJ_STEAL_ANY_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_OBJECT_VELOCITY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_OBJECT_COLLISION, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_ICECREAM_JINGLE_ON, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_STRING_IN_STRING_NOW, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_STRING_IN_STRING_SOON, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_5_REPEATED_PHONE_MESSAGES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_5_PHONE_MESSAGES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_6_REPEATED_PHONE_MESSAGES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_6_PHONE_MESSAGES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_POINT_OBSCURED_BY_A_MISSION_ENTITY, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_ALL_MODELS_NOW, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_TO_OBJECT_VELOCITY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DRAW_SPRITE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DRAW_RECT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_SPRITE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_TEXTURE_DICTIONARY, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_TEXTURE_DICTIONARY, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_OBJECT_DYNAMIC, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_ANIM_SPEED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PLAY_MISSION_PASSED_TUNE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_AREA, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FREEZE_ONSCREEN_TIMER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_CAR_SIREN, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_PED_ROADS_ON_ANGLED, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_PED_ROADS_OFF_ANGLED, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_ROADS_ON_ANGLED, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_ROADS_OFF_ANGLED, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_WATERTIGHT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_MOVING_PARTICLE_EFFECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_CANT_BE_DRAGGED_OUT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_TURN_CAR_TO_FACE_COORD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CRANE_LIFTING_CAR, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DRAW_SPHERE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_STATUS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_MALE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SCRIPT_NAME, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CHANGE_GARAGE_TYPE_WITH_CAR_MODEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FIND_DRUG_PLANE_COORDINATES, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SAVE_INT_TO_DEBUG_FILE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SAVE_FLOAT_TO_DEBUG_FILE, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SAVE_NEWLINE_TO_DEBUG_FILE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_POLICE_RADIO_MESSAGE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_STRONG, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_ROUTE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_RUBBISH, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_PARTICLE_EFFECTS_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_STREAMING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_GARAGE_OPEN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_GARAGE_CLOSED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_CATALINA_HELI, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CATALINA_HELI_TAKE_OFF, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_CATALINA_HELI, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_CATALINA_HELI_BEEN_SHOT_DOWN, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWAP_NEAREST_BUILDING_MODEL, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_WORLD_PROCESSING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_ALL_PLAYER_WEAPONS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GRAB_CATALINA_HELI, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_AREA_OF_CARS, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ROTATING_GARAGE_DOOR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_SPHERE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_SPHERE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CATALINA_HELI_FLY_AWAY, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_EVERYONE_IGNORE_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STORE_CAR_CHAR_IS_IN_NO_SAVE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STORE_CAR_PLAYER_IS_IN_NO_SAVE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PHONE_DISPLAYING_MESSAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
2020-06-22 11:07:19 +00:00
|
|
|
REGISTER_COMMAND(COMMAND_DISPLAY_ONSCREEN_TIMER_WITH_STRING, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
2020-06-21 10:46:23 +00:00
|
|
|
REGISTER_COMMAND(COMMAND_DISPLAY_ONSCREEN_COUNTER_WITH_STRING, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_RANDOM_CAR_FOR_CAR_PARK, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_COLLISION_IN_MEMORY, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_WANTED_MULTIPLIER, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAMERA_IN_FRONT_OF_PLAYER, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_VISIBLY_DAMAGED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DOES_OBJECT_EXIST, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_SCENE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_STUCK_CAR_CHECK, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_STUCK_CAR_CHECK, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_STUCK, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_MISSION_AUDIO, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_MISSION_AUDIO_LOADED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PLAY_MISSION_AUDIO, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_MISSION_AUDIO_FINISHED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CLOSEST_CAR_NODE_WITH_HEADING, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_IMPORT_GARAGE_SLOT_BEEN_FILLED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_THIS_PRINT, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_THIS_BIG_PRINT, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_MISSION_AUDIO_POSITION, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ACTIVATE_SAVE_MENU, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_SAVE_GAME_FINISHED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_NO_SPECIAL_CAMERA_FOR_THIS_GARAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_PICKUP_OLD, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_BLIP_FOR_PICKUP, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ADD_SPRITE_BLIP_FOR_PICKUP, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PED_DENSITY_MULTIPLIER, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FORCE_RANDOM_PED_TYPE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_DRAW_BEFORE_FADE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_COLLECTABLE1S_COLLECTED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_EL_BURRO_TIME, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_SPRITES_DRAW_BEFORE_FADE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TEXT_RIGHT_JUSTIFY, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PRINT_HELP, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_HELP, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FLASH_HUD_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FLASH_RADAR_BLIP, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_IN_CONTROL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GENERATE_CARS_AROUND_CAMERA, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_SMALL_PRINTS, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_HAS_MILITARY_CRANE_COLLECTED_ALL_CARS, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_UPSIDEDOWN_CAR_NOT_DAMAGED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CAN_PLAYER_START_MISSION, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MAKE_PLAYER_SAFE_FOR_CUTSCENE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_USE_TEXT_COMMANDS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_THREAT_FOR_PED_TYPE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_THREAT_FOR_PED_TYPE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CAR_COLOURS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ALL_CARS_CAN_BE_DAMAGED, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_CAN_BE_DAMAGED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MAKE_PLAYER_UNSAFE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_COLLISION, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_BODY_CAST_HEALTH, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHARS_CHATTING, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MAKE_PLAYER_SAFE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_STAYS_IN_CURRENT_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_STAYS_IN_CURRENT_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_4X4_ONE_TIME, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_4X4_TWO_TIME, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_4X4_THREE_TIME, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_4X4_MAYHEM_TIME, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_LIFE_SAVED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_CRIMINAL_CAUGHT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_AMBULANCE_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_FIRE_EXTINGUISHED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_TURN_PHONE_ON, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_LONGEST_DODO_FLIGHT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_DEFUSE_BOMB_TIME, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TOTAL_NUMBER_OF_KILL_FRENZIES, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_BLOW_UP_RC_BUGGY, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REMOVE_CAR_FROM_CHASE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_FRENCH_GAME, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_GERMAN_GAME, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_MISSION_AUDIO, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_FADE_IN_AFTER_NEXT_ARREST, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_FADE_IN_AFTER_NEXT_DEATH, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GANG_PED_MODEL_PREFERENCE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_USE_PEDNODE_SEEK, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SWITCH_VEHICLE_WEAPONS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_GET_OUT_OF_JAIL_FREE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_FREE_HEALTH_CARE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_DOOR_CLOSED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_AND_LAUNCH_MISSION, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_AND_LAUNCH_MISSION_INTERNAL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_OBJECT_DRAW_LAST, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_AMMO_IN_PLAYER_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_AMMO_IN_CHAR_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_KILL_FRENZY_PASSED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_SAY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_NEAR_CLIP, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_RADIO_CHANNEL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_OVERRIDE_HOSPITAL_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_OVERRIDE_POLICE_STATION_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FORCE_RAIN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DOES_GARAGE_CONTAIN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_TRACTION, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ARE_MEASUREMENTS_IN_METRES, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CONVERT_METRES_TO_FEET, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MARK_ROADS_BETWEEN_LEVELS, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MARK_PED_ROADS_BETWEEN_LEVELS, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_AVOID_LEVEL_TRANSITIONS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_AVOID_LEVEL_TRANSITIONS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_THREAT_FOR_PED_TYPE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_AREA_OF_CHARS, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_TOTAL_NUMBER_OF_MISSIONS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CONVERT_METRES_TO_FEET_INT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_FASTEST_TIME, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_REGISTER_HIGHEST_SCORE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_WARP_CHAR_INTO_CAR_AS_PASSENGER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CAR_PASSENGER_SEAT_FREE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CHAR_IN_CAR_PASSENGER_SEAT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_IS_CHRIS_CRIMINAL, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_CREDITS, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STOP_CREDITS, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ARE_CREDITS_FINISHED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CREATE_SINGLE_PARTICLE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_IGNORE_LEVEL_TRANSITIONS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CHASE_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_START_BOAT_FOAM_ANIMATION, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_UPDATE_BOAT_FOAM_ANIMATION, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_MUSIC_DOES_FADE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_INTRO_IS_PLAYING, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_PLAYER_HOOKER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PLAY_END_OF_GAME_TUNE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_STOP_END_OF_GAME_TUNE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CAR_MODEL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_SITTING_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_SITTING_IN_ANY_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_SCRIPT_FIRE_AUDIO, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ARE_ANY_CAR_CHEATS_ACTIVATED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_SUFFERS_CRITICAL_HITS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_LIFTING_A_PHONE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_SITTING_IN_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_SITTING_IN_ANY_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_ON_FOOT, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_COLLISION_WITH_SCREEN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_SPLASH_SCREEN, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_IGNORE_LEVEL_TRANSITIONS, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_MAKE_CRAIGS_CAR_A_BIT_STRONGER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_JAMES_CAR_ON_PATH_TO_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOAD_END_OF_GAME_TUNE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ENABLE_PLAYER_CONTROL_CAMERA, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
#ifndef GTA_PS2
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_OBJECT_ROTATION, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_DEBUG_CAMERA_COORDINATES, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_DEBUG_CAMERA_FRONT_VECTOR, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_TARGETTING_ANY_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_TARGETTING_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_TARGETTING_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, INPUT_ARGUMENTS(ARGTYPE_STRING,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DISPLAY_TEXT_WITH_NUMBER, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_STRING, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DISPLAY_TEXT_WITH_2_NUMBERS, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_FAIL_CURRENT_MISSION, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CLOSEST_OBJECT_OF_TYPE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_PLACE_OBJECT_RELATIVE_TO_OBJECT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ALL_OCCUPANTS_OF_CAR_LEAVE_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_INTERPOLATION_PARAMETERS, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CLOSEST_CAR_NODE_WITH_HEADING_TOWARDS_POINT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CLOSEST_CAR_NODE_WITH_HEADING_AWAY_POINT, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_DEBUG_CAMERA_POINT_AT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_ATTACH_CHAR_TO_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_DETACH_CHAR_FROM_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_CHANGE_LANE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_CHAR_LAST_WEAPON_DAMAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CLEAR_CAR_LAST_WEAPON_DAMAGE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_RANDOM_COP_IN_AREA, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_RANDOM_COP_IN_ZONE, INPUT_ARGUMENTS(ARGTYPE_STRING, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CHAR_OBJ_FLEE_CAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_DRIVER_OF_CAR, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_NUMBER_OF_FOLLOWERS, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GIVE_REMOTE_CONTROLLED_MODEL_TO_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CURRENT_PLAYER_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_CURRENT_CHAR_WEAPON, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ANY_MEANS_OBJECT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ON_FOOT_OBJECT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_IN_CAR_OBJECT_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ANY_MEANS_OBJECT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_ON_FOOT_OBJECT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_CHAR_IN_CAR_OBJECT_3D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_HANDBRAKE_TURN_LEFT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_HANDBRAKE_TURN_RIGHT, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_CAR_HANDBRAKE_STOP, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_ON_ANY_BIKE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_SNIPER_BULLET_2D, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_LOCATE_SNIPER_BULLET_3D, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_GET_NUMBER_OF_SEATS_IN_MODEL, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_PLAYER_ON_ANY_BIKE, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_IS_CHAR_LYING_DOWN, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_CAN_CHAR_SEE_DEAD_CHAR, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), true, -1, ""),
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_ENTER_CAR_RANGE_MULTIPLIER, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
#ifndef GTA3_1_1_PATCH
|
|
|
|
REGISTER_COMMAND(COMMAND_SET_THREAT_REACTION_RANGE_MULTIPLIER, INPUT_ARGUMENTS(ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
#undef REGISTER_COMMAND
|
|
|
|
#undef INPUT_ARGUMENTS
|
|
|
|
#undef OUTPUT_ARGUMENTS
|
|
|
|
|
|
|
|
static_assert(ARRAY_SIZE(commands) == LAST_SCRIPT_COMMAND, "commands array not filled");
|
|
|
|
|
|
|
|
#if SCRIPT_LOG_FILE_LEVEL == 1 || SCRIPT_LOG_FILE_LEVEL == 2
|
2020-06-28 08:59:20 +00:00
|
|
|
static FILE* dbg_log;
|
2020-06-21 10:46:23 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
static void PrintToLog(const char* format, ...)
|
|
|
|
{
|
|
|
|
va_list va;
|
|
|
|
va_start(va, format);
|
|
|
|
char tmp[1024];
|
|
|
|
#ifdef _WIN32
|
|
|
|
vsprintf_s(tmp, 1024, format, va);
|
|
|
|
#else
|
2020-06-21 10:51:20 +00:00
|
|
|
vsprintf(tmp, format, va);
|
2020-06-21 10:46:23 +00:00
|
|
|
#endif
|
|
|
|
va_end(va);
|
|
|
|
|
|
|
|
#if SCRIPT_LOG_FILE_LEVEL == 1 || SCRIPT_LOG_FILE_LEVEL == 2
|
2020-07-01 12:12:25 +00:00
|
|
|
if (dbg_log)
|
|
|
|
fwrite(tmp, 1, strlen(tmp), dbg_log);
|
2020-06-21 10:46:23 +00:00
|
|
|
#endif
|
|
|
|
}
|
2020-06-28 08:59:20 +00:00
|
|
|
|
2020-06-21 10:46:23 +00:00
|
|
|
#endif
|
|
|
|
|
2020-06-28 08:59:20 +00:00
|
|
|
static void FlushLog()
|
|
|
|
{
|
|
|
|
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
|
|
|
#if SCRIPT_LOG_FILE_LEVEL == 1 || SCRIPT_LOG_FILE_LEVEL == 2
|
|
|
|
if (dbg_log)
|
|
|
|
fflush(dbg_log);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#define script_assert(_Expression) FlushLog(); assert(_Expression);
|
2020-05-02 22:42:46 +00:00
|
|
|
|
|
|
|
const uint32 CRunningScript::nSaveStructSize =
|
|
|
|
#ifdef COMPATIBLE_SAVES
|
2020-05-11 02:55:57 +00:00
|
|
|
136;
|
2020-05-02 22:42:46 +00:00
|
|
|
#else
|
|
|
|
sizeof(CRunningScript);
|
|
|
|
#endif
|
|
|
|
|
2019-07-03 22:16:24 +00:00
|
|
|
CMissionCleanup::CMissionCleanup()
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMissionCleanup::Init()
|
|
|
|
{
|
2019-07-20 13:30:11 +00:00
|
|
|
m_nCount = 0;
|
2019-07-03 22:16:24 +00:00
|
|
|
for (int i = 0; i < MAX_CLEANUP; i++){
|
|
|
|
m_sEntities[i].type = CLEANUP_UNUSED;
|
|
|
|
m_sEntities[i].id = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CMissionCleanupEntity* CMissionCleanup::FindFree()
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_CLEANUP; i++){
|
|
|
|
if (m_sEntities[i].type == CLEANUP_UNUSED)
|
|
|
|
return &m_sEntities[i];
|
|
|
|
}
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-07-03 22:16:24 +00:00
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMissionCleanup::AddEntityToList(int32 id, uint8 type)
|
|
|
|
{
|
|
|
|
CMissionCleanupEntity* pNew = FindFree();
|
|
|
|
if (!pNew)
|
|
|
|
return;
|
|
|
|
pNew->id = id;
|
|
|
|
pNew->type = type;
|
2019-07-20 13:30:11 +00:00
|
|
|
m_nCount++;
|
2019-07-03 22:16:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CMissionCleanup::RemoveEntityFromList(int32 id, uint8 type)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_CLEANUP; i++){
|
2019-07-09 20:38:05 +00:00
|
|
|
if (m_sEntities[i].type == type && m_sEntities[i].id == id){
|
2019-07-03 22:16:24 +00:00
|
|
|
m_sEntities[i].id = 0;
|
|
|
|
m_sEntities[i].type = CLEANUP_UNUSED;
|
2019-07-20 13:30:11 +00:00
|
|
|
m_nCount--;
|
2019-07-03 22:16:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMissionCleanup::Process()
|
|
|
|
{
|
|
|
|
CPopulation::m_AllRandomPedsThisType = -1;
|
|
|
|
CPopulation::PedDensityMultiplier = 1.0f;
|
2020-02-25 19:01:56 +00:00
|
|
|
CCarCtrl::CarDensityMultiplier = 1.0f;
|
2019-07-03 22:16:24 +00:00
|
|
|
FindPlayerPed()->m_pWanted->m_fCrimeSensitivity = 1.0f;
|
|
|
|
TheCamera.Restore();
|
2019-10-05 23:41:35 +00:00
|
|
|
TheCamera.SetWideScreenOff();
|
2019-07-03 22:16:24 +00:00
|
|
|
DMAudio.ClearMissionAudio();
|
|
|
|
CWeather::ReleaseWeather();
|
|
|
|
for (int i = 0; i < NUM_OF_SPECIAL_CHARS; i++)
|
|
|
|
CStreaming::SetMissionDoesntRequireSpecialChar(i);
|
|
|
|
for (int i = 0; i < NUM_OF_CUTSCENE_OBJECTS; i++)
|
|
|
|
CStreaming::SetMissionDoesntRequireModel(MI_CUTOBJ01 + i);
|
|
|
|
CStreaming::ms_disableStreaming = false;
|
|
|
|
CHud::m_ItemToFlash = -1;
|
|
|
|
CHud::SetHelpMessage(nil, false);
|
|
|
|
CUserDisplay::OnscnTimer.m_bDisabled = false;
|
2019-07-12 16:01:22 +00:00
|
|
|
CWorld::Players[0].m_pPed->m_pWanted->m_bIgnoredByCops = false;
|
|
|
|
CWorld::Players[0].m_pPed->m_pWanted->m_bIgnoredByEveryone = false;
|
2019-07-03 22:16:24 +00:00
|
|
|
CWorld::Players[0].MakePlayerSafe(false);
|
|
|
|
CTheScripts::StoreVehicleIndex = -1;
|
|
|
|
CTheScripts::StoreVehicleWasRandom = true;
|
|
|
|
CTheScripts::UpsideDownCars.Init();
|
|
|
|
CTheScripts::StuckCars.Init();
|
|
|
|
for (int i = 0; i < MAX_CLEANUP; i++){
|
|
|
|
if (m_sEntities[i].type == CLEANUP_UNUSED)
|
|
|
|
continue;
|
|
|
|
switch (m_sEntities[i].type) {
|
|
|
|
case CLEANUP_CAR:
|
|
|
|
{
|
|
|
|
CVehicle* v = CPools::GetVehiclePool()->GetAt(m_sEntities[i].id);
|
|
|
|
if (v)
|
|
|
|
CTheScripts::CleanUpThisVehicle(v);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CLEANUP_CHAR:
|
|
|
|
{
|
|
|
|
CPed* p = CPools::GetPedPool()->GetAt(m_sEntities[i].id);
|
|
|
|
if (p)
|
|
|
|
CTheScripts::CleanUpThisPed(p);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CLEANUP_OBJECT:
|
|
|
|
{
|
|
|
|
CObject* o = CPools::GetObjectPool()->GetAt(m_sEntities[i].id);
|
|
|
|
if (o)
|
|
|
|
CTheScripts::CleanUpThisObject(o);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2019-07-25 20:34:29 +00:00
|
|
|
m_sEntities[i].id = 0;
|
|
|
|
m_sEntities[i].type = CLEANUP_UNUSED;
|
|
|
|
m_nCount--;
|
2019-07-03 22:16:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-06 15:06:08 +00:00
|
|
|
/* NB: CUpsideDownCarCheck is not used by actual script at all
|
|
|
|
* It has a weird usage: AreAnyCarsUpsideDown would fail any mission
|
|
|
|
* just like death or arrest. */
|
|
|
|
|
2019-07-03 22:16:24 +00:00
|
|
|
void CUpsideDownCarCheck::Init()
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
|
|
|
|
m_sCars[i].m_nVehicleIndex = -1;
|
2019-11-09 15:17:54 +00:00
|
|
|
m_sCars[i].m_nUpsideDownTimer = 0;
|
2019-07-03 22:16:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-06 15:06:08 +00:00
|
|
|
bool CUpsideDownCarCheck::IsCarUpsideDown(int32 id)
|
|
|
|
{
|
|
|
|
CVehicle* v = CPools::GetVehiclePool()->GetAt(id);
|
2019-07-07 09:13:12 +00:00
|
|
|
return v->GetUp().z <= -0.97f &&
|
2019-07-06 15:06:08 +00:00
|
|
|
v->GetMoveSpeed().Magnitude() < 0.01f &&
|
|
|
|
v->GetTurnSpeed().Magnitude() < 0.02f;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CUpsideDownCarCheck::UpdateTimers()
|
|
|
|
{
|
2019-07-07 08:16:16 +00:00
|
|
|
uint32 timeStep = CTimer::GetTimeStepInMilliseconds();
|
2019-07-06 15:06:08 +00:00
|
|
|
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
|
|
|
|
CVehicle* v = CPools::GetVehiclePool()->GetAt(m_sCars[i].m_nVehicleIndex);
|
|
|
|
if (v){
|
|
|
|
if (IsCarUpsideDown(m_sCars[i].m_nVehicleIndex))
|
|
|
|
m_sCars[i].m_nUpsideDownTimer += timeStep;
|
|
|
|
else
|
|
|
|
m_sCars[i].m_nUpsideDownTimer = 0;
|
|
|
|
}else{
|
|
|
|
m_sCars[i].m_nVehicleIndex = -1;
|
|
|
|
m_sCars[i].m_nUpsideDownTimer = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CUpsideDownCarCheck::AreAnyCarsUpsideDown()
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
|
|
|
|
if (m_sCars[i].m_nVehicleIndex >= 0 && m_sCars[i].m_nUpsideDownTimer > 1000)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CUpsideDownCarCheck::AddCarToCheck(int32 id)
|
|
|
|
{
|
|
|
|
uint16 index = 0;
|
|
|
|
while (index < MAX_UPSIDEDOWN_CAR_CHECKS && m_sCars[index].m_nVehicleIndex >= 0)
|
|
|
|
index++;
|
|
|
|
if (index >= MAX_UPSIDEDOWN_CAR_CHECKS)
|
|
|
|
return;
|
|
|
|
m_sCars[index].m_nVehicleIndex = id;
|
|
|
|
m_sCars[index].m_nUpsideDownTimer = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CUpsideDownCarCheck::RemoveCarFromCheck(int32 id)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
|
|
|
|
if (m_sCars[i].m_nVehicleIndex == id){
|
|
|
|
m_sCars[i].m_nVehicleIndex = -1;
|
|
|
|
m_sCars[i].m_nUpsideDownTimer = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CUpsideDownCarCheck::HasCarBeenUpsideDownForAWhile(int32 id)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
|
|
|
|
if (m_sCars[i].m_nVehicleIndex == id)
|
|
|
|
return m_sCars[i].m_nUpsideDownTimer > 1000;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-04-09 03:20:44 +00:00
|
|
|
void stuck_car_data::Reset()
|
2019-07-06 15:06:08 +00:00
|
|
|
{
|
|
|
|
m_nVehicleIndex = -1;
|
|
|
|
m_vecPos = CVector(-5000.0f, -5000.0f, -5000.0f);
|
|
|
|
m_nLastCheck = -1;
|
|
|
|
m_fRadius = 0.0f;
|
|
|
|
m_nStuckTime = 0;
|
|
|
|
m_bStuck = false;
|
|
|
|
}
|
|
|
|
|
2019-07-03 22:16:24 +00:00
|
|
|
void CStuckCarCheck::Init()
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_STUCK_CAR_CHECKS; i++) {
|
2019-07-06 15:06:08 +00:00
|
|
|
m_sCars[i].Reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStuckCarCheck::Process()
|
|
|
|
{
|
|
|
|
uint32 timer = CTimer::GetTimeInMilliseconds();
|
|
|
|
for (int i = 0; i < MAX_STUCK_CAR_CHECKS; i++){
|
|
|
|
if (m_sCars[i].m_nVehicleIndex < 0)
|
|
|
|
continue;
|
|
|
|
if (timer <= m_sCars[i].m_nStuckTime + m_sCars[i].m_nLastCheck)
|
|
|
|
continue;
|
|
|
|
CVehicle* pv = CPools::GetVehiclePool()->GetAt(m_sCars[i].m_nVehicleIndex);
|
|
|
|
if (!pv){
|
|
|
|
m_sCars[i].Reset();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
float distance = (pv->GetPosition() - m_sCars[i].m_vecPos).Magnitude();
|
|
|
|
m_sCars[i].m_bStuck = distance < m_sCars[i].m_fRadius;
|
|
|
|
m_sCars[i].m_vecPos = pv->GetPosition();
|
|
|
|
m_sCars[i].m_nLastCheck = timer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStuckCarCheck::AddCarToCheck(int32 id, float radius, uint32 time)
|
|
|
|
{
|
|
|
|
CVehicle* pv = CPools::GetVehiclePool()->GetAt(id);
|
|
|
|
if (!pv)
|
|
|
|
return;
|
|
|
|
int index = 0;
|
|
|
|
while (index < MAX_STUCK_CAR_CHECKS && m_sCars[index].m_nVehicleIndex >= 0)
|
|
|
|
index++;
|
|
|
|
/* Would be nice to return if index >= MAX_STUCK_CAR_CHECKS... */
|
|
|
|
m_sCars[index].m_nVehicleIndex = id;
|
|
|
|
m_sCars[index].m_vecPos = pv->GetPosition();
|
|
|
|
m_sCars[index].m_nLastCheck = CTimer::GetTimeInMilliseconds();
|
|
|
|
m_sCars[index].m_fRadius = radius;
|
|
|
|
m_sCars[index].m_nStuckTime = time;
|
|
|
|
m_sCars[index].m_bStuck = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStuckCarCheck::RemoveCarFromCheck(int32 id)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_STUCK_CAR_CHECKS; i++){
|
|
|
|
if (m_sCars[i].m_nVehicleIndex == id){
|
|
|
|
m_sCars[i].Reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CStuckCarCheck::HasCarBeenStuckForAWhile(int32 id)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_STUCK_CAR_CHECKS; i++){
|
|
|
|
if (m_sCars[i].m_nVehicleIndex == id)
|
|
|
|
return m_sCars[i].m_bStuck;
|
2019-07-03 22:16:24 +00:00
|
|
|
}
|
2019-07-06 15:06:08 +00:00
|
|
|
return false;
|
2019-07-03 22:16:24 +00:00
|
|
|
}
|
|
|
|
|
2019-07-07 16:00:02 +00:00
|
|
|
void CRunningScript::CollectParameters(uint32* pIp, int16 total)
|
|
|
|
{
|
|
|
|
for (int16 i = 0; i < total; i++){
|
|
|
|
float tmp;
|
2020-03-01 14:42:47 +00:00
|
|
|
uint16 varIndex;
|
|
|
|
switch (CTheScripts::Read1ByteFromScript(pIp))
|
2019-07-07 16:00:02 +00:00
|
|
|
{
|
|
|
|
case ARGUMENT_INT32:
|
2020-03-01 14:42:47 +00:00
|
|
|
ScriptParams[i] = CTheScripts::Read4BytesFromScript(pIp);
|
2019-07-07 16:00:02 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_GLOBALVAR:
|
2020-03-01 14:42:47 +00:00
|
|
|
varIndex = CTheScripts::Read2BytesFromScript(pIp);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(varIndex >= 8 && varIndex < CTheScripts::GetSizeOfVariableSpace());
|
2020-03-01 14:42:47 +00:00
|
|
|
ScriptParams[i] = *((int32*)&CTheScripts::ScriptSpace[varIndex]);
|
2019-07-07 16:00:02 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_LOCALVAR:
|
2020-03-01 14:42:47 +00:00
|
|
|
varIndex = CTheScripts::Read2BytesFromScript(pIp);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(varIndex >= 0 && varIndex < ARRAY_SIZE(m_anLocalVariables));
|
2020-03-01 14:42:47 +00:00
|
|
|
ScriptParams[i] = m_anLocalVariables[varIndex];
|
2019-07-07 16:00:02 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_INT8:
|
2020-03-01 14:42:47 +00:00
|
|
|
ScriptParams[i] = CTheScripts::Read1ByteFromScript(pIp);
|
2019-07-07 16:00:02 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_INT16:
|
2020-03-01 14:42:47 +00:00
|
|
|
ScriptParams[i] = CTheScripts::Read2BytesFromScript(pIp);
|
2019-07-07 16:00:02 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_FLOAT:
|
2020-03-01 14:42:47 +00:00
|
|
|
tmp = CTheScripts::ReadFloatFromScript(pIp);
|
2019-07-07 16:00:02 +00:00
|
|
|
ScriptParams[i] = *(int32*)&tmp;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-07-07 16:00:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-21 10:46:23 +00:00
|
|
|
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
|
|
|
int CRunningScript::CollectParameterForDebug(char* buf, bool& var)
|
|
|
|
{
|
|
|
|
float tmp;
|
|
|
|
uint16 varIndex;
|
|
|
|
char tmpstr[24];
|
|
|
|
var = false;
|
|
|
|
switch (CTheScripts::Read1ByteFromScript(&m_nIp))
|
|
|
|
{
|
|
|
|
case ARGUMENT_INT32:
|
|
|
|
return CTheScripts::Read4BytesFromScript(&m_nIp);
|
|
|
|
case ARGUMENT_GLOBALVAR:
|
|
|
|
varIndex = CTheScripts::Read2BytesFromScript(&m_nIp);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(varIndex >= 8 && varIndex < CTheScripts::GetSizeOfVariableSpace());
|
2020-06-21 10:46:23 +00:00
|
|
|
var = true;
|
|
|
|
sprintf(tmpstr, " $%d", varIndex / 4);
|
|
|
|
strcat(buf, tmpstr);
|
|
|
|
return *((int32*)&CTheScripts::ScriptSpace[varIndex]);
|
|
|
|
case ARGUMENT_LOCALVAR:
|
|
|
|
varIndex = CTheScripts::Read2BytesFromScript(&m_nIp);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(varIndex >= 0 && varIndex < ARRAY_SIZE(m_anLocalVariables));
|
2020-06-21 10:46:23 +00:00
|
|
|
var = true;
|
|
|
|
sprintf(tmpstr, " %d@", varIndex);
|
|
|
|
strcat(buf, tmpstr);
|
|
|
|
return m_anLocalVariables[varIndex];
|
|
|
|
case ARGUMENT_INT8:
|
|
|
|
return CTheScripts::Read1ByteFromScript(&m_nIp);
|
|
|
|
case ARGUMENT_INT16:
|
|
|
|
return CTheScripts::Read2BytesFromScript(&m_nIp);
|
|
|
|
case ARGUMENT_FLOAT:
|
|
|
|
tmp = CTheScripts::ReadFloatFromScript(&m_nIp);
|
|
|
|
return *(int32*)&tmp;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
PrintToLog("%s - script assertion failed in CollectParameterForDebug", buf);
|
|
|
|
script_assert(0);
|
2020-06-21 10:46:23 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::GetStoredParameterForDebug(char* buf)
|
|
|
|
{
|
|
|
|
uint16 varIndex;
|
|
|
|
char tmpstr[24];
|
|
|
|
switch (CTheScripts::Read1ByteFromScript(&m_nIp)) {
|
|
|
|
case ARGUMENT_GLOBALVAR:
|
|
|
|
varIndex = CTheScripts::Read2BytesFromScript(&m_nIp);
|
|
|
|
sprintf(tmpstr, " $%d", varIndex / 4);
|
|
|
|
strcat(buf, tmpstr);
|
|
|
|
break;
|
|
|
|
case ARGUMENT_LOCALVAR:
|
|
|
|
varIndex = CTheScripts::Read2BytesFromScript(&m_nIp);
|
|
|
|
sprintf(tmpstr, " %d@", varIndex);
|
|
|
|
strcat(buf, tmpstr);
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
PrintToLog("%s - script_assertion failed in GetStoredParameterForDebug", buf);
|
|
|
|
script_assert(0);
|
2020-06-21 10:46:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-07-07 16:00:02 +00:00
|
|
|
int32 CRunningScript::CollectNextParameterWithoutIncreasingPC(uint32 ip)
|
|
|
|
{
|
|
|
|
uint32* pIp = &ip;
|
|
|
|
float tmp;
|
2020-03-01 14:42:47 +00:00
|
|
|
switch (CTheScripts::Read1ByteFromScript(pIp))
|
2019-07-07 16:00:02 +00:00
|
|
|
{
|
|
|
|
case ARGUMENT_INT32:
|
2020-03-01 14:42:47 +00:00
|
|
|
return CTheScripts::Read4BytesFromScript(pIp);
|
2019-07-07 16:00:02 +00:00
|
|
|
case ARGUMENT_GLOBALVAR:
|
2020-03-01 14:42:47 +00:00
|
|
|
return *((int32*)&CTheScripts::ScriptSpace[CTheScripts::Read2BytesFromScript(pIp)]);
|
2019-07-07 16:00:02 +00:00
|
|
|
case ARGUMENT_LOCALVAR:
|
2020-03-01 14:42:47 +00:00
|
|
|
return m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)];
|
2019-07-07 16:00:02 +00:00
|
|
|
case ARGUMENT_INT8:
|
2020-03-01 14:42:47 +00:00
|
|
|
return CTheScripts::Read1ByteFromScript(pIp);
|
2019-07-07 16:00:02 +00:00
|
|
|
case ARGUMENT_INT16:
|
2020-03-01 14:42:47 +00:00
|
|
|
return CTheScripts::Read2BytesFromScript(pIp);
|
2019-07-07 16:00:02 +00:00
|
|
|
case ARGUMENT_FLOAT:
|
2020-03-01 14:42:47 +00:00
|
|
|
tmp = CTheScripts::ReadFloatFromScript(pIp);
|
2019-07-07 16:00:02 +00:00
|
|
|
return *(int32*)&tmp;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-07-07 16:00:02 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::StoreParameters(uint32* pIp, int16 number)
|
|
|
|
{
|
|
|
|
for (int16 i = 0; i < number; i++){
|
2020-03-01 14:42:47 +00:00
|
|
|
switch (CTheScripts::Read1ByteFromScript(pIp)) {
|
2019-07-07 16:00:02 +00:00
|
|
|
case ARGUMENT_GLOBALVAR:
|
2020-03-01 14:42:47 +00:00
|
|
|
*(int32*)&CTheScripts::ScriptSpace[CTheScripts::Read2BytesFromScript(pIp)] = ScriptParams[i];
|
2019-07-07 16:00:02 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_LOCALVAR:
|
2020-03-01 14:42:47 +00:00
|
|
|
m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)] = ScriptParams[i];
|
2019-07-07 16:00:02 +00:00
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-07-07 16:00:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int32 *CRunningScript::GetPointerToScriptVariable(uint32* pIp, int16 type)
|
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
switch (CTheScripts::Read1ByteFromScript(pIp))
|
2019-07-07 16:00:02 +00:00
|
|
|
{
|
|
|
|
case ARGUMENT_GLOBALVAR:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(type == VAR_GLOBAL);
|
2020-03-01 14:42:47 +00:00
|
|
|
return (int32*)&CTheScripts::ScriptSpace[CTheScripts::Read2BytesFromScript(pIp)];
|
2019-07-07 16:00:02 +00:00
|
|
|
case ARGUMENT_LOCALVAR:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(type == VAR_LOCAL);
|
2020-03-01 14:42:47 +00:00
|
|
|
return &m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)];
|
2019-07-07 16:00:02 +00:00
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-07-07 16:00:02 +00:00
|
|
|
}
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::Init()
|
|
|
|
{
|
|
|
|
strcpy(m_abScriptName, "noname");
|
|
|
|
next = prev = nil;
|
2020-02-23 10:12:44 +00:00
|
|
|
SetIP(0);
|
2019-07-07 16:00:02 +00:00
|
|
|
for (int i = 0; i < MAX_STACK_DEPTH; i++)
|
|
|
|
m_anStack[i] = 0;
|
|
|
|
m_nStackPointer = 0;
|
|
|
|
m_nWakeTime = 0;
|
|
|
|
m_bCondResult = false;
|
2019-07-07 21:05:24 +00:00
|
|
|
m_bIsMissionScript = false;
|
2019-07-07 16:00:02 +00:00
|
|
|
m_bSkipWakeTime = false;
|
|
|
|
for (int i = 0; i < NUM_LOCAL_VARS + NUM_TIMERS; i++)
|
|
|
|
m_anLocalVariables[i] = 0;
|
|
|
|
m_nAndOrState = 0;
|
|
|
|
m_bNotFlag = false;
|
2019-07-25 20:34:29 +00:00
|
|
|
m_bDeatharrestEnabled = true;
|
|
|
|
m_bDeatharrestExecuted = false;
|
2019-07-07 16:00:02 +00:00
|
|
|
m_bMissionFlag = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef USE_DEBUG_SCRIPT_LOADER
|
2020-05-28 09:46:51 +00:00
|
|
|
int scriptToLoad = 0;
|
|
|
|
|
2020-05-28 00:07:26 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include <Windows.h>
|
|
|
|
#endif
|
2019-07-07 16:00:02 +00:00
|
|
|
int open_script()
|
|
|
|
{
|
2020-05-28 09:46:51 +00:00
|
|
|
// glfwGetKey doesn't work because of CGame::Initialise is blocking
|
2020-05-11 02:55:57 +00:00
|
|
|
#ifdef _WIN32
|
2019-07-07 16:00:02 +00:00
|
|
|
if (GetAsyncKeyState('G') & 0x8000)
|
|
|
|
scriptToLoad = 0;
|
|
|
|
if (GetAsyncKeyState('R') & 0x8000)
|
|
|
|
scriptToLoad = 1;
|
|
|
|
if (GetAsyncKeyState('D') & 0x8000)
|
|
|
|
scriptToLoad = 2;
|
2020-05-11 02:55:57 +00:00
|
|
|
#endif
|
2019-07-07 16:00:02 +00:00
|
|
|
switch (scriptToLoad) {
|
|
|
|
case 0: return CFileMgr::OpenFile("main.scm", "rb");
|
|
|
|
case 1: return CFileMgr::OpenFile("main_freeroam.scm", "rb");
|
|
|
|
case 2: return CFileMgr::OpenFile("main_d.scm", "rb");
|
|
|
|
}
|
|
|
|
return CFileMgr::OpenFile("main.scm", "rb");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void CTheScripts::Init()
|
|
|
|
{
|
|
|
|
for (int i = 0; i < SIZE_SCRIPT_SPACE; i++)
|
|
|
|
ScriptSpace[i] = 0;
|
|
|
|
pActiveScripts = pIdleScripts = nil;
|
|
|
|
for (int i = 0; i < MAX_NUM_SCRIPTS; i++){
|
|
|
|
ScriptsArray[i].Init();
|
|
|
|
ScriptsArray[i].AddScriptToList(&pIdleScripts);
|
|
|
|
}
|
|
|
|
MissionCleanup.Init();
|
|
|
|
UpsideDownCars.Init();
|
|
|
|
StuckCars.Init();
|
|
|
|
CFileMgr::SetDir("data");
|
|
|
|
#ifdef USE_DEBUG_SCRIPT_LOADER
|
|
|
|
int mainf = open_script();
|
|
|
|
#else
|
|
|
|
int mainf = CFileMgr::OpenFile("main.scm", "rb");
|
|
|
|
#endif
|
|
|
|
CFileMgr::Read(mainf, (char*)ScriptSpace, SIZE_MAIN_SCRIPT);
|
|
|
|
CFileMgr::CloseFile(mainf);
|
|
|
|
CFileMgr::SetDir("");
|
|
|
|
StoreVehicleIndex = -1;
|
|
|
|
StoreVehicleWasRandom = true;
|
|
|
|
OnAMissionFlag = 0;
|
|
|
|
for (int i = 0; i < MAX_NUM_CONTACTS; i++){
|
|
|
|
BaseBriefIdForContact[i] = 0;
|
|
|
|
OnAMissionForContactFlag[i] = 0;
|
|
|
|
}
|
|
|
|
for (int i = 0; i < MAX_NUM_COLLECTIVES; i++){
|
|
|
|
CollectiveArray[i].index = -1;
|
|
|
|
CollectiveArray[i].unk_data = 0;
|
|
|
|
}
|
|
|
|
NextFreeCollectiveIndex = 0;
|
|
|
|
LastRandomPedId = -1;
|
|
|
|
for (int i = 0; i < MAX_NUM_USED_OBJECTS; i++){
|
|
|
|
memset(&UsedObjectArray[i].name, 0, sizeof(UsedObjectArray[i].name));
|
|
|
|
UsedObjectArray[i].index = 0;
|
|
|
|
}
|
|
|
|
NumberOfUsedObjects = 0;
|
|
|
|
ReadObjectNamesFromScript();
|
|
|
|
UpdateObjectIndices();
|
|
|
|
bAlreadyRunningAMissionScript = false;
|
|
|
|
bUsingAMultiScriptFile = true;
|
|
|
|
for (int i = 0; i < MAX_NUM_MISSION_SCRIPTS; i++)
|
|
|
|
MultiScriptArray[i] = 0;
|
|
|
|
NumberOfMissionScripts = 0;
|
|
|
|
LargestMissionScriptSize = 0;
|
|
|
|
MainScriptSize = 0;
|
|
|
|
ReadMultiScriptFileOffsetsFromScript();
|
|
|
|
FailCurrentMission = 0;
|
|
|
|
CountdownToMakePlayerUnsafe = 0;
|
2020-02-24 18:17:15 +00:00
|
|
|
DbgFlag = false;
|
2019-10-12 19:00:31 +00:00
|
|
|
DelayMakingPlayerUnsafeThisTime = 1;
|
2019-07-07 16:00:02 +00:00
|
|
|
NumScriptDebugLines = 0;
|
|
|
|
for (int i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++){
|
|
|
|
ScriptSphereArray[i].m_bInUse = false;
|
|
|
|
ScriptSphereArray[i].m_Index = 1;
|
|
|
|
ScriptSphereArray[i].m_Id = 0;
|
|
|
|
ScriptSphereArray[i].m_vecCenter = CVector(0.0f, 0.0f, 0.0f);
|
|
|
|
ScriptSphereArray[i].m_fRadius = 0.0f;
|
|
|
|
}
|
|
|
|
for (int i = 0; i < MAX_NUM_INTRO_TEXT_LINES; i++){
|
2019-07-07 17:57:00 +00:00
|
|
|
IntroTextLines[i].Reset();
|
2019-07-07 16:00:02 +00:00
|
|
|
}
|
|
|
|
NumberOfIntroTextLinesThisFrame = 0;
|
2020-02-24 18:17:15 +00:00
|
|
|
UseTextCommands = 0;
|
2019-07-07 16:00:02 +00:00
|
|
|
for (int i = 0; i < MAX_NUM_INTRO_RECTANGLES; i++){
|
2019-07-07 21:05:24 +00:00
|
|
|
IntroRectangles[i].m_bIsUsed = false;
|
2019-07-07 17:57:00 +00:00
|
|
|
IntroRectangles[i].m_bBeforeFade = false;
|
2019-07-07 16:00:02 +00:00
|
|
|
IntroRectangles[i].m_nTextureId = -1;
|
|
|
|
IntroRectangles[i].m_sRect = CRect(0.0f, 0.0f, 0.0f, 0.0f);
|
|
|
|
IntroRectangles[i].m_sColor = CRGBA(255, 255, 255, 255);
|
|
|
|
}
|
|
|
|
NumberOfIntroRectanglesThisFrame = 0;
|
|
|
|
for (int i = 0; i < MAX_NUM_BUILDING_SWAPS; i++){
|
|
|
|
BuildingSwapArray[i].m_pBuilding = nil;
|
|
|
|
BuildingSwapArray[i].m_nNewModel = -1;
|
|
|
|
BuildingSwapArray[i].m_nOldModel = -1;
|
|
|
|
}
|
|
|
|
for (int i = 0; i < MAX_NUM_INVISIBILITY_SETTINGS; i++)
|
|
|
|
InvisibilitySettingArray[i] = nil;
|
2020-06-21 10:46:23 +00:00
|
|
|
|
|
|
|
#if defined USE_ADVANCED_SCRIPT_DEBUG_OUTPUT && SCRIPT_LOG_FILE_LEVEL == 2
|
|
|
|
CFileMgr::SetDirMyDocuments();
|
2020-06-28 08:59:20 +00:00
|
|
|
if (dbg_log)
|
|
|
|
fclose(dbg_log);
|
|
|
|
dbg_log = fopen("SCRDBG.LOG", "w");
|
2020-06-21 10:46:23 +00:00
|
|
|
static const char* init_msg = "Starting debug script log\n\n";
|
|
|
|
PrintToLog(init_msg);
|
|
|
|
CFileMgr::SetDir("\\");
|
|
|
|
#endif
|
2019-07-07 16:00:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::RemoveScriptFromList(CRunningScript** ppScript)
|
|
|
|
{
|
|
|
|
if (prev)
|
|
|
|
prev->next = next;
|
|
|
|
else
|
|
|
|
*ppScript = next;
|
|
|
|
if (next)
|
|
|
|
next->prev = prev;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::AddScriptToList(CRunningScript** ppScript)
|
|
|
|
{
|
|
|
|
next = *ppScript;
|
|
|
|
prev = nil;
|
|
|
|
if (*ppScript)
|
|
|
|
(*ppScript)->prev = this;
|
|
|
|
*ppScript = this;
|
|
|
|
}
|
|
|
|
|
2019-07-07 17:57:00 +00:00
|
|
|
CRunningScript* CTheScripts::StartNewScript(uint32 ip)
|
|
|
|
{
|
|
|
|
CRunningScript* pNew = pIdleScripts;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pNew);
|
2019-07-07 17:57:00 +00:00
|
|
|
pNew->RemoveScriptFromList(&pIdleScripts);
|
|
|
|
pNew->Init();
|
|
|
|
pNew->SetIP(ip);
|
|
|
|
pNew->AddScriptToList(&pActiveScripts);
|
|
|
|
return pNew;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::Process()
|
|
|
|
{
|
|
|
|
if (CReplay::IsPlayingBack())
|
|
|
|
return;
|
|
|
|
CommandsExecuted = 0;
|
|
|
|
ScriptsUpdated = 0;
|
|
|
|
float timeStep = CTimer::GetTimeStepInMilliseconds();
|
|
|
|
UpsideDownCars.UpdateTimers();
|
|
|
|
StuckCars.Process();
|
|
|
|
DrawScriptSpheres();
|
|
|
|
if (FailCurrentMission)
|
|
|
|
--FailCurrentMission;
|
|
|
|
if (CountdownToMakePlayerUnsafe){
|
|
|
|
if (--CountdownToMakePlayerUnsafe == 0)
|
|
|
|
CWorld::Players[0].MakePlayerSafe(false);
|
|
|
|
}
|
|
|
|
if (UseTextCommands){
|
|
|
|
for (int i = 0; i < MAX_NUM_INTRO_TEXT_LINES; i++)
|
|
|
|
IntroTextLines[i].Reset();
|
2019-07-20 13:30:11 +00:00
|
|
|
NumberOfIntroTextLinesThisFrame = 0;
|
2019-07-07 17:57:00 +00:00
|
|
|
for (int i = 0; i < MAX_NUM_INTRO_RECTANGLES; i++){
|
2019-07-07 21:05:24 +00:00
|
|
|
IntroRectangles[i].m_bIsUsed = false;
|
2019-07-07 17:57:00 +00:00
|
|
|
IntroRectangles[i].m_bBeforeFade = false;
|
|
|
|
}
|
|
|
|
NumberOfIntroRectanglesThisFrame = 0;
|
|
|
|
if (UseTextCommands == 1)
|
|
|
|
UseTextCommands = 0;
|
|
|
|
}
|
2020-05-26 21:25:12 +00:00
|
|
|
|
|
|
|
#ifdef MISSION_REPLAY
|
|
|
|
static uint32 TimeToWaitTill;
|
|
|
|
switch (AllowMissionReplay) {
|
|
|
|
case 2:
|
|
|
|
AllowMissionReplay = 3;
|
|
|
|
TimeToWaitTill = CTimer::GetTimeInMilliseconds() + (AddExtraDeathDelay() > 1000 ? 4000 : 2500);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (TimeToWaitTill < CTimer::GetTimeInMilliseconds())
|
|
|
|
AllowMissionReplay = 4;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
AllowMissionReplay = 5;
|
|
|
|
RetryMission(0, 0);
|
|
|
|
case 6:
|
|
|
|
AllowMissionReplay = 7;
|
|
|
|
TimeToWaitTill = CTimer::GetTimeInMilliseconds() + 500;
|
|
|
|
case 7:
|
|
|
|
if (TimeToWaitTill < CTimer::GetTimeInMilliseconds()) {
|
|
|
|
AllowMissionReplay = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (WaitForMissionActivate) {
|
|
|
|
if (WaitForMissionActivate > CTimer::GetTimeInMilliseconds())
|
|
|
|
return;
|
|
|
|
WaitForMissionActivate = 0;
|
|
|
|
WaitForSave = CTimer::GetTimeInMilliseconds() + 3000;
|
|
|
|
}
|
|
|
|
if (WaitForSave && WaitForSave > CTimer::GetTimeInMilliseconds())
|
|
|
|
WaitForSave = 0;
|
|
|
|
#endif
|
|
|
|
|
2020-06-22 11:07:19 +00:00
|
|
|
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
|
|
|
#if SCRIPT_LOG_FILE_LEVEL == 1
|
|
|
|
CFileMgr::SetDirMyDocuments();
|
2020-06-28 08:59:20 +00:00
|
|
|
dbg_log = fopen("SCRDBG.LOG", "w");
|
2020-06-22 11:07:19 +00:00
|
|
|
static const char* init_msg = "Starting debug script log\n\n";
|
|
|
|
PrintToLog(init_msg);
|
|
|
|
CFileMgr::SetDir("\\");
|
|
|
|
#endif
|
|
|
|
PrintToLog("------------------------\n");
|
|
|
|
PrintToLog("CTheScripts::Process started, CTimer::GetTimeInMilliseconds == %u\n", CTimer::GetTimeInMilliseconds());
|
|
|
|
#endif
|
|
|
|
|
2019-07-07 17:57:00 +00:00
|
|
|
CRunningScript* script = pActiveScripts;
|
|
|
|
while (script != nil){
|
|
|
|
CRunningScript* next = script->GetNext();
|
|
|
|
++ScriptsUpdated;
|
|
|
|
script->UpdateTimers(timeStep);
|
|
|
|
script->Process();
|
|
|
|
script = next;
|
|
|
|
}
|
|
|
|
DbgFlag = false;
|
2020-06-21 10:46:23 +00:00
|
|
|
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
|
|
|
PrintToLog("Script processing done, ScriptsUpdated: %d, CommandsExecuted: %d\n", ScriptsUpdated, CommandsExecuted);
|
|
|
|
#if SCRIPT_LOG_FILE_LEVEL == 1
|
2020-06-28 08:59:20 +00:00
|
|
|
fclose(dbg_log);
|
|
|
|
dbg_log = nil;
|
2020-06-21 10:46:23 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2019-07-07 17:57:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CRunningScript* CTheScripts::StartTestScript()
|
|
|
|
{
|
|
|
|
return StartNewScript(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CTheScripts::IsPlayerOnAMission()
|
|
|
|
{
|
|
|
|
return OnAMissionFlag && *(int32*)&ScriptSpace[OnAMissionFlag] == 1;
|
|
|
|
}
|
|
|
|
|
2019-07-07 21:05:24 +00:00
|
|
|
void CRunningScript::Process()
|
|
|
|
{
|
2020-06-21 10:46:23 +00:00
|
|
|
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
|
|
|
PrintToLog("\n\nProcessing script %s (id %d)\n\n", m_abScriptName, this - CTheScripts::ScriptsArray);
|
|
|
|
#endif
|
2019-07-07 21:05:24 +00:00
|
|
|
if (m_bIsMissionScript)
|
|
|
|
DoDeatharrestCheck();
|
|
|
|
if (m_bMissionFlag && CTheScripts::FailCurrentMission == 1 && m_nStackPointer == 1)
|
2020-02-23 10:12:44 +00:00
|
|
|
SetIP(m_anStack[--m_nStackPointer]);
|
2019-07-07 21:05:24 +00:00
|
|
|
if (CTimer::GetTimeInMilliseconds() >= m_nWakeTime){
|
|
|
|
while (!ProcessOneCommand())
|
|
|
|
;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!m_bSkipWakeTime)
|
|
|
|
return;
|
|
|
|
if (!CPad::GetPad(0)->GetCrossJustDown())
|
|
|
|
return;
|
|
|
|
m_nWakeTime = 0;
|
2019-10-20 22:08:26 +00:00
|
|
|
for (int i = 0; i < NUMBIGMESSAGES; i++){
|
|
|
|
if (CMessages::BIGMessages[i].m_Stack[0].m_pText != nil)
|
|
|
|
CMessages::BIGMessages[i].m_Stack[0].m_nStartTime = 0;
|
2019-07-07 21:05:24 +00:00
|
|
|
}
|
2019-10-20 22:08:26 +00:00
|
|
|
if (CMessages::BriefMessages[0].m_pText != nil)
|
|
|
|
CMessages::BriefMessages[0].m_nStartTime = 0;
|
2019-07-07 21:05:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int8 CRunningScript::ProcessOneCommand()
|
|
|
|
{
|
2020-06-21 10:46:23 +00:00
|
|
|
int8 retval = -1;
|
2019-07-07 21:05:24 +00:00
|
|
|
++CTheScripts::CommandsExecuted;
|
2020-03-01 14:42:47 +00:00
|
|
|
int32 command = CTheScripts::Read2BytesFromScript(&m_nIp);
|
2019-07-07 21:05:24 +00:00
|
|
|
m_bNotFlag = (command & 0x8000);
|
|
|
|
command &= 0x7FFF;
|
2020-06-21 10:46:23 +00:00
|
|
|
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
2020-06-28 13:24:09 +00:00
|
|
|
char commandInfo[1024];
|
2020-06-21 10:46:23 +00:00
|
|
|
uint32 ip = m_nIp;
|
|
|
|
if (command < ARRAY_SIZE(commands)) {
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(commands[command].id == command);
|
2020-06-21 10:46:23 +00:00
|
|
|
sprintf(commandInfo, m_nIp >= SIZE_MAIN_SCRIPT ? "M<%5d> " : "<%6d> ", m_nIp >= SIZE_MAIN_SCRIPT ? m_nIp - SIZE_MAIN_SCRIPT : m_nIp);
|
|
|
|
if (m_bNotFlag)
|
|
|
|
strcat(commandInfo, "NOT ");
|
|
|
|
if (commands[command].position == -1)
|
|
|
|
strcat(commandInfo, commands[command].name + sizeof("COMMAND_") - 1);
|
|
|
|
for (int i = 0; commands[command].input[i] != ARGTYPE_NONE; i++) {
|
|
|
|
char tmp[16];
|
|
|
|
bool var = false;
|
|
|
|
int value;
|
|
|
|
switch (commands[command].input[i]) {
|
|
|
|
case ARGTYPE_INT:
|
|
|
|
case ARGTYPE_PED_HANDLE:
|
|
|
|
case ARGTYPE_VEHICLE_HANDLE:
|
|
|
|
case ARGTYPE_OBJECT_HANDLE: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%d)" : " %d", value); break;
|
|
|
|
case ARGTYPE_FLOAT: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%.3f)" : " %.3f", *(float*)&value); break;
|
|
|
|
case ARGTYPE_STRING: sprintf(tmp, " '%s'", (const char*)&CTheScripts::ScriptSpace[m_nIp]); m_nIp += KEY_LENGTH_IN_SCRIPT; break;
|
|
|
|
case ARGTYPE_LABEL: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%s(%d))" : " %s(%d)", value >= 0 ? "G" : "L", abs(value)); break;
|
|
|
|
case ARGTYPE_BOOL: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%s)" : " %s", value ? "TRUE" : "FALSE"); break;
|
|
|
|
case ARGTYPE_ANDOR: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, " %d %ss", (value + 1) % 10, value / 10 == 0 ? "AND" : "OR"); break;
|
2020-06-28 08:59:20 +00:00
|
|
|
default: script_assert(0);
|
2020-06-21 10:46:23 +00:00
|
|
|
}
|
|
|
|
strcat(commandInfo, tmp);
|
|
|
|
if (commands[command].position == i)
|
|
|
|
strcat(commandInfo, commands[command].name_override);
|
|
|
|
}
|
|
|
|
uint32 t = m_nIp;
|
|
|
|
m_nIp = ip;
|
|
|
|
ip = t;
|
|
|
|
}
|
|
|
|
#endif
|
2019-07-07 21:05:24 +00:00
|
|
|
if (command < 100)
|
2020-06-21 10:46:23 +00:00
|
|
|
retval = ProcessCommands0To99(command);
|
|
|
|
else if (command < 200)
|
|
|
|
retval = ProcessCommands100To199(command);
|
|
|
|
else if (command < 300)
|
|
|
|
retval = ProcessCommands200To299(command);
|
|
|
|
else if (command < 400)
|
|
|
|
retval = ProcessCommands300To399(command);
|
|
|
|
else if (command < 500)
|
|
|
|
retval = ProcessCommands400To499(command);
|
|
|
|
else if (command < 600)
|
|
|
|
retval = ProcessCommands500To599(command);
|
|
|
|
else if (command < 700)
|
|
|
|
retval = ProcessCommands600To699(command);
|
|
|
|
else if (command < 800)
|
|
|
|
retval = ProcessCommands700To799(command);
|
|
|
|
else if (command < 900)
|
|
|
|
retval = ProcessCommands800To899(command);
|
|
|
|
else if (command < 1000)
|
|
|
|
retval = ProcessCommands900To999(command);
|
2020-02-16 20:08:54 +00:00
|
|
|
#ifdef GTA_PS2
|
2020-06-21 10:46:23 +00:00
|
|
|
else if (command < 1200)
|
|
|
|
retval = ProcessCommands1000To1099(command);
|
2020-02-16 20:08:54 +00:00
|
|
|
#else
|
2020-06-21 10:46:23 +00:00
|
|
|
else if (command < 1100)
|
|
|
|
retval = ProcessCommands1000To1099(command);
|
|
|
|
else if (command < 1200)
|
|
|
|
retval = ProcessCommands1100To1199(command);
|
2020-02-16 20:08:54 +00:00
|
|
|
#endif
|
2020-06-21 10:46:23 +00:00
|
|
|
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
|
|
|
|
if (command < ARRAY_SIZE(commands)) {
|
|
|
|
if (commands[command].cond || commands[command].output[0] != ARGTYPE_NONE) {
|
|
|
|
strcat(commandInfo, " ->");
|
|
|
|
if (commands[command].cond)
|
|
|
|
strcat(commandInfo, m_bCondResult ? " TRUE" : " FALSE");
|
|
|
|
uint32 t = m_nIp;
|
|
|
|
m_nIp = ip;
|
|
|
|
ip = t;
|
|
|
|
for (int i = 0; commands[command].output[i] != ARGTYPE_NONE; i++) {
|
|
|
|
char tmp[16];
|
|
|
|
switch (commands[command].output[i]) {
|
|
|
|
case ARGTYPE_INT:
|
|
|
|
case ARGTYPE_PED_HANDLE:
|
|
|
|
case ARGTYPE_VEHICLE_HANDLE:
|
|
|
|
case ARGTYPE_OBJECT_HANDLE: GetStoredParameterForDebug(commandInfo); sprintf(tmp, " (%d)", ScriptParams[i]); strcat(commandInfo, tmp); break;
|
|
|
|
case ARGTYPE_FLOAT: GetStoredParameterForDebug(commandInfo); sprintf(tmp, " (%8.3f)", *(float*)&ScriptParams[i]); strcat(commandInfo, tmp); break;
|
2020-06-28 08:59:20 +00:00
|
|
|
default: script_assert(0 && "Script only returns INTs and FLOATs");
|
2020-06-21 10:46:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
m_nIp = ip;
|
|
|
|
}
|
|
|
|
PrintToLog("%s\n", commandInfo);
|
|
|
|
if (m_bMissionFlag) {
|
|
|
|
for (int i = 0; commandInfo[i]; i++) {
|
|
|
|
if (commandInfo[i] == '_')
|
|
|
|
commandInfo[i] = ' ';
|
|
|
|
}
|
|
|
|
CDebug::DebugAddText(commandInfo);
|
|
|
|
}
|
|
|
|
}
|
2020-06-28 08:59:20 +00:00
|
|
|
#elif defined USE_BASIC_SCRIPT_DEBUG_OUTPUT
|
2020-06-21 10:46:23 +00:00
|
|
|
if (m_bMissionFlag) {
|
|
|
|
char tmp[128];
|
|
|
|
sprintf(tmp, "Comm %d Cmp %d", command, m_bCondResult);
|
|
|
|
CDebug::DebugAddText(tmp);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return retval;
|
2019-07-07 21:05:24 +00:00
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands0To99(int32 command)
|
2019-07-09 20:38:05 +00:00
|
|
|
{
|
2020-05-11 02:55:57 +00:00
|
|
|
float *fScriptVar1;
|
|
|
|
int *nScriptVar1;
|
2019-07-09 20:38:05 +00:00
|
|
|
switch (command) {
|
|
|
|
case COMMAND_NOP:
|
|
|
|
return 0;
|
|
|
|
case COMMAND_WAIT:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
m_nWakeTime = CTimer::GetTimeInMilliseconds() + ScriptParams[0];
|
2020-05-18 21:10:45 +00:00
|
|
|
m_bSkipWakeTime = false;
|
2019-07-09 20:38:05 +00:00
|
|
|
return 1;
|
|
|
|
case COMMAND_GOTO:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : SIZE_MAIN_SCRIPT - ScriptParams[0]);
|
|
|
|
/* Known issue: GOTO to 0. It might have been "better" to use > instead of >= */
|
|
|
|
/* simply because it never makes sense to jump to start of the script */
|
|
|
|
/* but jumping to start of a custom mission is an issue for simple mission-like scripts */
|
|
|
|
/* However, it's not an issue for actual mission scripts, because they follow a structure */
|
|
|
|
/* and never start with a loop. */
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SHAKE_CAM:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2019-07-17 10:24:04 +00:00
|
|
|
CamShakeNoPos(&TheCamera, ScriptParams[0] / 1000.0f);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_VAR_INT:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*ptr = ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_VAR_FLOAT:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr = *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_LVAR_INT:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*ptr = ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_LVAR_FLOAT:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr = *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_VAL_TO_INT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*ptr += ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_VAL_TO_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr += *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_VAL_TO_INT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*ptr += ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_VAL_TO_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr += *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SUB_VAL_FROM_INT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*ptr -= ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SUB_VAL_FROM_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr -= *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SUB_VAL_FROM_INT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*ptr -= ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SUB_VAL_FROM_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr -= *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_MULT_INT_VAR_BY_VAL:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*ptr *= ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_MULT_FLOAT_VAR_BY_VAL:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr *= *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_MULT_INT_LVAR_BY_VAL:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*ptr *= ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_MULT_FLOAT_LVAR_BY_VAL:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr *= *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DIV_INT_VAR_BY_VAL:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*ptr /= ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DIV_FLOAT_VAR_BY_VAL:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr /= *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DIV_INT_LVAR_BY_VAL:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*ptr /= ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DIV_FLOAT_LVAR_BY_VAL:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr /= *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_VAR_GREATER_THAN_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*ptr > ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_LVAR_GREATER_THAN_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*ptr > ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_NUMBER_GREATER_THAN_INT_VAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(ScriptParams[0] > *ptr);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_NUMBER_GREATER_THAN_INT_LVAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(ScriptParams[0] > *ptr);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_VAR_GREATER_THAN_INT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*ptr1 > *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_LVAR_GREATER_THAN_INT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*ptr1 > *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_VAR_GREATER_THAN_INT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*ptr1 > *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_LVAR_GREATER_THAN_INT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*ptr1 > *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_VAR_GREATER_THAN_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*(float*)ptr > *(float*)&ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_LVAR_GREATER_THAN_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*(float*)ptr > *(float*)&ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_NUMBER_GREATER_THAN_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*(float*)&ScriptParams[0] > *(float*)ptr);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_NUMBER_GREATER_THAN_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*(float*)&ScriptParams[0] > *(float*)ptr);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_VAR_GREATER_THAN_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 > *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_LVAR_GREATER_THAN_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 > *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_VAR_GREATER_THAN_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 > *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_LVAR_GREATER_THAN_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 > *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_VAR_GREATER_OR_EQUAL_TO_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*ptr >= ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_LVAR_GREATER_OR_EQUAL_TO_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*ptr >= ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_NUMBER_GREATER_OR_EQUAL_TO_INT_VAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(ScriptParams[0] >= *ptr);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_NUMBER_GREATER_OR_EQUAL_TO_INT_LVAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(ScriptParams[0] >= *ptr);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*ptr1 >= *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*ptr1 >= *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*ptr1 >= *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*ptr1 >= *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*(float*)ptr >= *(float*)&ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*(float*)ptr >= *(float*)&ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*(float*)&ScriptParams[0] >= *(float*)ptr);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*(float*)&ScriptParams[0] >= *(float*)ptr);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 >= *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 >= *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 >= *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 >= *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_VAR_EQUAL_TO_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*ptr == ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_LVAR_EQUAL_TO_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*ptr == ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_VAR_EQUAL_TO_INT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*ptr1 == *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_VAR_EQUAL_TO_INT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*ptr1 == *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_INT_LVAR_EQUAL_TO_INT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*ptr1 == *ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-25 20:34:29 +00:00
|
|
|
/* Following commands are not implemented, and go to default case
|
|
|
|
case COMMAND_IS_INT_VAR_NOT_EQUAL_TO_NUMBER:
|
|
|
|
case COMMAND_IS_INT_LVAR_NOT_EQUAL_TO_NUMBER:
|
|
|
|
case COMMAND_IS_INT_VAR_NOT_EQUAL_TO_INT_VAR:
|
|
|
|
case COMMAND_IS_INT_LVAR_NOT_EQUAL_TO_INT_LVAR:
|
|
|
|
case COMMAND_IS_INT_VAR_NOT_EQUAL_TO_INT_LVAR:
|
|
|
|
*/
|
2019-07-09 20:38:05 +00:00
|
|
|
case COMMAND_IS_FLOAT_VAR_EQUAL_TO_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*(float*)ptr == *(float*)&ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_LVAR_EQUAL_TO_NUMBER:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(*(float*)ptr == *(float*)&ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_VAR_EQUAL_TO_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 == *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_VAR_EQUAL_TO_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 == *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_FLOAT_LVAR_EQUAL_TO_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
int32* ptr2 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
UpdateCompareFlag(*(float*)ptr1 == *(float*)ptr2);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-25 20:34:29 +00:00
|
|
|
/* Following commands are not implemented, and go to default case
|
|
|
|
case COMMAND_IS_FLOAT_VAR_NOT_EQUAL_TO_NUMBER:
|
|
|
|
case COMMAND_IS_FLOAT_LVAR_NOT_EQUAL_TO_NUMBER:
|
|
|
|
case COMMAND_IS_FLOAT_VAR_NOT_EQUAL_TO_FLOAT_VAR:
|
|
|
|
case COMMAND_IS_FLOAT_LVAR_NOT_EQUAL_TO_FLOAT_LVAR:
|
|
|
|
case COMMAND_IS_FLOAT_VAR_NOT_EQUAL_TO_FLOAT_LVAR:
|
|
|
|
*/
|
2019-07-09 20:38:05 +00:00
|
|
|
case COMMAND_GOTO_IF_TRUE:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
if (m_bCondResult)
|
|
|
|
SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : SIZE_MAIN_SCRIPT - ScriptParams[0]);
|
|
|
|
/* Check COMMAND_GOTO note. */
|
|
|
|
return 0;
|
|
|
|
case COMMAND_GOTO_IF_FALSE:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
if (!m_bCondResult)
|
|
|
|
SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : SIZE_MAIN_SCRIPT - ScriptParams[0]);
|
|
|
|
/* Check COMMAND_GOTO note. */
|
|
|
|
return 0;
|
|
|
|
case COMMAND_TERMINATE_THIS_SCRIPT:
|
|
|
|
if (m_bMissionFlag)
|
|
|
|
CTheScripts::bAlreadyRunningAMissionScript = false;
|
|
|
|
RemoveScriptFromList(&CTheScripts::pActiveScripts);
|
|
|
|
AddScriptToList(&CTheScripts::pIdleScripts);
|
2020-05-26 21:25:12 +00:00
|
|
|
#ifdef MISSION_REPLAY
|
|
|
|
if (m_bMissionFlag) {
|
|
|
|
CPlayerInfo* pPlayerInfo = &CWorld::Players[CWorld::PlayerInFocus];
|
|
|
|
if (pPlayerInfo->m_pPed->GetPedState() != PED_DEAD && pPlayerInfo->m_WBState == WBSTATE_PLAYING && !m_bDeatharrestExecuted)
|
|
|
|
SaveGameForPause(1);
|
|
|
|
oldTargetX = oldTargetY = 0.0f;
|
|
|
|
if (AllowMissionReplay == 1)
|
|
|
|
AllowMissionReplay = 2;
|
|
|
|
// I am fairly sure they forgot to set return value here
|
|
|
|
}
|
|
|
|
#endif
|
2019-07-09 20:38:05 +00:00
|
|
|
return 1;
|
|
|
|
case COMMAND_START_NEW_SCRIPT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ScriptParams[0] >= 0);
|
2019-07-09 20:38:05 +00:00
|
|
|
CRunningScript* pNew = CTheScripts::StartNewScript(ScriptParams[0]);
|
2020-03-01 14:42:47 +00:00
|
|
|
int8 type = CTheScripts::Read1ByteFromScript(&m_nIp);
|
2019-07-09 20:38:05 +00:00
|
|
|
float tmp;
|
2020-03-01 14:42:47 +00:00
|
|
|
for (int i = 0; type != ARGUMENT_END; type = CTheScripts::Read1ByteFromScript(&m_nIp), i++) {
|
2019-07-09 20:38:05 +00:00
|
|
|
switch (type) {
|
|
|
|
case ARGUMENT_INT32:
|
2020-03-01 14:42:47 +00:00
|
|
|
pNew->m_anLocalVariables[i] = CTheScripts::Read4BytesFromScript(&m_nIp);
|
2019-07-09 20:38:05 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_GLOBALVAR:
|
2020-03-01 14:42:47 +00:00
|
|
|
pNew->m_anLocalVariables[i] = *(int32*)&CTheScripts::ScriptSpace[CTheScripts::Read2BytesFromScript(&m_nIp)];
|
2019-07-09 20:38:05 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_LOCALVAR:
|
2020-03-01 14:42:47 +00:00
|
|
|
pNew->m_anLocalVariables[i] = m_anLocalVariables[CTheScripts::Read2BytesFromScript(&m_nIp)];
|
2019-07-09 20:38:05 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_INT8:
|
2020-03-01 14:42:47 +00:00
|
|
|
pNew->m_anLocalVariables[i] = CTheScripts::Read1ByteFromScript(&m_nIp);
|
2019-07-09 20:38:05 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_INT16:
|
2020-03-01 14:42:47 +00:00
|
|
|
pNew->m_anLocalVariables[i] = CTheScripts::Read2BytesFromScript(&m_nIp);
|
2019-07-09 20:38:05 +00:00
|
|
|
break;
|
|
|
|
case ARGUMENT_FLOAT:
|
2020-03-01 14:42:47 +00:00
|
|
|
tmp = CTheScripts::ReadFloatFromScript(&m_nIp);
|
2019-07-09 20:38:05 +00:00
|
|
|
pNew->m_anLocalVariables[i] = *(int32*)&tmp;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GOSUB:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(m_nStackPointer < MAX_STACK_DEPTH);
|
2019-07-09 20:38:05 +00:00
|
|
|
m_anStack[m_nStackPointer++] = m_nIp;
|
|
|
|
SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : SIZE_MAIN_SCRIPT - ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_RETURN:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(m_nStackPointer > 0); /* No more SSU */
|
2019-07-09 20:38:05 +00:00
|
|
|
SetIP(m_anStack[--m_nStackPointer]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LINE:
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
/* Something must have been here */
|
|
|
|
return 0;
|
|
|
|
case COMMAND_CREATE_PLAYER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
int32 index = ScriptParams[0];
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(index < 1); /* Constant? Also no more double player glitch */
|
2020-02-23 10:12:44 +00:00
|
|
|
printf("&&&&&&&&&&&&&Creating player: %d\n", index);
|
2019-07-09 20:38:05 +00:00
|
|
|
if (!CStreaming::HasModelLoaded(MI_PLAYER)) {
|
|
|
|
CStreaming::RequestSpecialModel(MI_PLAYER, "player", STREAMFLAGS_DONT_REMOVE | STREAMFLAGS_DEPENDENCY);
|
|
|
|
CStreaming::LoadAllRequestedModels(false);
|
|
|
|
}
|
|
|
|
CPlayerPed::SetupPlayerPed(index);
|
|
|
|
CWorld::Players[index].m_pPed->CharCreatedBy = MISSION_CHAR;
|
|
|
|
CPlayerPed::DeactivatePlayerPed(index);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-09 20:38:05 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pos.z += CWorld::Players[index].m_pPed->GetDistanceFromCentreOfMassToBaseOfModel();
|
2020-04-30 10:48:01 +00:00
|
|
|
CWorld::Players[index].m_pPed->SetPosition(pos);
|
2019-07-09 20:38:05 +00:00
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, CWorld::Players[index].m_pPed);
|
|
|
|
CPlayerPed::ReactivatePlayerPed(index);
|
|
|
|
ScriptParams[0] = index;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_PLAYER_COORDINATES:
|
|
|
|
{
|
|
|
|
CVector pos;
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
if (CWorld::Players[ScriptParams[0]].m_pPed->bInVehicle)
|
|
|
|
pos = CWorld::Players[ScriptParams[0]].m_pPed->m_pMyVehicle->GetPosition();
|
|
|
|
else
|
|
|
|
pos = CWorld::Players[ScriptParams[0]].m_pPed->GetPosition();
|
|
|
|
*(CVector*)&ScriptParams[0] = pos;
|
|
|
|
StoreParameters(&m_nIp, 3);
|
2019-07-09 21:01:02 +00:00
|
|
|
return 0;
|
2019-07-09 20:38:05 +00:00
|
|
|
}
|
|
|
|
case COMMAND_SET_PLAYER_COORDINATES:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
|
|
|
int index = ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-09 20:38:05 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CPlayerPed* ped = CWorld::Players[index].m_pPed;
|
|
|
|
if (!ped->bInVehicle) {
|
|
|
|
pos.z += ped->GetDistanceFromCentreOfMassToBaseOfModel();
|
|
|
|
ped->Teleport(pos);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, ped);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
pos.z += ped->m_pMyVehicle->GetDistanceFromCentreOfMassToBaseOfModel();
|
|
|
|
if (ped->m_pMyVehicle->IsBoat())
|
|
|
|
ped->m_pMyVehicle->Teleport(pos);
|
|
|
|
else
|
|
|
|
ped->m_pMyVehicle->Teleport(pos);
|
|
|
|
/* I'll keep this condition here but obviously it is absolutely pointless */
|
|
|
|
/* It's clearly present in disassembly so it had to be in original code */
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, ped->m_pMyVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_2D:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CPlayerPed* ped = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-01-03 16:48:13 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[1];
|
|
|
|
float y1 = *(float*)&ScriptParams[2];
|
|
|
|
float x2 = *(float*)&ScriptParams[3];
|
|
|
|
float y2 = *(float*)&ScriptParams[4];
|
2019-07-09 20:38:05 +00:00
|
|
|
if (!ped->bInVehicle)
|
|
|
|
UpdateCompareFlag(ped->IsWithinArea(x1, y1, x2, y2));
|
|
|
|
else
|
|
|
|
UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, x2, y2));
|
|
|
|
if (!ScriptParams[5])
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
|
2019-07-09 20:38:05 +00:00
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_3D:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CPlayerPed* ped = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-01-03 16:48:13 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[1];
|
|
|
|
float y1 = *(float*)&ScriptParams[2];
|
|
|
|
float z1 = *(float*)&ScriptParams[3];
|
|
|
|
float x2 = *(float*)&ScriptParams[4];
|
|
|
|
float y2 = *(float*)&ScriptParams[5];
|
|
|
|
float z2 = *(float*)&ScriptParams[6];
|
2019-07-09 20:38:05 +00:00
|
|
|
if (ped->bInVehicle)
|
|
|
|
UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, z1, x2, y2, z2));
|
2019-07-10 12:00:10 +00:00
|
|
|
else
|
|
|
|
UpdateCompareFlag(ped->IsWithinArea(x1, y1, z1, x2, y2, z2));
|
2019-07-09 20:38:05 +00:00
|
|
|
if (!ScriptParams[7])
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
|
2019-07-09 20:38:05 +00:00
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_INT_VAR_TO_INT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*nScriptVar1 += *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_INT_LVAR_TO_INT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*nScriptVar1 += *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_INT_VAR_TO_INT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*nScriptVar1 += *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_INT_LVAR_TO_INT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*nScriptVar1 += *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_FLOAT_VAR_TO_FLOAT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 += *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_FLOAT_LVAR_TO_FLOAT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 += *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_FLOAT_VAR_TO_FLOAT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 += *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_FLOAT_LVAR_TO_FLOAT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 += *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SUB_INT_VAR_FROM_INT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*nScriptVar1 -= *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SUB_INT_LVAR_FROM_INT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*nScriptVar1 -= *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SUB_FLOAT_VAR_FROM_FLOAT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 -= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SUB_FLOAT_LVAR_FROM_FLOAT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 -= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-09 20:38:05 +00:00
|
|
|
return 0;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-07-09 20:38:05 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands100To199(int32 command)
|
2019-07-14 09:49:03 +00:00
|
|
|
{
|
2020-05-11 02:55:57 +00:00
|
|
|
float *fScriptVar1;
|
|
|
|
int *nScriptVar1;
|
2019-07-14 09:49:03 +00:00
|
|
|
switch (command) {
|
|
|
|
case COMMAND_SUB_INT_LVAR_FROM_INT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*nScriptVar1 -= *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SUB_INT_VAR_FROM_INT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*nScriptVar1 -= *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SUB_FLOAT_LVAR_FROM_FLOAT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 -= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SUB_FLOAT_VAR_FROM_FLOAT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 -= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_MULT_INT_VAR_BY_INT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*nScriptVar1 *= *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_MULT_INT_VAR_BY_INT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*nScriptVar1 *= *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_MULT_INT_LVAR_BY_INT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*nScriptVar1 *= *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_MULT_INT_LVAR_BY_INT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*nScriptVar1 *= *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_MULT_FLOAT_VAR_BY_FLOAT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 *= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_MULT_FLOAT_VAR_BY_FLOAT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 *= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_MULT_FLOAT_LVAR_BY_FLOAT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 *= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_MULT_FLOAT_LVAR_BY_FLOAT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 *= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_DIV_INT_VAR_BY_INT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*nScriptVar1 /= *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_DIV_INT_VAR_BY_INT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*nScriptVar1 /= *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_DIV_INT_LVAR_BY_INT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*nScriptVar1 /= *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_DIV_INT_LVAR_BY_INT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*nScriptVar1 /= *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_DIV_FLOAT_VAR_BY_FLOAT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 /= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_DIV_FLOAT_VAR_BY_FLOAT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 /= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_DIV_FLOAT_LVAR_BY_FLOAT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 /= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_DIV_FLOAT_LVAR_BY_FLOAT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 /= *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_TIMED_VAL_TO_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr += CTimer::GetTimeStep() * *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_TIMED_VAL_TO_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr += CTimer::GetTimeStep() * *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_TIMED_FLOAT_VAR_TO_FLOAT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 += CTimer::GetTimeStep() * *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
case COMMAND_ADD_TIMED_FLOAT_VAR_TO_FLOAT_LVAR:
|
|
|
|
#else
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_ADD_TIMED_FLOAT_LVAR_TO_FLOAT_VAR:
|
2020-06-07 12:07:36 +00:00
|
|
|
#endif
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 += CTimer::GetTimeStep() * *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
case COMMAND_ADD_TIMED_FLOAT_LVAR_TO_FLOAT_VAR:
|
|
|
|
#else
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_ADD_TIMED_FLOAT_VAR_TO_FLOAT_LVAR:
|
2020-06-07 12:07:36 +00:00
|
|
|
#endif
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 += CTimer::GetTimeStep() * *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_TIMED_FLOAT_LVAR_TO_FLOAT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 += CTimer::GetTimeStep() * *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SUB_TIMED_VAL_FROM_FLOAT_VAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr -= CTimer::GetTimeStep() * *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SUB_TIMED_VAL_FROM_FLOAT_LVAR:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)ptr -= CTimer::GetTimeStep() * *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SUB_TIMED_FLOAT_VAR_FROM_FLOAT_VAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 -= CTimer::GetTimeStep() * *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
#ifdef FIX_BUGS // in SA it was fixed by reversing their order in enum
|
|
|
|
case COMMAND_SUB_TIMED_FLOAT_VAR_FROM_FLOAT_LVAR:
|
|
|
|
#else
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_VAR:
|
2020-06-07 12:07:36 +00:00
|
|
|
#endif
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*fScriptVar1 -= CTimer::GetTimeStep() * *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2020-06-07 12:07:36 +00:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
case COMMAND_SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_VAR:
|
|
|
|
#else
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_SUB_TIMED_FLOAT_VAR_FROM_FLOAT_LVAR:
|
2020-06-07 12:07:36 +00:00
|
|
|
#endif
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 -= CTimer::GetTimeStep() * *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_LVAR:
|
2020-05-11 02:55:57 +00:00
|
|
|
fScriptVar1 = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*fScriptVar1 -= CTimer::GetTimeStep() * *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_VAR_INT_TO_VAR_INT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*ptr = *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_SET_VAR_INT_TO_LVAR_INT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*ptr = *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_SET_LVAR_INT_TO_VAR_INT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*ptr = *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_SET_LVAR_INT_TO_LVAR_INT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*ptr = *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_SET_VAR_FLOAT_TO_VAR_FLOAT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*ptr = *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_SET_VAR_FLOAT_TO_LVAR_FLOAT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*ptr = *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_SET_LVAR_FLOAT_TO_VAR_FLOAT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*ptr = *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_SET_LVAR_FLOAT_TO_LVAR_FLOAT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*ptr = *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_CSET_VAR_INT_TO_VAR_FLOAT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*ptr = *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_CSET_VAR_INT_TO_LVAR_FLOAT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*ptr = *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_CSET_LVAR_INT_TO_VAR_FLOAT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*ptr = *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_CSET_LVAR_INT_TO_LVAR_FLOAT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*ptr = *(float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_CSET_VAR_FLOAT_TO_VAR_INT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*ptr = *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_CSET_VAR_FLOAT_TO_LVAR_INT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
*ptr = *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2020-06-07 12:07:36 +00:00
|
|
|
case COMMAND_CSET_LVAR_FLOAT_TO_VAR_INT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*ptr = *GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_CSET_LVAR_FLOAT_TO_LVAR_INT:
|
2019-07-14 19:59:00 +00:00
|
|
|
{
|
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
|
|
|
*ptr = *GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
2019-07-14 19:59:00 +00:00
|
|
|
}
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_ABS_VAR_INT:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-15 09:21:24 +00:00
|
|
|
*ptr = ABS(*ptr);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ABS_LVAR_INT:
|
|
|
|
{
|
|
|
|
int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-15 09:21:24 +00:00
|
|
|
*ptr = ABS(*ptr);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ABS_VAR_FLOAT:
|
|
|
|
{
|
2019-07-14 12:00:36 +00:00
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
2019-07-15 09:21:24 +00:00
|
|
|
*ptr = ABS(*ptr);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ABS_LVAR_FLOAT:
|
|
|
|
{
|
2019-07-14 12:00:36 +00:00
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_LOCAL);
|
2019-07-15 09:21:24 +00:00
|
|
|
*ptr = ABS(*ptr);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GENERATE_RANDOM_FLOAT:
|
|
|
|
{
|
|
|
|
float* ptr = (float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL);
|
|
|
|
CGeneral::GetRandomNumber();
|
|
|
|
CGeneral::GetRandomNumber();
|
|
|
|
CGeneral::GetRandomNumber(); /* To make it EXTRA random! */
|
2019-12-31 23:35:54 +00:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
*ptr = CGeneral::GetRandomNumberInRange(0.0f, 1.0f);
|
|
|
|
#else
|
2019-07-14 09:49:03 +00:00
|
|
|
*ptr = CGeneral::GetRandomNumber() / 65536.0f;
|
|
|
|
/* Between 0 and 0.5 on PC (oh well...), never used in original script. */
|
2019-12-31 23:35:54 +00:00
|
|
|
#endif
|
|
|
|
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GENERATE_RANDOM_INT:
|
|
|
|
*GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL) = CGeneral::GetRandomNumber();
|
|
|
|
return 0;
|
|
|
|
case COMMAND_CREATE_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
switch (ScriptParams[1]) {
|
|
|
|
case MI_COP:
|
2019-07-20 13:30:11 +00:00
|
|
|
if (ScriptParams[0] == PEDTYPE_COP)
|
2019-07-14 09:49:03 +00:00
|
|
|
ScriptParams[1] = COP_STREET;
|
|
|
|
break;
|
|
|
|
case MI_SWAT:
|
2019-07-20 13:30:11 +00:00
|
|
|
if (ScriptParams[0] == PEDTYPE_COP)
|
2019-07-14 09:49:03 +00:00
|
|
|
ScriptParams[1] = COP_SWAT;
|
|
|
|
break;
|
|
|
|
case MI_FBI:
|
2019-07-20 13:30:11 +00:00
|
|
|
if (ScriptParams[0] == PEDTYPE_COP)
|
2019-07-14 09:49:03 +00:00
|
|
|
ScriptParams[1] = COP_FBI;
|
|
|
|
break;
|
|
|
|
case MI_ARMY:
|
2019-07-20 13:30:11 +00:00
|
|
|
if (ScriptParams[0] == PEDTYPE_COP)
|
2019-07-14 09:49:03 +00:00
|
|
|
ScriptParams[1] = COP_ARMY;
|
|
|
|
break;
|
|
|
|
case MI_MEDIC:
|
2019-07-20 13:30:11 +00:00
|
|
|
if (ScriptParams[0] == PEDTYPE_EMERGENCY)
|
2019-07-14 09:49:03 +00:00
|
|
|
ScriptParams[1] = PEDTYPE_EMERGENCY;
|
|
|
|
break;
|
|
|
|
case MI_FIREMAN:
|
2019-07-20 13:30:11 +00:00
|
|
|
if (ScriptParams[0] == PEDTYPE_FIREMAN)
|
2019-07-14 09:49:03 +00:00
|
|
|
ScriptParams[1] = PEDTYPE_FIREMAN;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CPed* ped;
|
|
|
|
if (ScriptParams[0] == PEDTYPE_COP)
|
|
|
|
ped = new CCopPed((eCopType)ScriptParams[1]);
|
|
|
|
else if (ScriptParams[0] == PEDTYPE_EMERGENCY || ScriptParams[0] == PEDTYPE_FIREMAN)
|
|
|
|
ped = new CEmergencyPed(ScriptParams[1]);
|
|
|
|
else
|
2020-02-16 02:15:58 +00:00
|
|
|
ped = new CCivilianPed((ePedType)ScriptParams[0], ScriptParams[1]);
|
2019-07-14 09:49:03 +00:00
|
|
|
ped->CharCreatedBy = MISSION_CHAR;
|
|
|
|
ped->bRespondsToThreats = false;
|
2019-12-31 23:35:54 +00:00
|
|
|
ped->bAllowMedicsToReviveMe = false;
|
2019-07-14 09:49:03 +00:00
|
|
|
CVector pos = *(CVector*)&ScriptParams[2];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-14 09:49:03 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pos.z += 1.0f;
|
2020-05-05 01:45:18 +00:00
|
|
|
ped->SetPosition(pos);
|
2019-07-14 09:49:03 +00:00
|
|
|
ped->SetOrientation(0.0f, 0.0f, 0.0f);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, ped);
|
|
|
|
CWorld::Add(ped);
|
2020-05-06 10:23:26 +00:00
|
|
|
ped->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pos);
|
2019-07-14 09:49:03 +00:00
|
|
|
CPopulation::ms_nTotalMissionPeds++;
|
|
|
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(ped);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ScriptParams[0], CLEANUP_CHAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DELETE_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
if (ped) {
|
2019-12-02 20:02:32 +00:00
|
|
|
if (ped->InVehicle()) {
|
2019-07-14 09:49:03 +00:00
|
|
|
if (ped->m_pMyVehicle->pDriver == ped) {
|
|
|
|
ped->m_pMyVehicle->RemoveDriver();
|
2020-04-30 13:45:45 +00:00
|
|
|
ped->m_pMyVehicle->SetStatus(STATUS_ABANDONED);
|
2019-07-14 09:49:03 +00:00
|
|
|
if (ped->m_pMyVehicle->m_nDoorLock == CARLOCK_LOCKED_INITIALLY)
|
|
|
|
ped->m_pMyVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
|
|
|
|
if (ped->m_nPedType == PEDTYPE_COP && ped->m_pMyVehicle->IsLawEnforcementVehicle())
|
|
|
|
ped->m_pMyVehicle->ChangeLawEnforcerState(0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
ped->m_pMyVehicle->RemovePassenger(ped);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CWorld::RemoveReferencesToDeletedObject(ped);
|
|
|
|
delete ped;
|
|
|
|
--CPopulation::ms_nTotalMissionPeds;
|
|
|
|
}
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(ScriptParams[0], CLEANUP_CHAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CHAR_WANDER_DIR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ped);
|
2019-07-14 09:49:03 +00:00
|
|
|
ped->ClearAll();
|
|
|
|
int8 path = ScriptParams[1];
|
|
|
|
if (ScriptParams[1] < 0 || ScriptParams[1] > 7)
|
2020-07-01 12:28:43 +00:00
|
|
|
// Max number GetRandomNumberInRange returns is max-1
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
path = CGeneral::GetRandomNumberInRange(0, 8);
|
|
|
|
#else
|
2019-07-14 09:49:03 +00:00
|
|
|
path = CGeneral::GetRandomNumberInRange(0, 7);
|
2020-07-01 12:28:43 +00:00
|
|
|
#endif
|
2019-07-14 09:49:03 +00:00
|
|
|
ped->SetWanderPath(path);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-25 20:34:29 +00:00
|
|
|
/* Not implemented.
|
|
|
|
case COMMAND_CHAR_WANDER_RANGE:
|
|
|
|
*/
|
2019-07-14 09:49:03 +00:00
|
|
|
case COMMAND_CHAR_FOLLOW_PATH:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ped);
|
2019-07-14 09:49:03 +00:00
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-14 09:49:03 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
ped->ClearAll();
|
|
|
|
ped->SetFollowPath(pos);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CHAR_SET_IDLE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ped);
|
2019-07-25 20:34:29 +00:00
|
|
|
ped->bScriptObjectiveCompleted = false;
|
2019-07-14 09:49:03 +00:00
|
|
|
ped->SetObjective(OBJECTIVE_IDLE);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_CHAR_COORDINATES:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ped);
|
2019-07-14 09:49:03 +00:00
|
|
|
CVehicle* vehicle;
|
|
|
|
CVector pos;
|
|
|
|
/* Seems a bit clumsy but I'll leave original flow */
|
|
|
|
if (ped->bInVehicle)
|
|
|
|
vehicle = ped->m_pMyVehicle;
|
|
|
|
else
|
|
|
|
vehicle = nil;
|
|
|
|
if (vehicle)
|
|
|
|
pos = vehicle->GetPosition();
|
|
|
|
else
|
|
|
|
pos = ped->GetPosition();
|
|
|
|
*(CVector*)&ScriptParams[0] = pos;
|
|
|
|
StoreParameters(&m_nIp, 3);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_COORDINATES:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ped);
|
2019-07-14 09:49:03 +00:00
|
|
|
CVehicle* vehicle;
|
|
|
|
if (ped->bInVehicle)
|
|
|
|
vehicle = ped->m_pMyVehicle;
|
|
|
|
else
|
|
|
|
vehicle = nil;
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-14 09:49:03 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
/* The following block was once again written
|
|
|
|
* by someone not familiar with virtual functions.
|
|
|
|
* It doesn't require any ifs at all.
|
|
|
|
* To keep as close to original as possible, I'll keep it.
|
|
|
|
* Maybe there was more commented out/debug
|
|
|
|
* stuff, but I doubt it.
|
|
|
|
*/
|
2019-07-14 11:49:27 +00:00
|
|
|
if (!vehicle) {
|
2019-07-14 09:49:03 +00:00
|
|
|
pos.z += ped->GetDistanceFromCentreOfMassToBaseOfModel();
|
|
|
|
ped->Teleport(pos);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, ped);
|
2019-07-14 11:49:27 +00:00
|
|
|
}
|
|
|
|
else if (vehicle->IsBoat()) {
|
2019-07-14 09:49:03 +00:00
|
|
|
pos.z += vehicle->GetDistanceFromCentreOfMassToBaseOfModel();
|
|
|
|
vehicle->Teleport(pos);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, vehicle);
|
2019-07-14 11:49:27 +00:00
|
|
|
}
|
|
|
|
else {
|
2019-07-14 09:49:03 +00:00
|
|
|
pos.z += vehicle->GetDistanceFromCentreOfMassToBaseOfModel();
|
|
|
|
vehicle->Teleport(pos);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, vehicle);
|
|
|
|
}
|
|
|
|
/* Short version of this command.
|
|
|
|
*
|
|
|
|
* CollectParameters(&m_nIp, 4);
|
|
|
|
* CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
* script_assert(ped);
|
2019-07-14 09:49:03 +00:00
|
|
|
* CEntity* entityToMove = ped->bInVehicle ? ped->m_pMyVehicle : ped;
|
|
|
|
* CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
* if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-14 09:49:03 +00:00
|
|
|
* pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2019-07-15 15:13:49 +00:00
|
|
|
* pos.z += entityToMove->GetDistanceFromCentreOfMassToBaseOfModel();
|
2019-07-14 09:49:03 +00:00
|
|
|
* entityToMove->Teleport(pos);
|
|
|
|
* CTheScripts::ClearSpaceForMissionEntity(pos, entityToMove);
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CHAR_STILL_ALIVE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2019-07-25 20:34:29 +00:00
|
|
|
UpdateCompareFlag(ped && ped->GetPedState() != PED_DEAD && ped->GetPedState() != PED_DIE);
|
2019-07-14 09:49:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_2D:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ped);
|
2019-07-14 09:49:03 +00:00
|
|
|
CVehicle* vehicle;
|
|
|
|
if (ped->bInVehicle)
|
|
|
|
vehicle = ped->m_pMyVehicle;
|
|
|
|
else
|
|
|
|
vehicle = nil;
|
2020-01-03 16:48:13 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[1];
|
|
|
|
float y1 = *(float*)&ScriptParams[2];
|
|
|
|
float x2 = *(float*)&ScriptParams[3];
|
|
|
|
float y2 = *(float*)&ScriptParams[4];
|
2019-07-14 09:49:03 +00:00
|
|
|
if (vehicle)
|
|
|
|
UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, x2, y2));
|
|
|
|
else
|
|
|
|
UpdateCompareFlag(ped->IsWithinArea(x1, y1, x2, y2));
|
2019-07-25 20:34:29 +00:00
|
|
|
if (!ScriptParams[5])
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
|
2019-07-14 09:49:03 +00:00
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_3D:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ped);
|
2019-07-14 09:49:03 +00:00
|
|
|
CVehicle* vehicle;
|
|
|
|
if (ped->bInVehicle)
|
|
|
|
vehicle = ped->m_pMyVehicle;
|
|
|
|
else
|
|
|
|
vehicle = nil;
|
2020-01-03 16:48:13 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[1];
|
|
|
|
float y1 = *(float*)&ScriptParams[2];
|
|
|
|
float z1 = *(float*)&ScriptParams[3];
|
|
|
|
float x2 = *(float*)&ScriptParams[4];
|
|
|
|
float y2 = *(float*)&ScriptParams[5];
|
|
|
|
float z2 = *(float*)&ScriptParams[6];
|
2019-07-14 09:49:03 +00:00
|
|
|
if (vehicle)
|
|
|
|
UpdateCompareFlag(ped->m_pMyVehicle->IsWithinArea(x1, y1, z1, x2, y2, z2));
|
|
|
|
else
|
|
|
|
UpdateCompareFlag(ped->IsWithinArea(x1, y1, z1, x2, y2, z2));
|
2019-07-25 20:34:29 +00:00
|
|
|
if (!ScriptParams[7])
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
|
2019-07-14 09:49:03 +00:00
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CREATE_CAR:
|
2019-07-14 11:49:27 +00:00
|
|
|
{
|
2019-07-14 09:49:03 +00:00
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
int32 handle;
|
2019-07-14 11:49:27 +00:00
|
|
|
if (CModelInfo::IsBoatModel(ScriptParams[0])) {
|
2019-07-14 09:49:03 +00:00
|
|
|
CBoat* boat = new CBoat(ScriptParams[0], MISSION_VEHICLE);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-14 09:49:03 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pos.z += boat->GetDistanceFromCentreOfMassToBaseOfModel();
|
2020-05-05 01:45:18 +00:00
|
|
|
boat->SetPosition(pos);
|
2019-07-14 09:49:03 +00:00
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, boat);
|
2020-04-30 13:45:45 +00:00
|
|
|
boat->SetStatus(STATUS_ABANDONED);
|
2019-07-14 11:49:27 +00:00
|
|
|
boat->bIsLocked = true;
|
2019-07-16 17:48:50 +00:00
|
|
|
boat->AutoPilot.m_nCarMission = MISSION_NONE;
|
2019-08-11 17:11:54 +00:00
|
|
|
boat->AutoPilot.m_nTempAction = TEMPACT_NONE; /* Animation ID? */
|
2019-07-16 17:48:50 +00:00
|
|
|
boat->AutoPilot.m_nCruiseSpeed = boat->AutoPilot.m_fMaxTrafficSpeed = 20.0f;
|
2019-07-14 11:49:27 +00:00
|
|
|
CWorld::Add(boat);
|
|
|
|
handle = CPools::GetVehiclePool()->GetIndex(boat);
|
2019-07-14 09:49:03 +00:00
|
|
|
}
|
2019-07-14 11:49:27 +00:00
|
|
|
else {
|
|
|
|
CVehicle* car;
|
|
|
|
if (!CModelInfo::IsBikeModel(ScriptParams[0]))
|
|
|
|
car = new CAutomobile(ScriptParams[0], MISSION_VEHICLE);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-14 11:49:27 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pos.z += car->GetDistanceFromCentreOfMassToBaseOfModel();
|
2020-05-05 01:45:18 +00:00
|
|
|
car->SetPosition(pos);
|
2019-07-14 11:49:27 +00:00
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, car);
|
2020-04-30 13:45:45 +00:00
|
|
|
car->SetStatus(STATUS_ABANDONED);
|
2019-07-14 11:49:27 +00:00
|
|
|
car->bIsLocked = true;
|
2019-07-18 10:23:50 +00:00
|
|
|
CCarCtrl::JoinCarWithRoadSystem(car);
|
2019-07-16 17:48:50 +00:00
|
|
|
car->AutoPilot.m_nCarMission = MISSION_NONE;
|
2019-08-11 17:11:54 +00:00
|
|
|
car->AutoPilot.m_nTempAction = TEMPACT_NONE; /* Animation ID? */
|
2019-07-16 17:48:50 +00:00
|
|
|
car->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
|
|
|
|
car->AutoPilot.m_nCruiseSpeed = car->AutoPilot.m_fMaxTrafficSpeed = 9.0f;
|
2019-08-11 17:11:54 +00:00
|
|
|
car->AutoPilot.m_nCurrentLane = car->AutoPilot.m_nNextLane = 0;
|
2019-07-14 11:49:27 +00:00
|
|
|
car->bEngineOn = false;
|
2020-05-06 10:23:26 +00:00
|
|
|
car->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pos);
|
2019-07-14 11:49:27 +00:00
|
|
|
car->bHasBeenOwnedByPlayer = true;
|
|
|
|
CWorld::Add(car);
|
|
|
|
handle = CPools::GetVehiclePool()->GetIndex(car);
|
|
|
|
}
|
|
|
|
ScriptParams[0] = handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(handle, CLEANUP_CAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DELETE_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
|
|
|
if (car) {
|
|
|
|
CWorld::Remove(car);
|
|
|
|
CWorld::RemoveReferencesToDeletedObject(car);
|
|
|
|
delete car;
|
|
|
|
}
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(ScriptParams[0], CLEANUP_CAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CAR_GOTO_COORDINATES:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(car);
|
2019-07-14 11:49:27 +00:00
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-14 11:49:27 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pos.z += car->GetDistanceFromCentreOfMassToBaseOfModel();
|
|
|
|
if (CCarCtrl::JoinCarWithRoadSystemGotoCoors(car, pos, false))
|
2019-07-16 17:48:50 +00:00
|
|
|
car->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_STRAIGHT;
|
2019-07-14 11:49:27 +00:00
|
|
|
else
|
2019-07-16 17:48:50 +00:00
|
|
|
car->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS;
|
2020-04-30 13:45:45 +00:00
|
|
|
car->SetStatus(STATUS_PHYSICS);
|
2019-07-14 11:49:27 +00:00
|
|
|
car->bEngineOn = true;
|
2020-06-07 22:16:21 +00:00
|
|
|
car->AutoPilot.m_nCruiseSpeed = Max(6, car->AutoPilot.m_nCruiseSpeed);
|
2019-10-12 19:19:54 +00:00
|
|
|
car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
|
2019-07-14 11:49:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CAR_WANDER_RANDOMLY:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(car);
|
2019-07-14 11:49:27 +00:00
|
|
|
CCarCtrl::JoinCarWithRoadSystem(car);
|
2019-07-16 17:48:50 +00:00
|
|
|
car->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
2019-07-14 11:49:27 +00:00
|
|
|
car->bEngineOn = true;
|
2020-06-07 22:16:21 +00:00
|
|
|
car->AutoPilot.m_nCruiseSpeed = Max(6, car->AutoPilot.m_nCruiseSpeed);
|
2019-10-12 19:19:54 +00:00
|
|
|
car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
|
2019-07-14 11:49:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CAR_SET_IDLE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(car);
|
2019-07-16 17:48:50 +00:00
|
|
|
car->AutoPilot.m_nCarMission = MISSION_NONE;
|
2019-07-14 11:49:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_CAR_COORDINATES:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(car);
|
2019-07-14 11:49:27 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = car->GetPosition();
|
|
|
|
StoreParameters(&m_nIp, 3);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CAR_COORDINATES:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(car);
|
2019-07-14 11:49:27 +00:00
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-14 11:49:27 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pos.z += car->GetDistanceFromCentreOfMassToBaseOfModel();
|
|
|
|
car->bIsStatic = false;
|
|
|
|
/* Again weird usage of virtual functions. */
|
|
|
|
if (car->IsBoat()) {
|
|
|
|
car->Teleport(pos);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, car);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
car->Teleport(pos);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, car);
|
|
|
|
/* May the following be inlined CCarCtrl function? */
|
2019-07-16 17:48:50 +00:00
|
|
|
switch (car->AutoPilot.m_nCarMission) {
|
2019-07-14 11:49:27 +00:00
|
|
|
case MISSION_CRUISE:
|
|
|
|
CCarCtrl::JoinCarWithRoadSystem(car);
|
|
|
|
break;
|
|
|
|
case MISSION_RAMPLAYER_FARAWAY:
|
|
|
|
case MISSION_RAMPLAYER_CLOSE:
|
|
|
|
case MISSION_BLOCKPLAYER_FARAWAY:
|
|
|
|
case MISSION_BLOCKPLAYER_CLOSE:
|
|
|
|
case MISSION_BLOCKPLAYER_HANDBRAKESTOP:
|
|
|
|
CCarCtrl::JoinCarWithRoadSystemGotoCoors(car, FindPlayerCoors(), false);
|
|
|
|
break;
|
|
|
|
case MISSION_GOTOCOORDS:
|
|
|
|
case MISSION_GOTOCOORDS_STRAIGHT:
|
2019-07-16 17:48:50 +00:00
|
|
|
CCarCtrl::JoinCarWithRoadSystemGotoCoors(car, car->AutoPilot.m_vecDestinationCoors, false);
|
2019-07-14 11:49:27 +00:00
|
|
|
break;
|
|
|
|
case MISSION_GOTOCOORDS_ACCURATE:
|
|
|
|
case MISSION_GOTO_COORDS_STRAIGHT_ACCURATE:
|
2019-07-16 17:48:50 +00:00
|
|
|
CCarCtrl::JoinCarWithRoadSystemGotoCoors(car, car->AutoPilot.m_vecDestinationCoors, false);
|
2019-07-14 11:49:27 +00:00
|
|
|
break;
|
|
|
|
case MISSION_RAMCAR_FARAWAY:
|
|
|
|
case MISSION_RAMCAR_CLOSE:
|
|
|
|
case MISSION_BLOCKCAR_FARAWAY:
|
|
|
|
case MISSION_BLOCKCAR_CLOSE:
|
|
|
|
case MISSION_BLOCKCAR_HANDBRAKESTOP:
|
2019-07-16 17:48:50 +00:00
|
|
|
CCarCtrl::JoinCarWithRoadSystemGotoCoors(car, car->AutoPilot.m_pTargetCar->GetPosition(), false);
|
2019-07-14 11:49:27 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CAR_STILL_ALIVE:
|
|
|
|
{
|
2019-07-25 20:34:29 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2019-07-14 11:49:27 +00:00
|
|
|
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-04-30 13:45:45 +00:00
|
|
|
UpdateCompareFlag(car && car->GetStatus() != STATUS_WRECKED && (car->IsBoat() || !car->bIsInWater));
|
2019-07-14 11:49:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CAR_CRUISE_SPEED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(car);
|
2020-05-26 21:25:12 +00:00
|
|
|
#if defined MISSION_REPLAY && defined SIMPLIER_MISSIONS
|
|
|
|
car->AutoPilot.m_nCruiseSpeed = *(float*)&ScriptParams[1];
|
|
|
|
if (missionRetryScriptIndex == 40 && car->GetModelIndex() == MI_CHEETAH) // Turismo
|
|
|
|
car->AutoPilot.m_nCruiseSpeed = 8 * car->AutoPilot.m_nCruiseSpeed / 10;
|
|
|
|
car->AutoPilot.m_nCruiseSpeed = Min(car->AutoPilot.m_nCruiseSpeed, 60.0f * car->pHandling->Transmission.fUnkMaxVelocity);
|
|
|
|
#else
|
2020-04-19 16:34:08 +00:00
|
|
|
car->AutoPilot.m_nCruiseSpeed = Min(*(float*)&ScriptParams[1], 60.0f * car->pHandling->Transmission.fUnkMaxVelocity);
|
2020-05-26 21:25:12 +00:00
|
|
|
#endif
|
2019-07-14 11:49:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CAR_DRIVING_STYLE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(car);
|
2019-07-16 17:48:50 +00:00
|
|
|
car->AutoPilot.m_nDrivingStyle = (eCarDrivingStyle)ScriptParams[1];
|
2019-07-14 11:49:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CAR_MISSION:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(car);
|
2019-07-16 17:48:50 +00:00
|
|
|
car->AutoPilot.m_nCarMission = (eCarMission)ScriptParams[1];
|
2019-10-12 19:19:54 +00:00
|
|
|
car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
|
2019-07-14 11:49:27 +00:00
|
|
|
car->bEngineOn = true;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CAR_IN_AREA_2D:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CVehicle* vehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(vehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[1];
|
|
|
|
float y1 = *(float*)&ScriptParams[2];
|
|
|
|
float x2 = *(float*)&ScriptParams[3];
|
|
|
|
float y2 = *(float*)&ScriptParams[4];
|
2019-07-14 11:49:27 +00:00
|
|
|
UpdateCompareFlag(vehicle->IsWithinArea(x1, y1, x2, y2));
|
2019-07-25 20:34:29 +00:00
|
|
|
if (!ScriptParams[5])
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
|
2019-07-14 11:49:27 +00:00
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CAR_IN_AREA_3D:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CVehicle* vehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(vehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[1];
|
|
|
|
float y1 = *(float*)&ScriptParams[2];
|
|
|
|
float z1 = *(float*)&ScriptParams[3];
|
|
|
|
float x2 = *(float*)&ScriptParams[4];
|
|
|
|
float y2 = *(float*)&ScriptParams[5];
|
|
|
|
float z2 = *(float*)&ScriptParams[6];
|
2019-07-14 11:49:27 +00:00
|
|
|
UpdateCompareFlag(vehicle->IsWithinArea(x1, y1, z1, x2, y2, z2));
|
2019-07-25 20:34:29 +00:00
|
|
|
if (!ScriptParams[7])
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
|
2019-07-14 11:49:27 +00:00
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SPECIAL_0:
|
|
|
|
case COMMAND_SPECIAL_1:
|
|
|
|
case COMMAND_SPECIAL_2:
|
|
|
|
case COMMAND_SPECIAL_3:
|
|
|
|
case COMMAND_SPECIAL_4:
|
|
|
|
case COMMAND_SPECIAL_5:
|
|
|
|
case COMMAND_SPECIAL_6:
|
|
|
|
case COMMAND_SPECIAL_7:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-07-14 11:49:27 +00:00
|
|
|
return 0;
|
|
|
|
case COMMAND_PRINT_BIG:
|
|
|
|
{
|
|
|
|
wchar* key = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]);
|
2020-05-26 21:25:12 +00:00
|
|
|
#ifdef MISSION_REPLAY
|
|
|
|
if (strcmp((char*)&CTheScripts::ScriptSpace[m_nIp], "M_FAIL") == 0 && CanAllowMissionReplay())
|
|
|
|
AllowMissionReplay = 1;
|
|
|
|
#endif
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-07-14 11:49:27 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CMessages::AddBigMessage(key, ScriptParams[0], ScriptParams[1] - 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_PRINT:
|
|
|
|
{
|
|
|
|
wchar* key = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-07-14 11:49:27 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CMessages::AddMessage(key, ScriptParams[0], ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_PRINT_NOW:
|
|
|
|
{
|
|
|
|
wchar* key = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-07-14 11:49:27 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CMessages::AddMessageJumpQ(key, ScriptParams[0], ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_PRINT_SOON:
|
|
|
|
{
|
|
|
|
wchar* key = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-07-14 11:49:27 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
2019-10-20 22:08:26 +00:00
|
|
|
CMessages::AddMessageSoon(key, ScriptParams[0], ScriptParams[1]);
|
2019-07-14 11:49:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CLEAR_PRINTS:
|
|
|
|
CMessages::ClearMessages();
|
|
|
|
return 0;
|
|
|
|
case COMMAND_GET_TIME_OF_DAY:
|
|
|
|
ScriptParams[0] = CClock::GetHours();
|
|
|
|
ScriptParams[1] = CClock::GetMinutes();
|
|
|
|
StoreParameters(&m_nIp, 2);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_TIME_OF_DAY:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CClock::SetGameClock(ScriptParams[0], ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_GET_MINUTES_TO_TIME_OF_DAY:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
ScriptParams[0] = CClock::GetGameClockMinutesUntil(ScriptParams[0], ScriptParams[1]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_IS_POINT_ON_SCREEN:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
if (pos.z <= -100)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
UpdateCompareFlag(TheCamera.IsSphereVisible(pos, *(float*)&ScriptParams[3]));
|
2020-04-05 23:01:03 +00:00
|
|
|
return 0;
|
2019-07-14 11:49:27 +00:00
|
|
|
}
|
|
|
|
case COMMAND_DEBUG_ON:
|
|
|
|
CTheScripts::DbgFlag = true;
|
|
|
|
return 0;
|
|
|
|
case COMMAND_DEBUG_OFF:
|
|
|
|
CTheScripts::DbgFlag = false;
|
|
|
|
return 0;
|
|
|
|
case COMMAND_RETURN_TRUE:
|
|
|
|
UpdateCompareFlag(true);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_RETURN_FALSE:
|
|
|
|
UpdateCompareFlag(false);
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
/* Special command only used by compiler.
|
2019-07-25 20:34:29 +00:00
|
|
|
case COMMAND_VAR_INT:
|
|
|
|
*/
|
2019-07-14 11:49:27 +00:00
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-07-14 11:49:27 +00:00
|
|
|
break;
|
2019-07-14 09:49:03 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands200To299(int32 command)
|
2020-05-11 02:55:57 +00:00
|
|
|
{
|
2019-07-25 20:34:29 +00:00
|
|
|
switch (command) {
|
2020-05-11 02:55:57 +00:00
|
|
|
/* Special commands.
|
2019-07-25 20:34:29 +00:00
|
|
|
case COMMAND_VAR_FLOAT:
|
|
|
|
case COMMAND_LVAR_INT:
|
|
|
|
case COMMAND_LVAR_FLOAT:
|
|
|
|
case COMMAND_LBRACKET:
|
|
|
|
case COMMAND_RBRACKET:
|
|
|
|
case COMMAND_REPEAT:
|
|
|
|
case COMMAND_ENDREPEAT:
|
|
|
|
case COMMAND_IF:
|
|
|
|
case COMMAND_IFNOT:
|
|
|
|
case COMMAND_ELSE:
|
|
|
|
case COMMAND_ENDIF:
|
|
|
|
case COMMAND_WHILE:
|
|
|
|
case COMMAND_WHILENOT:
|
|
|
|
case COMMAND_ENDWHILE:
|
|
|
|
*/
|
|
|
|
case COMMAND_ANDOR:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
m_nAndOrState = ScriptParams[0];
|
|
|
|
if (m_nAndOrState == ANDOR_NONE){
|
|
|
|
m_bCondResult = false; // pointless
|
|
|
|
}else if (m_nAndOrState >= ANDS_1 && m_nAndOrState <= ANDS_8){
|
|
|
|
m_bCondResult = true;
|
|
|
|
m_nAndOrState++;
|
|
|
|
}else if (m_nAndOrState >= ORS_1 && m_nAndOrState <= ORS_8){
|
|
|
|
m_bCondResult = false;
|
|
|
|
m_nAndOrState++;
|
|
|
|
}else{
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0 && "COMMAND_ANDOR: invalid ANDOR state");
|
2019-07-25 20:34:29 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LAUNCH_MISSION:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CRunningScript* pNew = CTheScripts::StartNewScript(ScriptParams[0]);
|
|
|
|
pNew->m_bIsMissionScript = true;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_MISSION_HAS_FINISHED:
|
|
|
|
{
|
|
|
|
if (!m_bIsMissionScript)
|
|
|
|
return 0;
|
|
|
|
if (strcmp(m_abScriptName, "love3") == 0) /* A Drop in the Ocean */
|
|
|
|
CPickups::RemoveAllFloatingPickups();
|
|
|
|
CTheScripts::MissionCleanup.Process();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_STORE_CAR_CHAR_IS_IN:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ped);
|
2019-07-25 20:34:29 +00:00
|
|
|
CVehicle* pCurrent = nil;
|
|
|
|
if (ped->bInVehicle) {
|
|
|
|
pCurrent = ped->m_pMyVehicle;
|
|
|
|
}
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pCurrent); // GetIndex(0) doesn't look good
|
2019-07-25 20:34:29 +00:00
|
|
|
int handle = CPools::GetVehiclePool()->GetIndex(pCurrent);
|
|
|
|
if (handle != CTheScripts::StoreVehicleIndex && m_bIsMissionScript){
|
2020-04-23 22:40:12 +00:00
|
|
|
CVehicle* pOld = CPools::GetVehiclePool()->GetAt(CTheScripts::StoreVehicleIndex);
|
|
|
|
if (pOld){
|
|
|
|
CCarCtrl::RemoveFromInterestingVehicleList(pOld);
|
|
|
|
if (pOld->VehicleCreatedBy == MISSION_VEHICLE && CTheScripts::StoreVehicleWasRandom){
|
|
|
|
pOld->VehicleCreatedBy = RANDOM_VEHICLE;
|
|
|
|
pOld->bIsLocked = false;
|
|
|
|
CCarCtrl::NumRandomCars++;
|
|
|
|
CCarCtrl::NumMissionCars--;
|
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR);
|
2019-07-25 20:34:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-11-19 22:15:45 +00:00
|
|
|
|
2019-07-25 20:34:29 +00:00
|
|
|
CTheScripts::StoreVehicleIndex = handle;
|
|
|
|
switch (pCurrent->VehicleCreatedBy){
|
|
|
|
case RANDOM_VEHICLE:
|
|
|
|
pCurrent->VehicleCreatedBy = MISSION_VEHICLE;
|
|
|
|
CCarCtrl::NumMissionCars++;
|
|
|
|
CCarCtrl::NumRandomCars--;
|
|
|
|
CTheScripts::StoreVehicleWasRandom = true;
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR);
|
|
|
|
break;
|
|
|
|
case PARKED_VEHICLE:
|
|
|
|
pCurrent->VehicleCreatedBy = MISSION_VEHICLE;
|
|
|
|
CCarCtrl::NumMissionCars++;
|
|
|
|
CCarCtrl::NumParkedCars--;
|
|
|
|
CTheScripts::StoreVehicleWasRandom = true;
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR);
|
|
|
|
break;
|
|
|
|
case MISSION_VEHICLE:
|
|
|
|
case PERMANENT_VEHICLE:
|
|
|
|
CTheScripts::StoreVehicleWasRandom = false;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ScriptParams[0] = CTheScripts::StoreVehicleIndex;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_STORE_CAR_PLAYER_IS_IN:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* ped = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ped);
|
2019-07-25 20:34:29 +00:00
|
|
|
if (!ped->bInVehicle)
|
|
|
|
return 0; // No value written to output variable
|
|
|
|
CVehicle* pCurrent = ped->m_pMyVehicle;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pCurrent); // Here pCurrent shouldn't be NULL anyway
|
2019-07-25 20:34:29 +00:00
|
|
|
int handle = CPools::GetVehiclePool()->GetIndex(pCurrent);
|
|
|
|
if (handle != CTheScripts::StoreVehicleIndex && m_bIsMissionScript) {
|
2020-04-23 22:40:12 +00:00
|
|
|
CVehicle* pOld = CPools::GetVehiclePool()->GetAt(CTheScripts::StoreVehicleIndex);
|
|
|
|
if (pOld){
|
|
|
|
CCarCtrl::RemoveFromInterestingVehicleList(pOld);
|
|
|
|
if (pOld->VehicleCreatedBy == MISSION_VEHICLE && CTheScripts::StoreVehicleWasRandom){
|
|
|
|
pOld->VehicleCreatedBy = RANDOM_VEHICLE;
|
|
|
|
pOld->bIsLocked = false;
|
|
|
|
CCarCtrl::NumRandomCars++;
|
|
|
|
CCarCtrl::NumMissionCars--;
|
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR);
|
2019-07-25 20:34:29 +00:00
|
|
|
}
|
|
|
|
}
|
2019-11-19 22:15:45 +00:00
|
|
|
|
2019-07-25 20:34:29 +00:00
|
|
|
CTheScripts::StoreVehicleIndex = handle;
|
|
|
|
switch (pCurrent->VehicleCreatedBy) {
|
|
|
|
case RANDOM_VEHICLE:
|
|
|
|
pCurrent->VehicleCreatedBy = MISSION_VEHICLE;
|
|
|
|
CCarCtrl::NumMissionCars++;
|
|
|
|
CCarCtrl::NumRandomCars--;
|
|
|
|
CTheScripts::StoreVehicleWasRandom = true;
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR);
|
|
|
|
break;
|
|
|
|
case PARKED_VEHICLE:
|
|
|
|
pCurrent->VehicleCreatedBy = MISSION_VEHICLE;
|
|
|
|
CCarCtrl::NumMissionCars++;
|
|
|
|
CCarCtrl::NumParkedCars--;
|
|
|
|
CTheScripts::StoreVehicleWasRandom = true;
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR);
|
|
|
|
break;
|
|
|
|
case MISSION_VEHICLE:
|
|
|
|
case PERMANENT_VEHICLE:
|
|
|
|
CTheScripts::StoreVehicleWasRandom = false;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ScriptParams[0] = CTheScripts::StoreVehicleIndex;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CHAR_IN_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
CVehicle* pCheckedVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
|
|
|
CVehicle* pActualVehicle = pPed->bInVehicle ? pPed->m_pMyVehicle : nil;
|
|
|
|
UpdateCompareFlag(pActualVehicle && pActualVehicle == pCheckedVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_IN_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pCheckedVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
|
|
|
UpdateCompareFlag(pPed->bInVehicle && pPed->m_pMyVehicle == pCheckedVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CHAR_IN_MODEL:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
CVehicle* pActualVehicle = pPed->bInVehicle ? pPed->m_pMyVehicle : nil;
|
|
|
|
UpdateCompareFlag(pActualVehicle && pActualVehicle->GetModelIndex() == ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_IN_MODEL:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
|
|
|
UpdateCompareFlag(pPed->bInVehicle && pPed->m_pMyVehicle->GetModelIndex() == ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CHAR_IN_ANY_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
UpdateCompareFlag(pPed->bInVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANY_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
|
|
|
UpdateCompareFlag(pPed->bInVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_BUTTON_PRESSED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
bool value = GetPadState(ScriptParams[0], ScriptParams[1]) != 0;
|
2020-02-24 18:17:15 +00:00
|
|
|
if (CGame::playingIntro && ScriptParams[0] == 0 && ScriptParams[1] == 12) {
|
2019-07-25 20:34:29 +00:00
|
|
|
if (CPad::GetPad(0)->GetLeftMouseJustDown() ||
|
2020-02-24 18:17:15 +00:00
|
|
|
CPad::GetPad(0)->GetEnterJustDown() ||
|
2019-07-25 20:34:29 +00:00
|
|
|
CPad::GetPad(0)->GetCharJustDown(' '))
|
|
|
|
value = true;
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(value);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_PAD_STATE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
ScriptParams[0] = GetPadState(ScriptParams[0], ScriptParams[1]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_IN_CAR_2D:
|
|
|
|
LocatePlayerCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_CHAR_2D:
|
|
|
|
LocatePlayerCharCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_IN_CAR_2D:
|
|
|
|
LocateCharCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_CHAR_2D:
|
|
|
|
LocateCharCharCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ON_FOOT_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_IN_CAR_3D:
|
|
|
|
LocatePlayerCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_CHAR_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_CHAR_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_CHAR_3D:
|
|
|
|
LocatePlayerCharCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ON_FOOT_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_IN_CAR_3D:
|
|
|
|
LocateCharCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_CHAR_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_CHAR_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_CHAR_3D:
|
|
|
|
LocateCharCharCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_CREATE_OBJECT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
int mi = ScriptParams[0] >= 0 ? ScriptParams[0] : CTheScripts::UsedObjectArray[-ScriptParams[0]].index;
|
2020-01-01 20:55:01 +00:00
|
|
|
CObject* pObj = new CObject(mi, false);
|
2019-07-25 20:34:29 +00:00
|
|
|
pObj->ObjectCreatedBy = MISSION_OBJECT;
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-25 20:34:29 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pos.z += pObj->GetDistanceFromCentreOfMassToBaseOfModel();
|
2020-05-05 01:45:18 +00:00
|
|
|
pObj->SetPosition(pos);
|
2019-07-25 20:34:29 +00:00
|
|
|
pObj->SetOrientation(0.0f, 0.0f, 0.0f);
|
|
|
|
pObj->GetMatrix().UpdateRW();
|
|
|
|
pObj->UpdateRwFrame();
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, pObj);
|
|
|
|
CWorld::Add(pObj);
|
|
|
|
ScriptParams[0] = CPools::GetObjectPool()->GetIndex(pObj);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ScriptParams[0], CLEANUP_OBJECT);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DELETE_OBJECT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pObj = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
|
|
|
if (pObj){
|
|
|
|
CWorld::Remove(pObj);
|
|
|
|
CWorld::RemoveReferencesToDeletedObject(pObj);
|
|
|
|
delete pObj;
|
|
|
|
}
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(ScriptParams[0], CLEANUP_OBJECT);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_SCORE:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CWorld::Players[ScriptParams[0]].m_nMoney += ScriptParams[1];
|
|
|
|
return 0;
|
|
|
|
case COMMAND_IS_SCORE_GREATER:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
UpdateCompareFlag(CWorld::Players[ScriptParams[0]].m_nMoney > ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_STORE_SCORE:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
ScriptParams[0] = CWorld::Players[ScriptParams[0]].m_nMoney;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_GIVE_REMOTE_CONTROLLED_CAR_TO_PLAYER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-25 20:34:29 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2019-07-26 07:44:56 +00:00
|
|
|
CRemote::GivePlayerRemoteControlledCar(pos.x, pos.y, pos.z, DEGTORAD(*(float*)&ScriptParams[4]), MI_RCBANDIT);
|
2019-07-25 20:34:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ALTER_WANTED_LEVEL:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CWorld::Players[ScriptParams[0]].m_pPed->SetWantedLevel(ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_ALTER_WANTED_LEVEL_NO_DROP:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CWorld::Players[ScriptParams[0]].m_pPed->SetWantedLevelNoDrop(ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_IS_WANTED_LEVEL_GREATER:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
UpdateCompareFlag(CWorld::Players[ScriptParams[0]].m_pPed->m_pWanted->m_nWantedLevel > ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_CLEAR_WANTED_LEVEL:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CWorld::Players[ScriptParams[0]].m_pPed->SetWantedLevel(0);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_DEATHARREST_STATE:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
m_bDeatharrestEnabled = (ScriptParams[0] == 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_HAS_DEATHARREST_BEEN_EXECUTED:
|
|
|
|
UpdateCompareFlag(m_bDeatharrestExecuted);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_AMMO_TO_PLAYER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CWorld::Players[ScriptParams[0]].m_pPed->GrantAmmo((eWeaponType)ScriptParams[1], ScriptParams[2]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_AMMO_TO_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-07-25 20:34:29 +00:00
|
|
|
pPed->GrantAmmo((eWeaponType)ScriptParams[1], ScriptParams[2]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented
|
|
|
|
case COMMAND_ADD_AMMO_TO_CAR:
|
|
|
|
case COMMAND_IS_PLAYER_STILL_ALIVE:
|
|
|
|
*/
|
|
|
|
case COMMAND_IS_PLAYER_DEAD:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CWorld::Players[ScriptParams[0]].m_WBState == WBSTATE_WASTED);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_IS_CHAR_DEAD:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
UpdateCompareFlag(!pPed || pPed->GetPedState() == PED_DIE || pPed->GetPedState() == PED_DEAD);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CAR_DEAD:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-04-30 13:45:45 +00:00
|
|
|
UpdateCompareFlag(!pVehicle || pVehicle->GetStatus() == STATUS_WRECKED || !pVehicle->IsBoat() && pVehicle->bIsInWater);
|
2019-07-25 20:34:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_THREAT_SEARCH:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-07-25 20:34:29 +00:00
|
|
|
pPed->m_fearFlags |= ScriptParams[1];
|
|
|
|
return 0;
|
|
|
|
}
|
2020-05-11 02:55:57 +00:00
|
|
|
/* Not implemented.
|
2019-07-25 20:34:29 +00:00
|
|
|
case COMMAND_SET_CHAR_THREAT_REACTION:
|
|
|
|
*/
|
|
|
|
case COMMAND_SET_CHAR_OBJ_NO_OBJ:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-07-25 20:34:29 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->ClearObjective();
|
|
|
|
return 0;
|
|
|
|
}
|
2020-05-11 02:55:57 +00:00
|
|
|
/* Not implemented.
|
2019-07-25 20:34:29 +00:00
|
|
|
case COMMAND_ORDER_DRIVER_OUT_OF_CAR:
|
|
|
|
case COMMAND_ORDER_CHAR_TO_DRIVE_CAR:
|
|
|
|
case COMMAND_ADD_PATROL_POINT:
|
|
|
|
case COMMAND_IS_PLAYER_IN_GANGZONE:
|
|
|
|
*/
|
|
|
|
case COMMAND_IS_PLAYER_IN_ZONE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPlayerInfo* pPlayer = &CWorld::Players[ScriptParams[0]];
|
|
|
|
char label[12];
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, label);
|
2019-07-25 20:34:29 +00:00
|
|
|
int zoneToCheck = CTheZones::FindZoneByLabelAndReturnIndex(label);
|
|
|
|
if (zoneToCheck != -1)
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT; /* why only if zone != 1? */
|
2019-07-25 20:34:29 +00:00
|
|
|
CVector pos = pPlayer->GetPos();
|
|
|
|
CZone* pZone = CTheZones::GetZone(zoneToCheck);
|
2020-05-06 10:23:26 +00:00
|
|
|
UpdateCompareFlag(CTheZones::PointLiesWithinZone(&pos, pZone));
|
2019-07-25 20:34:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_PRESSING_HORN:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CWorld::Players[ScriptParams[0]].m_pPed->GetPedState() == PED_DRIVING &&
|
|
|
|
CPad::GetPad(ScriptParams[0])->GetHorn());
|
|
|
|
/* Is it correct that same parameter is used both as index of Players */
|
|
|
|
/* and as ID of pad? Pratically this parameter is always 0 anyway of course. */
|
|
|
|
return 0;
|
|
|
|
case COMMAND_HAS_CHAR_SPOTTED_PLAYER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-07-25 20:34:29 +00:00
|
|
|
UpdateCompareFlag(pPed->OurPedCanSeeThisOne(CWorld::Players[ScriptParams[1]].m_pPed));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented.
|
|
|
|
case COMMAND_ORDER_CHAR_TO_BACKDOOR:
|
|
|
|
case COMMAND_ADD_CHAR_TO_GANG:
|
|
|
|
*/
|
|
|
|
case COMMAND_IS_CHAR_OBJECTIVE_PASSED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-07-25 20:34:29 +00:00
|
|
|
UpdateCompareFlag(pPed->bScriptObjectiveCompleted);
|
|
|
|
return 0;
|
|
|
|
}
|
2020-05-11 02:55:57 +00:00
|
|
|
/* Not implemented.
|
2019-07-25 20:34:29 +00:00
|
|
|
case COMMAND_SET_CHAR_DRIVE_AGGRESSION:
|
|
|
|
case COMMAND_SET_CHAR_MAX_DRIVESPEED:
|
|
|
|
*/
|
|
|
|
case COMMAND_CREATE_CHAR_INSIDE_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-07-25 20:34:29 +00:00
|
|
|
switch (ScriptParams[2]) {
|
|
|
|
case MI_COP:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_COP)
|
|
|
|
ScriptParams[2] = COP_STREET;
|
|
|
|
break;
|
|
|
|
case MI_SWAT:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_COP)
|
|
|
|
ScriptParams[2] = COP_SWAT;
|
|
|
|
break;
|
|
|
|
case MI_FBI:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_COP)
|
|
|
|
ScriptParams[2] = COP_FBI;
|
|
|
|
break;
|
|
|
|
case MI_ARMY:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_COP)
|
|
|
|
ScriptParams[2] = COP_ARMY;
|
|
|
|
break;
|
|
|
|
case MI_MEDIC:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_EMERGENCY)
|
|
|
|
ScriptParams[2] = PEDTYPE_EMERGENCY;
|
|
|
|
break;
|
|
|
|
case MI_FIREMAN:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_FIREMAN)
|
|
|
|
ScriptParams[2] = PEDTYPE_FIREMAN;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CPed* pPed;
|
|
|
|
if (ScriptParams[1] == PEDTYPE_COP)
|
|
|
|
pPed = new CCopPed((eCopType)ScriptParams[2]);
|
|
|
|
else if (ScriptParams[1] == PEDTYPE_EMERGENCY || ScriptParams[1] == PEDTYPE_FIREMAN)
|
|
|
|
pPed = new CEmergencyPed(ScriptParams[2]);
|
|
|
|
else
|
2020-02-16 02:15:58 +00:00
|
|
|
pPed = new CCivilianPed((ePedType)ScriptParams[1], ScriptParams[2]);
|
2019-07-25 20:34:29 +00:00
|
|
|
pPed->CharCreatedBy = MISSION_CHAR;
|
|
|
|
pPed->bRespondsToThreats = false;
|
2019-12-31 23:35:54 +00:00
|
|
|
pPed->bAllowMedicsToReviveMe = false;
|
2020-05-05 01:45:18 +00:00
|
|
|
pPed->SetPosition(pVehicle->GetPosition());
|
2019-07-25 20:34:29 +00:00
|
|
|
pPed->SetOrientation(0.0f, 0.0f, 0.0f);
|
|
|
|
pPed->SetPedState(PED_DRIVING);
|
|
|
|
CPopulation::ms_nTotalMissionPeds++;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(!pVehicle->pDriver);
|
2019-07-25 20:34:29 +00:00
|
|
|
pVehicle->pDriver = pPed;
|
|
|
|
pVehicle->pDriver->RegisterReference((CEntity**)&pVehicle->pDriver);
|
|
|
|
pPed->m_pMyVehicle = pVehicle;
|
|
|
|
pPed->m_pMyVehicle->RegisterReference((CEntity**)&pPed->m_pMyVehicle);
|
|
|
|
pPed->bInVehicle = true;
|
2020-04-30 13:45:45 +00:00
|
|
|
pVehicle->SetStatus(STATUS_PHYSICS);
|
2019-07-25 20:34:29 +00:00
|
|
|
if (!pVehicle->IsBoat())
|
|
|
|
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
|
|
|
pVehicle->bEngineOn = true;
|
|
|
|
pPed->bUsesCollision = false;
|
2020-03-01 01:43:30 +00:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
AnimationId anim = pVehicle->GetDriverAnim();
|
|
|
|
#else
|
2019-07-25 20:34:29 +00:00
|
|
|
AnimationId anim = pVehicle->bLowVehicle ? ANIM_CAR_LSIT : ANIM_CAR_SIT;
|
2020-03-01 01:43:30 +00:00
|
|
|
#endif
|
2019-07-25 20:34:29 +00:00
|
|
|
pPed->m_pVehicleAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, anim, 100.0f);
|
|
|
|
pPed->StopNonPartialAnims();
|
2020-05-06 10:23:26 +00:00
|
|
|
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
|
2019-07-25 20:34:29 +00:00
|
|
|
CWorld::Add(pPed);
|
|
|
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ScriptParams[0], CLEANUP_CHAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_WARP_PLAYER_FROM_CAR_TO_COORD:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
|
|
|
CPlayerInfo* pPlayer = &CWorld::Players[ScriptParams[0]];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-07-25 20:34:29 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
if (pPlayer->m_pPed->bInVehicle){
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPlayer->m_pPed->m_pMyVehicle);
|
2019-07-25 20:34:29 +00:00
|
|
|
if (pPlayer->m_pPed->m_pMyVehicle->bIsBus)
|
|
|
|
pPlayer->m_pPed->bRenderPedInCar = true;
|
|
|
|
if (pPlayer->m_pPed->m_pMyVehicle->pDriver == pPlayer->m_pPed){
|
|
|
|
pPlayer->m_pPed->m_pMyVehicle->RemoveDriver();
|
2020-04-30 13:45:45 +00:00
|
|
|
pPlayer->m_pPed->m_pMyVehicle->SetStatus(STATUS_ABANDONED);
|
2019-07-25 20:34:29 +00:00
|
|
|
pPlayer->m_pPed->m_pMyVehicle->bEngineOn = false;
|
|
|
|
pPlayer->m_pPed->m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
|
|
|
|
}else{
|
|
|
|
pPlayer->m_pPed->m_pMyVehicle->RemovePassenger(pPlayer->m_pPed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pPlayer->m_pPed->bInVehicle = false;
|
|
|
|
pPlayer->m_pPed->m_pMyVehicle = nil;
|
|
|
|
pPlayer->m_pPed->SetPedState(PED_IDLE);
|
|
|
|
pPlayer->m_pPed->bUsesCollision = true;
|
|
|
|
pPlayer->m_pPed->SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
|
|
|
pPlayer->m_pPed->AddWeaponModel(CWeaponInfo::GetWeaponInfo(pPlayer->m_pPed->GetWeapon()->m_eWeaponType)->m_nModelId);
|
|
|
|
pPlayer->m_pPed->RemoveInCarAnims();
|
|
|
|
if (pPlayer->m_pPed->m_pVehicleAnim)
|
|
|
|
pPlayer->m_pPed->m_pVehicleAnim->blendDelta = -1000.0f;
|
|
|
|
pPlayer->m_pPed->m_pVehicleAnim = nil;
|
|
|
|
pPlayer->m_pPed->SetMoveState(PEDMOVE_NONE);
|
|
|
|
CAnimManager::BlendAnimation(pPlayer->m_pPed->GetClump(), pPlayer->m_pPed->m_animGroup, ANIM_IDLE_STANCE, 100.0f);
|
|
|
|
pPlayer->m_pPed->RestartNonPartialAnims();
|
|
|
|
AudioManager.PlayerJustLeftCar();
|
|
|
|
pos.z += pPlayer->m_pPed->GetDistanceFromCentreOfMassToBaseOfModel();
|
|
|
|
pPlayer->m_pPed->Teleport(pos);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, pPlayer->m_pPed);
|
|
|
|
return 0;
|
|
|
|
}
|
2020-05-11 02:55:57 +00:00
|
|
|
/* Not implemented.
|
2019-07-25 20:34:29 +00:00
|
|
|
case COMMAND_MAKE_CHAR_DO_NOTHING:
|
|
|
|
*/
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-07-25 20:34:29 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands300To399(int32 command)
|
2019-07-27 18:28:18 +00:00
|
|
|
{
|
|
|
|
switch (command) {
|
|
|
|
/* Not implemented.
|
|
|
|
case COMMAND_SET_CHAR_INVINCIBLE:
|
|
|
|
case COMMAND_SET_PLAYER_INVINCIBLE:
|
|
|
|
case COMMAND_SET_CHAR_GRAPHIC_TYPE:
|
|
|
|
case COMMAND_SET_PLAYER_GRAPHIC_TYPE:
|
|
|
|
*/
|
|
|
|
case COMMAND_HAS_PLAYER_BEEN_ARRESTED:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CWorld::Players[ScriptParams[0]].m_WBState == WBSTATE_BUSTED);
|
|
|
|
return 0;
|
|
|
|
/* Not implemented.
|
|
|
|
case COMMAND_STOP_CHAR_DRIVING:
|
|
|
|
case COMMAND_KILL_CHAR:
|
|
|
|
case COMMAND_SET_FAVOURITE_CAR_MODEL_FOR_CHAR:
|
|
|
|
case COMMAND_SET_CHAR_OCCUPATION:
|
|
|
|
*/
|
|
|
|
case COMMAND_CHANGE_CAR_LOCK:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-07-27 18:28:18 +00:00
|
|
|
pVehicle->m_nDoorLock = (eCarLock)ScriptParams[1];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SHAKE_CAM_WITH_POINT:
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
TheCamera.CamShake(ScriptParams[0] / 1000.0f,
|
|
|
|
*(float*)&ScriptParams[1],
|
|
|
|
*(float*)&ScriptParams[2],
|
|
|
|
*(float*)&ScriptParams[3]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_IS_CAR_MODEL:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-07-27 18:28:18 +00:00
|
|
|
UpdateCompareFlag(pVehicle->GetModelIndex() == ScriptParams[1]);
|
2019-08-03 13:01:13 +00:00
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
}
|
|
|
|
/* Not implemented.
|
|
|
|
case COMMAND_IS_CAR_REMAP:
|
|
|
|
case COMMAND_HAS_CAR_JUST_SUNK:
|
|
|
|
case COMMAND_SET_CAR_NO_COLLIDE:
|
|
|
|
*/
|
|
|
|
case COMMAND_IS_CAR_DEAD_IN_AREA_2D:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[1];
|
|
|
|
float y1 = *(float*)&ScriptParams[2];
|
|
|
|
float x2 = *(float*)&ScriptParams[3];
|
|
|
|
float y2 = *(float*)&ScriptParams[4];
|
2020-04-30 13:45:45 +00:00
|
|
|
UpdateCompareFlag(pVehicle->GetStatus() == STATUS_WRECKED &&
|
2019-07-27 18:28:18 +00:00
|
|
|
pVehicle->IsWithinArea(x1, y1, x2, y2));
|
|
|
|
if (!ScriptParams[5])
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
|
2019-07-27 18:28:18 +00:00
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CAR_DEAD_IN_AREA_3D:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[1];
|
|
|
|
float y1 = *(float*)&ScriptParams[2];
|
|
|
|
float z1 = *(float*)&ScriptParams[3];
|
|
|
|
float x2 = *(float*)&ScriptParams[4];
|
|
|
|
float y2 = *(float*)&ScriptParams[5];
|
|
|
|
float z2 = *(float*)&ScriptParams[6];
|
2020-04-30 13:45:45 +00:00
|
|
|
UpdateCompareFlag(pVehicle->GetStatus() == STATUS_WRECKED &&
|
2019-07-27 18:28:18 +00:00
|
|
|
pVehicle->IsWithinArea(x1, y1, z1, x2, y2, z2));
|
|
|
|
if (!ScriptParams[7])
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, (z1 + z2) / 2);
|
2019-07-27 18:28:18 +00:00
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugCube(x1, y1, z1, x2, y2, z2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented.
|
|
|
|
case COMMAND_IS_TRAILER_ATTACHED:
|
|
|
|
case COMMAND_IS_CAR_ON_TRAILER:
|
|
|
|
case COMMAND_HAS_CAR_GOT_WEAPON:
|
|
|
|
case COMMAND_PARK:
|
|
|
|
case COMMAND_HAS_PARK_FINISHED:
|
|
|
|
case COMMAND_KILL_ALL_PASSENGERS:
|
|
|
|
case COMMAND_SET_CAR_BULLETPROOF:
|
|
|
|
case COMMAND_SET_CAR_FLAMEPROOF:
|
|
|
|
case COMMAND_SET_CAR_ROCKETPROOF:
|
|
|
|
case COMMAND_IS_CARBOMB_ACTIVE:
|
|
|
|
case COMMAND_GIVE_CAR_ALARM:
|
|
|
|
case COMMAND_PUT_CAR_ON_TRAILER:
|
|
|
|
*/
|
|
|
|
case COMMAND_IS_CAR_CRUSHED:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CGarages::HasCarBeenCrushed(ScriptParams[0]));
|
|
|
|
return 0;
|
|
|
|
/* Not implemented.
|
|
|
|
case COMMAND_CREATE_GANG_CAR:
|
|
|
|
*/
|
|
|
|
case COMMAND_CREATE_CAR_GENERATOR:
|
|
|
|
CollectParameters(&m_nIp, 12);
|
|
|
|
ScriptParams[0] = CTheCarGenerators::CreateCarGenerator(
|
|
|
|
*(float*)&ScriptParams[0], *(float*)&ScriptParams[1], *(float*)&ScriptParams[2], *(float*)&ScriptParams[3],
|
|
|
|
ScriptParams[4], ScriptParams[5], ScriptParams[6], ScriptParams[7],
|
|
|
|
ScriptParams[8], ScriptParams[9], ScriptParams[10], ScriptParams[11]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SWITCH_CAR_GENERATOR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CCarGenerator* pCarGen = &CTheCarGenerators::CarGeneratorArray[ScriptParams[0]];
|
|
|
|
if (ScriptParams[1] == 0){
|
|
|
|
pCarGen->SwitchOff();
|
|
|
|
}else if (ScriptParams[1] <= 100){
|
|
|
|
pCarGen->SwitchOn();
|
2020-05-19 20:49:28 +00:00
|
|
|
pCarGen->SetUsesRemaining(ScriptParams[1]);
|
2019-07-27 18:28:18 +00:00
|
|
|
}else{
|
|
|
|
pCarGen->SwitchOn();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_PAGER_MESSAGE:
|
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-07-27 18:28:18 +00:00
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CUserDisplay::Pager.AddMessage(text, ScriptParams[0], ScriptParams[1], ScriptParams[2]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DISPLAY_ONSCREEN_TIMER:
|
|
|
|
{
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
2019-07-27 18:28:18 +00:00
|
|
|
m_nIp++;
|
2020-03-01 14:42:47 +00:00
|
|
|
CUserDisplay::OnscnTimer.AddClock(CTheScripts::Read2BytesFromScript(&m_nIp), nil);
|
2019-07-27 18:28:18 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CLEAR_ONSCREEN_TIMER:
|
|
|
|
{
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
2019-07-27 18:28:18 +00:00
|
|
|
m_nIp++;
|
2020-03-01 14:42:47 +00:00
|
|
|
CUserDisplay::OnscnTimer.ClearClock(CTheScripts::Read2BytesFromScript(&m_nIp));
|
2019-07-27 18:28:18 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DISPLAY_ONSCREEN_COUNTER:
|
|
|
|
{
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
2019-07-27 18:28:18 +00:00
|
|
|
m_nIp++;
|
2020-03-01 14:42:47 +00:00
|
|
|
int32 counter = CTheScripts::Read2BytesFromScript(&m_nIp);
|
2019-07-27 18:28:18 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CUserDisplay::OnscnTimer.AddCounter(counter, ScriptParams[0], nil);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CLEAR_ONSCREEN_COUNTER:
|
|
|
|
{
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
|
2019-07-27 18:28:18 +00:00
|
|
|
m_nIp++;
|
2020-03-01 14:42:47 +00:00
|
|
|
CUserDisplay::OnscnTimer.ClearCounter(CTheScripts::Read2BytesFromScript(&m_nIp));
|
2019-07-27 18:28:18 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_ZONE_CAR_INFO:
|
|
|
|
{
|
|
|
|
char label[12];
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, label);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-07-27 18:28:18 +00:00
|
|
|
CollectParameters(&m_nIp, 16);
|
|
|
|
int zone = CTheZones::FindZoneByLabelAndReturnIndex(label);
|
|
|
|
if (zone < 0) {
|
|
|
|
debug("Couldn't find zone - %s\n", label);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
CTheZones::SetZoneCarInfo(zone, ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3],
|
|
|
|
ScriptParams[4], ScriptParams[5], ScriptParams[6], ScriptParams[7], ScriptParams[8], 0, 0,
|
|
|
|
ScriptParams[9], ScriptParams[10], ScriptParams[11], ScriptParams[12],
|
|
|
|
ScriptParams[13], ScriptParams[14], ScriptParams[15]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented.
|
|
|
|
case COMMAND_IS_CHAR_IN_GANG_ZONE:
|
|
|
|
*/
|
|
|
|
case COMMAND_IS_CHAR_IN_ZONE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-07-27 18:28:18 +00:00
|
|
|
char label[12];
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, label);
|
2019-07-27 18:28:18 +00:00
|
|
|
int zone = CTheZones::FindZoneByLabelAndReturnIndex(label);
|
|
|
|
if (zone != -1)
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-07-27 18:28:18 +00:00
|
|
|
CVector pos = pPed->bInVehicle ? pPed->m_pMyVehicle->GetPosition() : pPed->GetPosition();
|
2020-05-06 10:23:26 +00:00
|
|
|
UpdateCompareFlag(CTheZones::PointLiesWithinZone(&pos, CTheZones::GetZone(zone)));
|
2019-07-27 18:28:18 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CAR_DENSITY:
|
|
|
|
{
|
|
|
|
char label[12];
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, label);
|
2019-08-03 13:01:13 +00:00
|
|
|
int16 zone = CTheZones::FindZoneByLabelAndReturnIndex(label);
|
2019-07-27 18:28:18 +00:00
|
|
|
m_nIp += 8;
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
if (zone < 0) {
|
|
|
|
debug("Couldn't find zone - %s\n", label);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
CTheZones::SetCarDensity(zone, ScriptParams[0], ScriptParams[1]);
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
}
|
|
|
|
case COMMAND_SET_PED_DENSITY:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
char label[12];
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, label);
|
2019-08-03 13:01:13 +00:00
|
|
|
int16 zone = CTheZones::FindZoneByLabelAndReturnIndex(label);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
if (zone < 0) {
|
|
|
|
debug("Couldn't find zone - %s\n", label);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
CTheZones::SetPedDensity(zone, ScriptParams[0], ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_POINT_CAMERA_AT_PLAYER:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
// ScriptParams[0] is unused.
|
2020-04-02 10:48:01 +00:00
|
|
|
TheCamera.TakeControl(nil, ScriptParams[1], ScriptParams[2], CAMCONTROL_SCRIPT);
|
2019-08-03 13:01:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_POINT_CAMERA_AT_CAR:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-04-02 10:48:01 +00:00
|
|
|
TheCamera.TakeControl(pVehicle, ScriptParams[1], ScriptParams[2], CAMCONTROL_SCRIPT);
|
2019-08-03 13:01:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_POINT_CAMERA_AT_CHAR:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-04-02 10:48:01 +00:00
|
|
|
TheCamera.TakeControl(pPed, ScriptParams[1], ScriptParams[2], CAMCONTROL_SCRIPT);
|
2019-08-03 13:01:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_RESTORE_CAMERA:
|
2019-08-03 13:01:13 +00:00
|
|
|
TheCamera.Restore();
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SHAKE_PAD:
|
2019-08-03 13:01:13 +00:00
|
|
|
CPad::GetPad(ScriptParams[0])->StartShake(ScriptParams[1], ScriptParams[2]);
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_ZONE_PED_INFO:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
char label[12];
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, label);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 10);
|
|
|
|
int16 zone = CTheZones::FindZoneByLabelAndReturnIndex(label);
|
|
|
|
if (zone < 0) {
|
|
|
|
debug("Couldn't find zone - %s\n", label);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
CTheZones::SetZonePedInfo(zone, ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3],
|
|
|
|
ScriptParams[4], ScriptParams[5], ScriptParams[6], ScriptParams[7], ScriptParams[8], 0, 0, ScriptParams[9]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_TIME_SCALE:
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTimer::SetTimeScale(*(float*)&ScriptParams[0]);
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_IS_CAR_IN_AIR:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle && pVehicle->IsCar());
|
2019-08-03 13:01:13 +00:00
|
|
|
CAutomobile* pCar = (CAutomobile*)pVehicle;
|
|
|
|
UpdateCompareFlag(pCar->GetAllWheelsOffGround());
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_FIXED_CAMERA_POSITION:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
TheCamera.SetCamPositionForFixedMode(
|
|
|
|
CVector(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1], *(float*)&ScriptParams[2]),
|
|
|
|
CVector(*(float*)&ScriptParams[3], *(float*)&ScriptParams[4], *(float*)&ScriptParams[5]));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_POINT_CAMERA_AT_POINT:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-08-03 13:01:13 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2020-04-02 10:48:01 +00:00
|
|
|
TheCamera.TakeControlNoEntity(pos, ScriptParams[3], CAMCONTROL_SCRIPT);
|
2019-08-03 13:01:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_CAR_OLD:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-08-03 13:01:13 +00:00
|
|
|
// Useless call.
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
ScriptParams[0] = CRadar::SetEntityBlip(BLIP_CAR, ScriptParams[0], ScriptParams[1], (eBlipDisplay)ScriptParams[2]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_CHAR_OLD:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-08-03 13:01:13 +00:00
|
|
|
// Useless call.
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
ScriptParams[0] = CRadar::SetEntityBlip(BLIP_CHAR, ScriptParams[0], ScriptParams[1], (eBlipDisplay)ScriptParams[2]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_OBJECT_OLD:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-08-03 13:01:13 +00:00
|
|
|
// Useless call.
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
ScriptParams[0] = CRadar::SetEntityBlip(BLIP_OBJECT, ScriptParams[0], ScriptParams[1], (eBlipDisplay)ScriptParams[2]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_REMOVE_BLIP:
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CRadar::ClearBlip(ScriptParams[0]);
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_CHANGE_BLIP_COLOUR:
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CRadar::ChangeBlipColour(ScriptParams[0], ScriptParams[1]);
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_DIM_BLIP:
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CRadar::ChangeBlipBrightness(ScriptParams[0], ScriptParams[1]);
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_COORD_OLD:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-08-03 13:01:13 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
// Useless call
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
ScriptParams[0] = CRadar::SetCoordBlip(BLIP_COORD, pos, ScriptParams[3], (eBlipDisplay)ScriptParams[4]);
|
2019-08-05 21:13:01 +00:00
|
|
|
StoreParameters(&m_nIp, 1);
|
2019-08-03 13:01:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_CHANGE_BLIP_SCALE:
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CRadar::ChangeBlipScale(ScriptParams[0], ScriptParams[1]);
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_FADING_COLOUR:
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
TheCamera.SetFadeColour(ScriptParams[0], ScriptParams[1], ScriptParams[2]);
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_DO_FADE:
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
TheCamera.Fade(ScriptParams[0] / 1000.0f, ScriptParams[1]);
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_GET_FADING_STATUS:
|
2019-08-03 13:01:13 +00:00
|
|
|
UpdateCompareFlag(TheCamera.GetFading());
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_HOSPITAL_RESTART:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
float angle = *(float*)&ScriptParams[3];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-08-03 13:01:13 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CRestart::AddHospitalRestartPoint(pos, angle);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_POLICE_RESTART:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
float angle = *(float*)&ScriptParams[3];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-08-03 13:01:13 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CRestart::AddPoliceRestartPoint(pos, angle);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_OVERRIDE_NEXT_RESTART:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
float angle = *(float*)&ScriptParams[3];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-08-03 13:01:13 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CRestart::OverrideNextRestart(pos, angle);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_DRAW_SHADOW:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 10);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
|
|
|
float angle = *(float*)&ScriptParams[4];
|
|
|
|
float length = *(float*)&ScriptParams[5];
|
|
|
|
float x, y;
|
|
|
|
if (angle != 0.0f){
|
|
|
|
y = cos(angle) * length;
|
|
|
|
x = sin(angle) * length;
|
|
|
|
}else{
|
|
|
|
y = length;
|
|
|
|
x = 0.0f;
|
|
|
|
}
|
|
|
|
float frontX = -x;
|
|
|
|
float frontY = y;
|
|
|
|
float sideX = y;
|
|
|
|
float sideY = x;
|
|
|
|
/* Not very nicely named intermediate variables. */
|
|
|
|
CShadows::StoreShadowToBeRendered(ScriptParams[0], &pos, frontX, frontY, sideX, sideY,
|
|
|
|
ScriptParams[6], ScriptParams[7], ScriptParams[8], ScriptParams[9]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_GET_PLAYER_HEADING:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2019-08-03 15:51:19 +00:00
|
|
|
float angle = pPed->bInVehicle ? pPed->m_pMyVehicle->GetForward().Heading() : pPed->GetForward().Heading();
|
2019-08-03 13:01:13 +00:00
|
|
|
*(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_PLAYER_HEADING:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
|
|
|
if (pPed->bInVehicle){
|
2020-06-28 08:59:20 +00:00
|
|
|
// Is script_assertion required?
|
2019-08-03 13:01:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
pPed->m_fRotationDest = pPed->m_fRotationCur = DEGTORAD(*(float*)&ScriptParams[1]);
|
|
|
|
pPed->SetHeading(DEGTORAD(*(float*)&ScriptParams[1]));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_GET_CHAR_HEADING:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-08-03 15:51:19 +00:00
|
|
|
float angle = pPed->bInVehicle ? pPed->m_pMyVehicle->GetForward().Heading() : pPed->GetForward().Heading();
|
2019-08-03 13:01:13 +00:00
|
|
|
*(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_CHAR_HEADING:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-08-03 13:01:13 +00:00
|
|
|
if (pPed->bInVehicle) {
|
2020-06-28 08:59:20 +00:00
|
|
|
// Is script_assertion required?
|
2019-08-03 13:01:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
pPed->m_fRotationDest = pPed->m_fRotationCur = DEGTORAD(*(float*)&ScriptParams[1]);
|
|
|
|
pPed->SetHeading(DEGTORAD(*(float*)&ScriptParams[1]));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_GET_CAR_HEADING:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-08-03 15:51:19 +00:00
|
|
|
float angle = pVehicle->GetForward().Heading();
|
2019-08-03 13:01:13 +00:00
|
|
|
*(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_CAR_HEADING:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-08-03 13:01:13 +00:00
|
|
|
pVehicle->SetHeading(DEGTORAD(*(float*)&ScriptParams[1]));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_GET_OBJECT_HEADING:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-08-03 15:51:19 +00:00
|
|
|
float angle = pObject->GetForward().Heading();
|
2019-08-03 13:01:13 +00:00
|
|
|
*(float*)&ScriptParams[0] = CGeneral::LimitAngle(RADTODEG(angle));
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_OBJECT_HEADING:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-08-03 13:01:13 +00:00
|
|
|
CWorld::Remove(pObject);
|
|
|
|
pObject->SetHeading(DEGTORAD(*(float*)&ScriptParams[1]));
|
|
|
|
pObject->GetMatrix().UpdateRW();
|
|
|
|
pObject->UpdateRwFrame();
|
|
|
|
CWorld::Add(pObject);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_IS_PLAYER_TOUCHING_OBJECT:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-08-03 13:01:13 +00:00
|
|
|
CPhysical* pEntityToTest = pPed->bInVehicle ? (CPhysical*)pPed->m_pMyVehicle : pPed;
|
|
|
|
UpdateCompareFlag(pEntityToTest->GetHasCollidedWith(pObject));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_IS_CHAR_TOUCHING_OBJECT:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-08-03 13:01:13 +00:00
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-08-03 13:01:13 +00:00
|
|
|
CPhysical* pEntityToTest = pPed->bInVehicle ? (CPhysical*)pPed->m_pMyVehicle : pPed;
|
|
|
|
UpdateCompareFlag(pEntityToTest->GetHasCollidedWith(pObject));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_PLAYER_AMMO:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CWorld::Players[0].m_pPed->SetAmmo((eWeaponType)ScriptParams[1], ScriptParams[2]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_CHAR_AMMO:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
pPed->SetAmmo((eWeaponType)ScriptParams[1], ScriptParams[2]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented.
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_SET_CAR_AMMO:
|
|
|
|
case COMMAND_LOAD_CAMERA_SPLINE:
|
|
|
|
case COMMAND_MOVE_CAMERA_ALONG_SPLINE:
|
|
|
|
case COMMAND_GET_CAMERA_POSITION_ALONG_SPLINE:
|
2019-08-03 13:01:13 +00:00
|
|
|
*/
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_DECLARE_MISSION_FLAG:
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::OnAMissionFlag = CTheScripts::Read2BytesFromScript(&++m_nIp);
|
2019-08-03 13:01:13 +00:00
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_DECLARE_MISSION_FLAG_FOR_CONTACT:
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::OnAMissionForContactFlag[ScriptParams[0]] = CTheScripts::Read2BytesFromScript(&++m_nIp);
|
2019-08-03 13:01:13 +00:00
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_DECLARE_BASE_BRIEF_ID_FOR_CONTACT:
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CTheScripts::BaseBriefIdForContact[ScriptParams[0]] = ScriptParams[1];
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_IS_PLAYER_HEALTH_GREATER:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
|
|
|
UpdateCompareFlag(pPed->m_fHealth > ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_IS_CHAR_HEALTH_GREATER:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-08-03 13:01:13 +00:00
|
|
|
UpdateCompareFlag(pPed->m_fHealth > ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_IS_CAR_HEALTH_GREATER:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-08-03 13:01:13 +00:00
|
|
|
UpdateCompareFlag(pVehicle->m_fHealth > ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_CAR:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-08-03 13:01:13 +00:00
|
|
|
// Useless call.
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
int handle = CRadar::SetEntityBlip(BLIP_CAR, ScriptParams[0], 0, BLIP_DISPLAY_BOTH);
|
|
|
|
CRadar::ChangeBlipScale(handle, 3);
|
|
|
|
ScriptParams[0] = handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_CHAR:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-08-03 13:01:13 +00:00
|
|
|
// Useless call.
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
2019-11-09 15:17:54 +00:00
|
|
|
int handle = CRadar::SetEntityBlip(BLIP_CHAR, ScriptParams[0], 1, BLIP_DISPLAY_BOTH);
|
2019-08-03 13:01:13 +00:00
|
|
|
CRadar::ChangeBlipScale(handle, 3);
|
|
|
|
ScriptParams[0] = handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_OBJECT:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-08-03 13:01:13 +00:00
|
|
|
// Useless call.
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
2019-11-09 15:17:54 +00:00
|
|
|
int handle = CRadar::SetEntityBlip(BLIP_OBJECT, ScriptParams[0], 6, BLIP_DISPLAY_BOTH);
|
2019-08-03 13:01:13 +00:00
|
|
|
CRadar::ChangeBlipScale(handle, 3);
|
|
|
|
ScriptParams[0] = handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_CONTACT_POINT:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-08-03 13:01:13 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
// Useless call
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
int handle = CRadar::SetCoordBlip(BLIP_COORD, pos, 2, BLIP_DISPLAY_BOTH);
|
|
|
|
CRadar::ChangeBlipScale(handle, 3);
|
|
|
|
ScriptParams[0] = handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_COORD:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-08-03 13:01:13 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
// Useless call
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
int handle = CRadar::SetCoordBlip(BLIP_COORD, pos, 5, BLIP_DISPLAY_BOTH);
|
|
|
|
CRadar::ChangeBlipScale(handle, 3);
|
|
|
|
ScriptParams[0] = handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_CHANGE_BLIP_DISPLAY:
|
2019-08-03 13:01:13 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CRadar::ChangeBlipDisplay(ScriptParams[0], (eBlipDisplay)ScriptParams[1]);
|
|
|
|
return 0;
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_ONE_OFF_SOUND:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
switch (ScriptParams[3]) {
|
|
|
|
case SCRIPT_SOUND_EVIDENCE_PICKUP:
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_EVIDENCE_PICKUP, 0);
|
|
|
|
return 0;
|
|
|
|
case SCRIPT_SOUND_UNLOAD_GOLD:
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_UNLOAD_GOLD, 0);
|
|
|
|
return 0;
|
|
|
|
case SCRIPT_SOUND_PART_MISSION_COMPLETE:
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_PART_MISSION_COMPLETE, 0);
|
|
|
|
return 0;
|
|
|
|
case SCRIPT_SOUND_RACE_START_3:
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_RACE_START_3, 0);
|
|
|
|
return 0;
|
|
|
|
case SCRIPT_SOUND_RACE_START_2:
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_RACE_START_2, 0);
|
|
|
|
return 0;
|
|
|
|
case SCRIPT_SOUND_RACE_START_1:
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_RACE_START_1, 0);
|
|
|
|
return 0;
|
|
|
|
case SCRIPT_SOUND_RACE_START_GO:
|
|
|
|
DMAudio.PlayFrontEndSound(SOUND_RACE_START_GO, 0);
|
|
|
|
return 0;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2019-09-01 14:02:23 +00:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
/* BUG: if audio is not initialized, this object will not be freed. */
|
|
|
|
if (!DMAudio.IsAudioInitialised())
|
|
|
|
return 0;
|
|
|
|
#endif
|
2019-08-03 13:01:13 +00:00
|
|
|
cAudioScriptObject* obj = new cAudioScriptObject();
|
2019-08-15 02:27:38 +00:00
|
|
|
obj->Posn = *(CVector*)&ScriptParams[0];
|
|
|
|
obj->AudioId = ScriptParams[3];
|
|
|
|
obj->AudioEntity = AEHANDLE_NONE;
|
2019-08-03 13:01:13 +00:00
|
|
|
DMAudio.CreateOneShotScriptObject(obj);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_ADD_CONTINUOUS_SOUND:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
cAudioScriptObject* obj = new cAudioScriptObject();
|
2019-08-15 02:27:38 +00:00
|
|
|
obj->Posn = *(CVector*)&ScriptParams[0];
|
|
|
|
obj->AudioId = ScriptParams[3];
|
|
|
|
obj->AudioEntity = DMAudio.CreateLoopingScriptObject(obj);
|
2019-08-03 13:01:13 +00:00
|
|
|
ScriptParams[0] = CPools::GetAudioScriptObjectPool()->GetIndex(obj);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_REMOVE_SOUND:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
cAudioScriptObject* obj = CPools::GetAudioScriptObjectPool()->GetAt(ScriptParams[0]);
|
|
|
|
if (!obj){
|
|
|
|
debug("REMOVE_SOUND - Sound doesn't exist\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2019-08-15 02:27:38 +00:00
|
|
|
DMAudio.DestroyLoopingScriptObject(obj->AudioEntity);
|
2019-08-03 13:01:13 +00:00
|
|
|
delete obj;
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
case COMMAND_IS_CAR_STUCK_ON_ROOF:
|
2019-08-03 13:01:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-08-03 13:01:13 +00:00
|
|
|
UpdateCompareFlag(CTheScripts::UpsideDownCars.HasCarBeenUpsideDownForAWhile(ScriptParams[0]));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-07-27 18:28:18 +00:00
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-07-27 18:28:18 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands400To499(int32 command)
|
2019-10-12 19:00:31 +00:00
|
|
|
{
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_ADD_UPSIDEDOWN_CAR_CHECK:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-12 19:00:31 +00:00
|
|
|
CTheScripts::UpsideDownCars.AddCarToCheck(ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_REMOVE_UPSIDEDOWN_CAR_CHECK:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-12 19:00:31 +00:00
|
|
|
CTheScripts::UpsideDownCars.RemoveCarFromCheck(ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_OBJ_WAIT_ON_FOOT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-12 19:00:31 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_IDLE);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_OBJ_FLEE_ON_FOOT_TILL_SAFE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-12 19:00:31 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_OBJ_GUARD_SPOT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-12 19:00:31 +00:00
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-10-12 19:00:31 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-12 19:00:31 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_GUARD_SPOT, pos);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_OBJ_GUARD_AREA:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
float infX = *(float*)&ScriptParams[1];
|
|
|
|
float infY = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
2019-10-12 19:00:31 +00:00
|
|
|
if (infX > supX){
|
2019-10-13 11:46:09 +00:00
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[1];
|
2019-10-12 19:00:31 +00:00
|
|
|
}
|
|
|
|
if (infY > supY) {
|
2019-10-13 11:46:09 +00:00
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[2];
|
2019-10-12 19:00:31 +00:00
|
|
|
}
|
|
|
|
CVector pos;
|
|
|
|
pos.x = (infX + supX) / 2;
|
|
|
|
pos.y = (infY + supY) / 2;
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2020-04-19 16:34:08 +00:00
|
|
|
float radius = Max(pos.x - infX, pos.y - infY);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-12 19:00:31 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_GUARD_SPOT, pos, radius);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_OBJ_WAIT_IN_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-12 19:00:31 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_WAIT_IN_CAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D:
|
|
|
|
PlayerInAreaCheckCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_IN_CAR_3D:
|
|
|
|
CharInAreaCheckCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_IS_CAR_STOPPED_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_CAR_STOPPED_IN_AREA_3D:
|
|
|
|
CarInAreaCheckCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LOCATE_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CAR_3D:
|
|
|
|
LocateCarCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_GIVE_WEAPON_TO_PLAYER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-12 19:00:31 +00:00
|
|
|
pPed->m_nSelectedWepSlot = pPed->GiveWeapon((eWeaponType)ScriptParams[1], ScriptParams[2]);
|
2019-10-26 14:16:39 +00:00
|
|
|
return 0;
|
2019-10-12 19:00:31 +00:00
|
|
|
}
|
|
|
|
case COMMAND_GIVE_WEAPON_TO_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetCurrentWeapon(pPed->GiveWeapon((eWeaponType)ScriptParams[1], ScriptParams[2]));
|
2019-10-12 19:00:31 +00:00
|
|
|
if (pPed->bInVehicle)
|
|
|
|
pPed->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(pPed->m_weapons[pPed->m_currentWeapon].m_eWeaponType)->m_nModelId);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented */
|
|
|
|
//case COMMAND_GIVE_WEAPON_TO_CAR:
|
|
|
|
case COMMAND_SET_PLAYER_CONTROL:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerInfo* pPlayer = &CWorld::Players[ScriptParams[0]];
|
|
|
|
if (ScriptParams[1]){
|
2020-02-27 16:07:36 +00:00
|
|
|
if (CGame::playingIntro || CTheScripts::DelayMakingPlayerUnsafeThisTime){
|
2019-10-12 19:00:31 +00:00
|
|
|
CTheScripts::CountdownToMakePlayerUnsafe = 50;
|
|
|
|
if (CTheScripts::DelayMakingPlayerUnsafeThisTime)
|
|
|
|
CTheScripts::DelayMakingPlayerUnsafeThisTime--;
|
|
|
|
}else{
|
|
|
|
pPlayer->MakePlayerSafe(false);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
pPlayer->MakePlayerSafe(true);
|
|
|
|
if (strcmp(m_abScriptName, "camera") == 0){
|
|
|
|
pPlayer->m_pPed->SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
|
|
|
pPlayer->m_pPed->SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
|
|
|
CAnimManager::BlendAnimation((RpClump*)pPlayer->m_pPed->m_rwObject, pPlayer->m_pPed->m_animGroup, ANIM_IDLE_STANCE, 1000.0f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_FORCE_WEATHER:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CWeather::ForceWeather(ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_FORCE_WEATHER_NOW:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CWeather::ForceWeatherNow(ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_RELEASE_WEATHER:
|
|
|
|
CWeather::ReleaseWeather();
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_CURRENT_PLAYER_WEAPON:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
2020-01-31 17:16:13 +00:00
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2019-10-12 19:00:31 +00:00
|
|
|
for (int i = 0; i < WEAPONTYPE_TOTAL_INVENTORY_WEAPONS; i++){
|
|
|
|
if (pPed->m_weapons[i].m_eWeaponType == ScriptParams[1])
|
2020-01-31 17:16:13 +00:00
|
|
|
pPed->m_nSelectedWepSlot = i;
|
2019-10-12 19:00:31 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CURRENT_CHAR_WEAPON:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
for (int i = 0; i < WEAPONTYPE_TOTAL_INVENTORY_WEAPONS; i++) {
|
|
|
|
if (pPed->m_weapons[i].m_eWeaponType == ScriptParams[1])
|
2020-01-31 17:16:13 +00:00
|
|
|
pPed->SetCurrentWeapon(i);
|
2019-10-12 19:00:31 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented */
|
|
|
|
//case COMMAND_SET_CURRENT_CAR_WEAPON:
|
|
|
|
case COMMAND_GET_OBJECT_COORDINATES:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-10-12 19:00:31 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = pObject->GetPosition();
|
|
|
|
StoreParameters(&m_nIp, 3);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_OBJECT_COORDINATES:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-10-12 19:00:31 +00:00
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-10-12 19:00:31 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pObject->Teleport(pos);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, pObject);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_GAME_TIMER:
|
|
|
|
ScriptParams[0] = CTimer::GetTimeInMilliseconds();
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_TURN_CHAR_TO_FACE_COORD:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-12 19:00:31 +00:00
|
|
|
CVehicle* pVehicle;
|
|
|
|
CVector pos;
|
|
|
|
if (pPed->bInVehicle)
|
|
|
|
pVehicle = pPed->m_pMyVehicle;
|
|
|
|
else
|
|
|
|
pVehicle = nil;
|
|
|
|
if (pVehicle)
|
|
|
|
pos = pVehicle->GetPosition();
|
|
|
|
else
|
|
|
|
pos = pPed->GetPosition();
|
2019-10-13 11:46:09 +00:00
|
|
|
float heading = CGeneral::GetATanOfXY(pos.x - *(float*)&ScriptParams[1], pos.y - *(float*)&ScriptParams[2]);
|
2019-10-12 19:00:31 +00:00
|
|
|
heading += HALFPI;
|
|
|
|
if (heading > TWOPI)
|
|
|
|
heading -= TWOPI;
|
|
|
|
if (!pVehicle){
|
|
|
|
pPed->m_fRotationCur = heading;
|
|
|
|
pPed->m_fRotationDest = heading;
|
|
|
|
pPed->SetHeading(heading);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_TURN_PLAYER_TO_FACE_COORD:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-12 19:00:31 +00:00
|
|
|
CVehicle* pVehicle;
|
|
|
|
CVector pos;
|
|
|
|
if (pPed->bInVehicle)
|
|
|
|
pVehicle = pPed->m_pMyVehicle;
|
|
|
|
else
|
|
|
|
pVehicle = nil;
|
|
|
|
if (pVehicle)
|
|
|
|
pos = pVehicle->GetPosition();
|
|
|
|
else
|
|
|
|
pos = pPed->GetPosition();
|
2019-10-13 11:46:09 +00:00
|
|
|
float heading = CGeneral::GetATanOfXY(pos.x - *(float*)&ScriptParams[1], pos.y - *(float*)&ScriptParams[2]);
|
2019-10-12 19:00:31 +00:00
|
|
|
heading += HALFPI;
|
|
|
|
if (heading > TWOPI)
|
|
|
|
heading -= TWOPI;
|
|
|
|
if (!pVehicle) {
|
|
|
|
pPed->m_fRotationCur = heading;
|
|
|
|
pPed->m_fRotationDest = heading;
|
|
|
|
pPed->SetHeading(heading);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_STORE_WANTED_LEVEL:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-12 19:00:31 +00:00
|
|
|
ScriptParams[0] = pPed->m_pWanted->m_nWantedLevel;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CAR_STOPPED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-12 19:00:31 +00:00
|
|
|
UpdateCompareFlag(CTheScripts::IsVehicleStopped(pVehicle));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_MARK_CHAR_AS_NO_LONGER_NEEDED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
CTheScripts::CleanUpThisPed(pPed);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(ScriptParams[0], CLEANUP_CHAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_MARK_CAR_AS_NO_LONGER_NEEDED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
|
|
|
CTheScripts::CleanUpThisVehicle(pVehicle);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(ScriptParams[0], CLEANUP_CAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_MARK_OBJECT_AS_NO_LONGER_NEEDED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
|
|
|
CTheScripts::CleanUpThisObject(pObject);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(ScriptParams[0], CLEANUP_OBJECT);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DONT_REMOVE_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-12 19:00:31 +00:00
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(ScriptParams[0], CLEANUP_CHAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DONT_REMOVE_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-12 19:00:31 +00:00
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(ScriptParams[0], CLEANUP_CAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DONT_REMOVE_OBJECT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-10-12 19:00:31 +00:00
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(ScriptParams[0], CLEANUP_OBJECT);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CREATE_CHAR_AS_PASSENGER:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-13 11:46:09 +00:00
|
|
|
switch (ScriptParams[2]) {
|
|
|
|
case MI_COP:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_COP)
|
|
|
|
ScriptParams[2] = COP_STREET;
|
|
|
|
break;
|
|
|
|
case MI_SWAT:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_COP)
|
|
|
|
ScriptParams[2] = COP_SWAT;
|
|
|
|
break;
|
|
|
|
case MI_FBI:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_COP)
|
|
|
|
ScriptParams[2] = COP_FBI;
|
|
|
|
break;
|
|
|
|
case MI_ARMY:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_COP)
|
|
|
|
ScriptParams[2] = COP_ARMY;
|
|
|
|
break;
|
|
|
|
case MI_MEDIC:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_EMERGENCY)
|
|
|
|
ScriptParams[2] = PEDTYPE_EMERGENCY;
|
|
|
|
break;
|
|
|
|
case MI_FIREMAN:
|
|
|
|
if (ScriptParams[1] == PEDTYPE_FIREMAN)
|
|
|
|
ScriptParams[2] = PEDTYPE_FIREMAN;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CPed* pPed;
|
|
|
|
if (ScriptParams[1] == PEDTYPE_COP)
|
|
|
|
pPed = new CCopPed((eCopType)ScriptParams[2]);
|
|
|
|
else if (ScriptParams[1] == PEDTYPE_EMERGENCY || ScriptParams[1] == PEDTYPE_FIREMAN)
|
|
|
|
pPed = new CEmergencyPed(ScriptParams[2]);
|
|
|
|
else
|
2020-02-16 02:15:58 +00:00
|
|
|
pPed = new CCivilianPed((ePedType)ScriptParams[1], ScriptParams[2]);
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->CharCreatedBy = MISSION_CHAR;
|
|
|
|
pPed->bRespondsToThreats = false;
|
2019-12-31 23:35:54 +00:00
|
|
|
pPed->bAllowMedicsToReviveMe = false;
|
2020-05-05 01:45:18 +00:00
|
|
|
pPed->SetPosition(pVehicle->GetPosition());
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetOrientation(0.0f, 0.0f, 0.0f);
|
|
|
|
pPed->SetPedState(PED_DRIVING);
|
|
|
|
CPopulation::ms_nTotalMissionPeds++;
|
|
|
|
if (ScriptParams[3] >= 0)
|
|
|
|
pVehicle->AddPassenger(pPed, ScriptParams[3]);
|
|
|
|
else
|
|
|
|
pVehicle->AddPassenger(pPed);
|
|
|
|
pPed->m_pMyVehicle = pVehicle;
|
|
|
|
pPed->m_pMyVehicle->RegisterReference((CEntity**)&pPed->m_pMyVehicle);
|
|
|
|
pPed->bInVehicle = true;
|
|
|
|
pPed->SetPedState(PED_DRIVING);
|
2020-04-30 13:45:45 +00:00
|
|
|
pVehicle->SetStatus(STATUS_PHYSICS);
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->bUsesCollision = false;
|
2020-03-01 01:43:30 +00:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
AnimationId anim = pVehicle->GetDriverAnim();
|
|
|
|
#else
|
2019-10-13 11:46:09 +00:00
|
|
|
AnimationId anim = pVehicle->bLowVehicle ? ANIM_CAR_LSIT : ANIM_CAR_SIT;
|
2020-03-01 01:43:30 +00:00
|
|
|
#endif
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->m_pVehicleAnim = CAnimManager::BlendAnimation(pPed->GetClump(), ASSOCGRP_STD, anim, 100.0f);
|
|
|
|
pPed->StopNonPartialAnims();
|
2020-05-06 10:23:26 +00:00
|
|
|
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
|
2019-10-13 11:46:09 +00:00
|
|
|
CWorld::Add(pPed);
|
|
|
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ScriptParams[0], CLEANUP_CHAR);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_KILL_CHAR_ON_FOOT:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_KILL_PLAYER_ON_FOOT:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CWorld::Players[ScriptParams[1]].m_pPed;
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_KILL_CHAR_ANY_MEANS:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_KILL_CHAR_ANY_MEANS, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_KILL_PLAYER_ANY_MEANS:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CWorld::Players[ScriptParams[1]].m_pPed;
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_KILL_CHAR_ANY_MEANS, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_FLEE_CHAR_ON_FOOT_TILL_SAFE:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_FLEE_PLAYER_ON_FOOT_TILL_SAFE:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CWorld::Players[ScriptParams[1]].m_pPed;
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_FLEE_CHAR_ON_FOOT_ALWAYS:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_FLEE_PLAYER_ON_FOOT_ALWAYS:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CWorld::Players[ScriptParams[1]].m_pPed;
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_GOTO_CHAR_ON_FOOT:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_GOTO_CHAR_ON_FOOT, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_GOTO_PLAYER_ON_FOOT:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CWorld::Players[ScriptParams[1]].m_pPed;
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_GOTO_CHAR_ON_FOOT, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_LEAVE_CAR:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_ENTER_CAR_AS_PASSENGER:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_ENTER_CAR_AS_PASSENGER, pVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_ENTER_CAR_AS_DRIVER:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, pVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented.
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_FOLLOW_CAR_IN_CAR:
|
|
|
|
case COMMAND_SET_CHAR_OBJ_FIRE_AT_OBJECT_FROM_VEHICLE:
|
|
|
|
case COMMAND_SET_CHAR_OBJ_DESTROY_OBJECT:
|
2019-10-13 11:46:09 +00:00
|
|
|
*/
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_DESTROY_CAR:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_DESTROY_CAR, pVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_GOTO_AREA_ON_FOOT:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
float infX = *(float*)&ScriptParams[1];
|
|
|
|
float infY = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
CVector pos;
|
|
|
|
pos.x = (infX + supX) / 2;
|
|
|
|
pos.y = (infY + supY) / 2;
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2020-04-19 16:34:08 +00:00
|
|
|
float radius = Max(pos.x - infX, pos.y - infY);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_GOTO_AREA_ON_FOOT, pos, radius);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented.
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_GOTO_AREA_IN_CAR:
|
|
|
|
case COMMAND_SET_CHAR_OBJ_FOLLOW_CAR_ON_FOOT_WITH_OFFSET:
|
|
|
|
case COMMAND_SET_CHAR_OBJ_GUARD_ATTACK:
|
2019-10-13 11:46:09 +00:00
|
|
|
*/
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_AS_LEADER:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
|
|
|
pPed->SetObjective(OBJECTIVE_SET_LEADER, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_PLAYER_AS_LEADER:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
CPed* pTarget = CWorld::Players[ScriptParams[1]].m_pPed;
|
|
|
|
pPed->SetObjective(OBJECTIVE_SET_LEADER, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_LEAVE_GROUP:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->ClearLeader();
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_FOLLOW_ROUTE:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_FOLLOW_ROUTE, ScriptParams[1], ScriptParams[2]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_ADD_ROUTE_POINT:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CRouteNode::AddRoutePoint(ScriptParams[0], *(CVector*)&ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_PRINT_WITH_NUMBER_BIG:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-10-13 11:46:09 +00:00
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CMessages::AddBigMessageWithNumber(text, ScriptParams[1], ScriptParams[2] - 1, ScriptParams[0], -1, -1, -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_PRINT_WITH_NUMBER:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-10-13 11:46:09 +00:00
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CMessages::AddMessageWithNumber(text, ScriptParams[1], ScriptParams[2], ScriptParams[0], -1, -1, -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_PRINT_WITH_NUMBER_NOW:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-10-13 11:46:09 +00:00
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CMessages::AddMessageJumpQWithNumber(text, ScriptParams[1], ScriptParams[2], ScriptParams[0], -1, -1, -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented.
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_PRINT_WITH_NUMBER_SOON:
|
2019-10-13 11:46:09 +00:00
|
|
|
*/
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SWITCH_ROADS_ON:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX){
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY){
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ){
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
ThePaths.SwitchRoadsOffInArea(infX, supX, infY, supY, infZ, supZ, false);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SWITCH_ROADS_OFF:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
ThePaths.SwitchRoadsOffInArea(infX, supX, infY, supY, infZ, supZ, true);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_GET_NUMBER_OF_PASSENGERS:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-13 11:46:09 +00:00
|
|
|
ScriptParams[0] = pVehicle->m_nNumPassengers;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_GET_MAXIMUM_NUMBER_OF_PASSENGERS:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-13 11:46:09 +00:00
|
|
|
ScriptParams[0] = pVehicle->m_nNumMaxPassengers;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CAR_DENSITY_MULTIPLIER:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CCarCtrl::CarDensityMultiplier = *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_CAR_HEAVY:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
2020-05-22 21:50:15 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
2019-10-13 11:46:09 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-13 11:46:09 +00:00
|
|
|
pVehicle->bIsHeavy = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_CLEAR_CHAR_THREAT_SEARCH:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-13 11:46:09 +00:00
|
|
|
pPed->m_fearFlags = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_ACTIVATE_CRANE:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 10);
|
|
|
|
float infX = *(float*)&ScriptParams[2];
|
|
|
|
float infY = *(float*)&ScriptParams[3];
|
|
|
|
float supX = *(float*)&ScriptParams[4];
|
|
|
|
float supY = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[4];
|
|
|
|
supX = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[5];
|
|
|
|
supY = *(float*)&ScriptParams[3];
|
|
|
|
}
|
|
|
|
CCranes::ActivateCrane(infX, supX, infY, supY,
|
|
|
|
*(float*)&ScriptParams[6], *(float*)&ScriptParams[7], *(float*)&ScriptParams[8],
|
|
|
|
DEGTORAD(*(float*)&ScriptParams[9]), false, false,
|
|
|
|
*(float*)&ScriptParams[0], *(float*)&ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_DEACTIVATE_CRANE:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CCranes::DeActivateCrane(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SET_MAX_WANTED_LEVEL:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CWanted::SetMaximumWantedLevel(ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
2020-05-11 02:55:57 +00:00
|
|
|
/* Debug commands?
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_SAVE_VAR_INT:
|
|
|
|
case COMMAND_SAVE_VAR_FLOAT:
|
2019-10-13 11:46:09 +00:00
|
|
|
*/
|
2019-10-12 19:00:31 +00:00
|
|
|
case COMMAND_IS_CAR_IN_AIR_PROPER:
|
2019-10-13 11:46:09 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-13 11:46:09 +00:00
|
|
|
UpdateCompareFlag(pVehicle->m_nCollisionRecords == 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-10-12 19:00:31 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands500To599(int32 command)
|
2019-10-21 21:39:59 +00:00
|
|
|
{
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_CAR_UPSIDEDOWN:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-21 21:39:59 +00:00
|
|
|
UpdateCompareFlag(pVehicle->GetUp().z <= -0.97f);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_PLAYER_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPed);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CANCEL_OVERRIDE_RESTART:
|
|
|
|
CRestart::CancelOverrideRestart();
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_POLICE_IGNORE_PLAYER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-02 10:29:13 +00:00
|
|
|
if (ScriptParams[1]) {
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->m_pWanted->m_bIgnoredByCops = true;
|
|
|
|
CWorld::StopAllLawEnforcersInTheirTracks();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pPed->m_pWanted->m_bIgnoredByCops = false;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_PAGER_MESSAGE_WITH_NUMBER:
|
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-10-21 21:39:59 +00:00
|
|
|
CollectParameters(&m_nIp, 4);
|
2019-10-26 14:27:48 +00:00
|
|
|
CUserDisplay::Pager.AddMessageWithNumber(text, ScriptParams[0], -1, -1, -1, -1, -1,
|
2019-10-21 21:39:59 +00:00
|
|
|
ScriptParams[1], ScriptParams[2], ScriptParams[3]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_START_KILL_FRENZY:
|
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-10-21 21:39:59 +00:00
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CDarkel::StartFrenzy((eWeaponType)ScriptParams[0], ScriptParams[1], ScriptParams[2],
|
|
|
|
ScriptParams[3], text, ScriptParams[4], ScriptParams[5],
|
|
|
|
ScriptParams[6], ScriptParams[7] != 0, false);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_READ_KILL_FRENZY_STATUS:
|
|
|
|
{
|
|
|
|
ScriptParams[0] = CDarkel::ReadStatus();
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SQRT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)&ScriptParams[0] = Sqrt(*(float*)&ScriptParams[0]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_CAR_3D:
|
|
|
|
LocatePlayerCarCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_CAR_3D:
|
|
|
|
LocateCharCarCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_GENERATE_RANDOM_FLOAT_IN_RANGE:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
*(float*)&ScriptParams[0] = CGeneral::GetRandomNumberInRange(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_GENERATE_RANDOM_INT_IN_RANGE:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
ScriptParams[0] = CGeneral::GetRandomNumberInRange(ScriptParams[0], ScriptParams[1]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_LOCK_CAR_DOORS:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-21 21:39:59 +00:00
|
|
|
pVehicle->m_nDoorLock = (eCarLock)ScriptParams[1];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_EXPLODE_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-21 21:39:59 +00:00
|
|
|
pVehicle->BlowUpCar(nil);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_EXPLOSION:
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CExplosion::AddExplosion(nil, nil, (eExplosionType)ScriptParams[3], *(CVector*)&ScriptParams[0], 0);
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case COMMAND_IS_CAR_UPRIGHT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-21 21:39:59 +00:00
|
|
|
UpdateCompareFlag(pVehicle->GetUp().z >= 0.0f);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_TURN_CHAR_TO_FACE_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pSourcePed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
CPed* pTargetPed = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
|
|
|
CVehicle* pVehicle = pSourcePed->bInVehicle ? pSourcePed->m_pMyVehicle : nil;
|
|
|
|
CVector2D sourcePos = pSourcePed->bInVehicle ? pVehicle->GetPosition() : pSourcePed->GetPosition();
|
|
|
|
CVector2D targetPos = pTargetPed->bInVehicle ? pTargetPed->m_pMyVehicle->GetPosition() : pTargetPed->GetPosition();
|
|
|
|
float angle = CGeneral::GetATanOfXY(sourcePos.x - targetPos.x, sourcePos.y - targetPos.y) + HALFPI;
|
|
|
|
if (angle > TWOPI)
|
|
|
|
angle -= TWOPI;
|
|
|
|
if (!pVehicle) {
|
|
|
|
pSourcePed->m_fRotationCur = angle;
|
|
|
|
pSourcePed->m_fRotationDest = angle;
|
|
|
|
pSourcePed->SetHeading(angle);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_TURN_CHAR_TO_FACE_PLAYER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pSourcePed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
CPed* pTargetPed = CWorld::Players[ScriptParams[1]].m_pPed;
|
|
|
|
CVehicle* pVehicle = pSourcePed->bInVehicle ? pSourcePed->m_pMyVehicle : nil;
|
|
|
|
CVector2D sourcePos = pSourcePed->bInVehicle ? pVehicle->GetPosition() : pSourcePed->GetPosition();
|
|
|
|
CVector2D targetPos = pTargetPed->bInVehicle ? pTargetPed->m_pMyVehicle->GetPosition() : pTargetPed->GetPosition();
|
|
|
|
float angle = CGeneral::GetATanOfXY(sourcePos.x - targetPos.x, sourcePos.y - targetPos.y) + HALFPI;
|
|
|
|
if (angle > TWOPI)
|
|
|
|
angle -= TWOPI;
|
|
|
|
if (!pVehicle) {
|
|
|
|
pSourcePed->m_fRotationCur = angle;
|
|
|
|
pSourcePed->m_fRotationDest = angle;
|
|
|
|
pSourcePed->SetHeading(angle);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_TURN_PLAYER_TO_FACE_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pSourcePed = CWorld::Players[ScriptParams[0]].m_pPed;
|
|
|
|
CPed* pTargetPed = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
|
|
|
CVehicle* pVehicle = pSourcePed->bInVehicle ? pSourcePed->m_pMyVehicle : nil;
|
|
|
|
CVector2D sourcePos = pSourcePed->bInVehicle ? pVehicle->GetPosition() : pSourcePed->GetPosition();
|
|
|
|
CVector2D targetPos = pTargetPed->bInVehicle ? pTargetPed->m_pMyVehicle->GetPosition() : pTargetPed->GetPosition();
|
|
|
|
float angle = CGeneral::GetATanOfXY(sourcePos.x - targetPos.x, sourcePos.y - targetPos.y) + HALFPI;
|
|
|
|
if (angle > TWOPI)
|
|
|
|
angle -= TWOPI;
|
|
|
|
if (!pVehicle) {
|
|
|
|
pSourcePed->m_fRotationCur = angle;
|
|
|
|
pSourcePed->m_fRotationDest = angle;
|
|
|
|
pSourcePed->SetHeading(angle);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_OBJ_GOTO_COORD_ON_FOOT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
CVector target;
|
|
|
|
target.x = *(float*)&ScriptParams[1];
|
|
|
|
target.y = *(float*)&ScriptParams[2];
|
|
|
|
target.z = CWorld::FindGroundZForCoord(target.x, target.y);
|
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->SetObjective(OBJECTIVE_GOTO_AREA_ON_FOOT, target);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* Not implemented*/
|
|
|
|
//case COMMAND_SET_CHAR_OBJ_GOTO_COORD_IN_CAR:
|
|
|
|
case COMMAND_CREATE_PICKUP:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
int16 model = ScriptParams[0];
|
|
|
|
if (model < 0)
|
|
|
|
model = CTheScripts::UsedObjectArray[-model].index;
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[2];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y) + PICKUP_PLACEMENT_OFFSET;
|
2019-10-21 21:39:59 +00:00
|
|
|
CPickups::GetActualPickupIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
ScriptParams[0] = CPickups::GenerateNewOne(pos, model, ScriptParams[1], 0);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_HAS_PICKUP_BEEN_COLLECTED:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CPickups::IsPickUpPickedUp(ScriptParams[0]) != 0);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_REMOVE_PICKUP:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPickups::RemovePickUp(ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_TAXI_LIGHTS:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR);
|
2019-10-21 21:39:59 +00:00
|
|
|
((CAutomobile*)pVehicle)->SetTaxiLight(ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_PRINT_BIG_Q:
|
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-10-21 21:39:59 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CMessages::AddBigMessageQ(text, ScriptParams[0], ScriptParams[1] - 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_PRINT_WITH_NUMBER_BIG_Q:
|
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-10-21 21:39:59 +00:00
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CMessages::AddBigMessageWithNumberQ(text, ScriptParams[1], ScriptParams[2] - 1,
|
|
|
|
ScriptParams[0], -1, -1, -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_GARAGE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
2020-03-28 12:24:13 +00:00
|
|
|
ScriptParams[0] = CGarages::AddOne(infX, infY, infZ, supX, supY, supZ, (eGarageType)ScriptParams[6], 0);
|
2019-10-21 21:39:59 +00:00
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_GARAGE_WITH_CAR_MODEL:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
2020-03-28 12:24:13 +00:00
|
|
|
ScriptParams[0] = CGarages::AddOne(infX, infY, infZ, supX, supY, supZ, (eGarageType)ScriptParams[6], ScriptParams[7]);
|
2019-10-21 21:39:59 +00:00
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_TARGET_CAR_FOR_MISSION_GARAGE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pTarget;
|
|
|
|
if (ScriptParams[1] >= 0) {
|
|
|
|
pTarget = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTarget);
|
2019-10-21 21:39:59 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
pTarget = nil;
|
|
|
|
}
|
|
|
|
CGarages::SetTargetCarForMissonGarage(ScriptParams[0], pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CAR_IN_MISSION_GARAGE:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CGarages::HasCarBeenDroppedOffYet(ScriptParams[0]));
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_FREE_BOMBS:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-30 21:46:44 +00:00
|
|
|
CGarages::SetFreeBombs(ScriptParams[0] != 0);
|
2019-10-21 21:39:59 +00:00
|
|
|
return 0;
|
2020-01-20 16:53:21 +00:00
|
|
|
#ifdef GTA_PS2
|
|
|
|
case COMMAND_SET_POWERPOINT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
float f1 = *(float*)&ScriptParams[0];
|
|
|
|
float f2 = *(float*)&ScriptParams[1];
|
|
|
|
float f3 = *(float*)&ScriptParams[2];
|
|
|
|
float f4 = *(float*)&ScriptParams[3];
|
|
|
|
float f5 = *(float*)&ScriptParams[4];
|
|
|
|
float f6 = *(float*)&ScriptParams[5];
|
|
|
|
float temp;
|
|
|
|
|
|
|
|
if (f1 > f4) {
|
|
|
|
temp = f1;
|
|
|
|
f1 = f4;
|
|
|
|
f4 = temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (f2 > f5) {
|
|
|
|
temp = f2;
|
|
|
|
f2 = f5;
|
|
|
|
f5 = temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (f3 > f6) {
|
|
|
|
temp = f3;
|
|
|
|
f3 = f6;
|
|
|
|
f6 = temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
CPowerPoints::GenerateNewOne(f1, f2, f3, f4, f5, f6, *(uint8*)&ScriptParams[6]);
|
|
|
|
|
2020-02-01 22:12:20 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2020-01-20 16:53:21 +00:00
|
|
|
#endif // GTA_PS2
|
2019-10-21 21:39:59 +00:00
|
|
|
case COMMAND_SET_ALL_TAXI_LIGHTS:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CAutomobile::SetAllTaxiLights(ScriptParams[0] != 0);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_IS_CAR_ARMED_WITH_ANY_BOMB:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CAutomobile* pCar = (CAutomobile*)CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pCar);
|
|
|
|
script_assert(pCar->m_vehType == VEHICLE_TYPE_CAR);
|
2019-10-21 21:39:59 +00:00
|
|
|
UpdateCompareFlag(pCar->m_bombType != 0); //TODO: enum
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_APPLY_BRAKES_TO_PLAYERS_CAR:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPad::GetPad(ScriptParams[0])->bApplyBrakes = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_PLAYER_HEALTH:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-30 23:00:04 +00:00
|
|
|
pPed->m_fHealth = ScriptParams[1];
|
2019-10-21 21:39:59 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_HEALTH:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-30 23:00:04 +00:00
|
|
|
if (ScriptParams[1]) {
|
|
|
|
pPed->m_fHealth = ScriptParams[1];
|
2019-10-21 21:39:59 +00:00
|
|
|
}
|
|
|
|
else if (pPed->bInVehicle) {
|
|
|
|
pPed->SetDead();
|
|
|
|
if (!pPed->IsPlayer())
|
|
|
|
pPed->FlagToDestroyWhenNextProcessed();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pPed->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CAR_HEALTH:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-30 23:00:04 +00:00
|
|
|
pVehicle->m_fHealth = ScriptParams[1];
|
2019-10-21 21:39:59 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_PLAYER_HEALTH:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
ScriptParams[0] = pPed->m_fHealth; // correct cast float to int
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_CHAR_HEALTH:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
ScriptParams[0] = pPed->m_fHealth; // correct cast float to int
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_CAR_HEALTH:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-21 21:39:59 +00:00
|
|
|
ScriptParams[0] = pVehicle->m_fHealth; // correct cast float to int
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CAR_ARMED_WITH_BOMB:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CAutomobile* pCar = (CAutomobile*)CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pCar);
|
|
|
|
script_assert(pCar->m_vehType == VEHICLE_TYPE_CAR);
|
2019-10-21 21:39:59 +00:00
|
|
|
UpdateCompareFlag(pCar->m_bombType == ScriptParams[1]); //TODO: enum
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CHANGE_CAR_COLOUR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
|
|
|
if (ScriptParams[1] >= 256 || ScriptParams[2] >= 256)
|
|
|
|
debug("CHANGE_CAR_COLOUR - Colours must be less than %d", 256);
|
|
|
|
pVehicle->m_currentColour1 = ScriptParams[1];
|
|
|
|
pVehicle->m_currentColour2 = ScriptParams[2];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SWITCH_PED_ROADS_ON:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
ThePaths.SwitchPedRoadsOffInArea(infX, supX, infY, supY, infZ, supZ, false);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SWITCH_PED_ROADS_OFF:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
ThePaths.SwitchPedRoadsOffInArea(infX, supX, infY, supY, infZ, supZ, true);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CHAR_LOOK_AT_CHAR_ALWAYS:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pSourcePed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pSourcePed);
|
2019-10-21 21:39:59 +00:00
|
|
|
CPed* pTargetPed = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTargetPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pSourcePed->SetLookFlag(pTargetPed, true);
|
|
|
|
pSourcePed->SetLookTimer(60000);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CHAR_LOOK_AT_PLAYER_ALWAYS:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pSourcePed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pSourcePed);
|
2019-10-21 21:39:59 +00:00
|
|
|
CPed* pTargetPed = CWorld::Players[ScriptParams[1]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTargetPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pSourcePed->SetLookFlag(pTargetPed, true);
|
|
|
|
pSourcePed->SetLookTimer(60000);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_PLAYER_LOOK_AT_CHAR_ALWAYS:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pSourcePed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pSourcePed);
|
2019-10-21 21:39:59 +00:00
|
|
|
CPed* pTargetPed = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTargetPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pSourcePed->SetLookFlag(pTargetPed, true);
|
|
|
|
pSourcePed->SetLookTimer(60000);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_STOP_CHAR_LOOKING:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pSourcePed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pSourcePed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pSourcePed->ClearLookFlag();
|
2019-10-30 23:00:04 +00:00
|
|
|
pSourcePed->bKeepTryingToLook = false;
|
2019-10-21 21:39:59 +00:00
|
|
|
if (pSourcePed->GetPedState() == PED_LOOK_HEADING || pSourcePed->GetPedState() == PED_LOOK_ENTITY)
|
|
|
|
pSourcePed->RestorePreviousState();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_STOP_PLAYER_LOOKING:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pSourcePed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pSourcePed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pSourcePed->ClearLookFlag();
|
2019-10-30 23:00:04 +00:00
|
|
|
pSourcePed->bKeepTryingToLook = false;
|
2019-10-21 21:39:59 +00:00
|
|
|
if (pSourcePed->GetPedState() == PED_LOOK_HEADING || pSourcePed->GetPedState() == PED_LOOK_ENTITY)
|
|
|
|
pSourcePed->RestorePreviousState();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SWITCH_HELICOPTER:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CHeli::ActivateHeli(ScriptParams[0] != 0);
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
//case COMMAND_SET_GANG_ATTITUDE:
|
|
|
|
//case COMMAND_SET_GANG_GANG_ATTITUDE:
|
|
|
|
//case COMMAND_SET_GANG_PLAYER_ATTITUDE:
|
|
|
|
//case COMMAND_SET_GANG_PED_MODELS:
|
|
|
|
case COMMAND_SET_GANG_CAR_MODEL:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CGangs::SetGangVehicleModel(ScriptParams[0], ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_GANG_WEAPONS:
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CGangs::SetGangWeapons(ScriptParams[0], (eWeaponType)ScriptParams[1], (eWeaponType)ScriptParams[2]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_CHAR_OBJ_RUN_TO_AREA:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
float infX = *(float*)&ScriptParams[1];
|
|
|
|
float infY = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
CVector pos;
|
|
|
|
pos.x = (infX + supX) / 2;
|
|
|
|
pos.y = (infY + supY) / 2;
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2020-04-19 16:34:08 +00:00
|
|
|
float radius = Max(pos.x - infX, pos.y - infY);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->SetObjective(OBJECTIVE_RUN_TO_AREA, pos, radius);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_OBJ_RUN_TO_COORD:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
CVector pos;
|
|
|
|
pos.x = *(float*)&ScriptParams[1];
|
|
|
|
pos.y = *(float*)&ScriptParams[2];
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->SetObjective(OBJECTIVE_RUN_TO_AREA, pos);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_TOUCHING_OBJECT_ON_FOOT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[1]);
|
|
|
|
bool isTouching = false;
|
|
|
|
if (pPed->bInVehicle)
|
|
|
|
isTouching = false;
|
|
|
|
else if (pPed->GetHasCollidedWith(pObject))
|
|
|
|
isTouching = true;
|
|
|
|
UpdateCompareFlag(isTouching);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CHAR_TOUCHING_OBJECT_ON_FOOT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[1]);
|
|
|
|
bool isTouching = false;
|
2019-12-02 20:02:32 +00:00
|
|
|
if (pPed->InVehicle())
|
2019-10-21 21:39:59 +00:00
|
|
|
isTouching = false;
|
|
|
|
else if (pPed->GetHasCollidedWith(pObject))
|
|
|
|
isTouching = true;
|
|
|
|
UpdateCompareFlag(isTouching);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_LOAD_SPECIAL_CHARACTER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
char name[16];
|
2020-02-16 09:44:33 +00:00
|
|
|
strncpy(name, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
for (int i = 0; i < KEY_LENGTH_IN_SCRIPT; i++)
|
2019-12-31 23:35:54 +00:00
|
|
|
name[i] = tolower(name[i]);
|
2019-10-21 21:39:59 +00:00
|
|
|
CStreaming::RequestSpecialChar(ScriptParams[0] - 1, name, STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-10-21 21:39:59 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_HAS_SPECIAL_CHARACTER_LOADED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CStreaming::HasSpecialCharLoaded(ScriptParams[0] - 1));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_FLASH_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-21 21:39:59 +00:00
|
|
|
pVehicle->bHasBlip = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_FLASH_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->bHasBlip = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_FLASH_OBJECT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-10-21 21:39:59 +00:00
|
|
|
pObject->bHasBlip = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_IN_REMOTE_MODE:
|
2020-01-31 10:12:49 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2019-10-21 21:39:59 +00:00
|
|
|
UpdateCompareFlag(CWorld::Players[ScriptParams[0]].IsPlayerInRemoteMode());
|
|
|
|
return 0;
|
|
|
|
case COMMAND_ARM_CAR_WITH_BOMB:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR);
|
2019-10-21 21:39:59 +00:00
|
|
|
((CAutomobile*)pVehicle)->m_bombType = ScriptParams[1];
|
|
|
|
((CAutomobile*)pVehicle)->m_pBombRigger = FindPlayerPed();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_PERSONALITY:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->SetPedStats((ePedStats)ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CUTSCENE_OFFSET:
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CCutsceneMgr::SetCutsceneOffset(*(CVector*)&ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_ANIM_GROUP_FOR_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->m_animGroup = (AssocGroupId)ScriptParams[1];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_ANIM_GROUP_FOR_PLAYER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-21 21:39:59 +00:00
|
|
|
pPed->m_animGroup = (AssocGroupId)ScriptParams[1];
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_REQUEST_MODEL:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int model = ScriptParams[0];
|
|
|
|
if (model < 0)
|
|
|
|
model = CTheScripts::UsedObjectArray[-model].index;
|
|
|
|
CStreaming::RequestModel(model, STREAMFLAGS_DEPENDENCY | STREAMFLAGS_NOFADE | STREAMFLAGS_SCRIPTOWNED);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_HAS_MODEL_LOADED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int model = ScriptParams[0];
|
|
|
|
if (model < 0)
|
|
|
|
model = CTheScripts::UsedObjectArray[-model].index;
|
|
|
|
UpdateCompareFlag(CStreaming::HasModelLoaded(model));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_MARK_MODEL_AS_NO_LONGER_NEEDED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int model = ScriptParams[0];
|
|
|
|
if (model < 0)
|
|
|
|
model = CTheScripts::UsedObjectArray[-model].index;
|
|
|
|
CStreaming::SetMissionDoesntRequireModel(model);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GRAB_PHONE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
ScriptParams[0] = gPhoneInfo.GrabPhone(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_REPEATED_PHONE_MESSAGE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-10-21 21:39:59 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_Repeatedly(ScriptParams[0], text, nil, nil, nil, nil, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_PHONE_MESSAGE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-10-21 21:39:59 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_JustOnce(ScriptParams[0], text, nil, nil, nil, nil, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_HAS_PHONE_DISPLAYED_MESSAGE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2019-12-02 20:02:32 +00:00
|
|
|
UpdateCompareFlag(gPhoneInfo.HasMessageBeenDisplayed(ScriptParams[0]));
|
2019-10-21 21:39:59 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_TURN_PHONE_OFF:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
gPhoneInfo.SetPhoneMessage_JustOnce(ScriptParams[0], nil, nil, nil, nil, nil, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DRAW_CORONA:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 9);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-10-21 21:39:59 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2020-05-11 02:55:57 +00:00
|
|
|
CCoronas::RegisterCorona((uintptr)this + m_nIp, ScriptParams[6], ScriptParams[7], ScriptParams[8],
|
2019-10-21 21:39:59 +00:00
|
|
|
255, pos, *(float*)&ScriptParams[3], 150.0f, ScriptParams[4], ScriptParams[5], 1, 0, 0, 0.0f);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_DRAW_LIGHT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
CVector unused(0.0f, 0.0f, 0.0f);
|
|
|
|
CPointLights::AddLight(0, *(CVector*)&ScriptParams[0], CVector(0.0f, 0.0f, 0.0f), 12.0f,
|
|
|
|
ScriptParams[3] / 255.0f, ScriptParams[4] / 255.0f, ScriptParams[5] / 255.0f, 0, true);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_STORE_WEATHER:
|
|
|
|
CWeather::StoreWeatherState();
|
|
|
|
return 0;
|
|
|
|
case COMMAND_RESTORE_WEATHER:
|
|
|
|
CWeather::RestoreWeatherState();
|
|
|
|
return 0;
|
|
|
|
case COMMAND_STORE_CLOCK:
|
|
|
|
CClock::StoreClock();
|
|
|
|
return 0;
|
|
|
|
case COMMAND_RESTORE_CLOCK:
|
|
|
|
CClock::RestoreClock();
|
|
|
|
return 0;
|
|
|
|
case COMMAND_RESTART_CRITICAL_MISSION:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-10-21 21:39:59 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CRestart::OverrideNextRestart(pos, *(float*)&ScriptParams[3]);
|
2020-04-30 10:48:01 +00:00
|
|
|
if (CWorld::Players[CWorld::PlayerInFocus].m_WBState != WBSTATE_PLAYING)
|
2019-10-21 21:39:59 +00:00
|
|
|
printf("RESTART_CRITICAL_MISSION - Player state is not PLAYING\n");
|
|
|
|
CWorld::Players[CWorld::PlayerInFocus].PlayerFailedCriticalMission();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_PLAYING:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CWorld::Players[ScriptParams[0]].m_WBState == WBSTATE_PLAYING);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
//case COMMAND_SET_COLL_OBJ_NO_OBJ:
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-10-21 21:39:59 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands600To699(int32 command)
|
2019-10-27 09:51:09 +00:00
|
|
|
{
|
|
|
|
switch (command){
|
|
|
|
/* Collective commands are not implemented until LCS.
|
|
|
|
case COMMAND_SET_COLL_OBJ_WAIT_ON_FOOT:
|
|
|
|
case COMMAND_SET_COLL_OBJ_FLEE_ON_FOOT_TILL_SAFE:
|
|
|
|
case COMMAND_SET_COLL_OBJ_GUARD_SPOT:
|
|
|
|
case COMMAND_SET_COLL_OBJ_GUARD_AREA:
|
|
|
|
case COMMAND_SET_COLL_OBJ_WAIT_IN_CAR:
|
|
|
|
case COMMAND_SET_COLL_OBJ_KILL_CHAR_ON_FOOT:
|
|
|
|
case COMMAND_SET_COLL_OBJ_KILL_PLAYER_ON_FOOT:
|
|
|
|
case COMMAND_SET_COLL_OBJ_KILL_CHAR_ANY_MEANS:
|
|
|
|
case COMMAND_SET_COLL_OBJ_KILL_PLAYER_ANY_MEANS:
|
|
|
|
case COMMAND_SET_COLL_OBJ_FLEE_CHAR_ON_FOOT_TILL_SAFE:
|
|
|
|
case COMMAND_SET_COLL_OBJ_FLEE_PLAYER_ON_FOOT_TILL_SAFE:
|
|
|
|
case COMMAND_SET_COLL_OBJ_FLEE_CHAR_ON_FOOT_ALWAYS:
|
|
|
|
case COMMAND_SET_COLL_OBJ_FLEE_PLAYER_ON_FOOT_ALWAYS:
|
|
|
|
case COMMAND_SET_COLL_OBJ_GOTO_CHAR_ON_FOOT:
|
|
|
|
case COMMAND_SET_COLL_OBJ_GOTO_PLAYER_ON_FOOT:
|
|
|
|
case COMMAND_SET_COLL_OBJ_LEAVE_CAR:
|
|
|
|
case COMMAND_SET_COLL_OBJ_ENTER_CAR_AS_PASSENGER:
|
|
|
|
case COMMAND_SET_COLL_OBJ_ENTER_CAR_AS_DRIVER:
|
|
|
|
case COMMAND_SET_COLL_OBJ_FOLLOW_CAR_IN_CAR:
|
|
|
|
case COMMAND_SET_COLL_OBJ_FIRE_AT_OBJECT_FROM_VEHICLE:
|
|
|
|
case COMMAND_SET_COLL_OBJ_DESTROY_OBJECT:
|
|
|
|
case COMMAND_SET_COLL_OBJ_DESTROY_CAR:
|
|
|
|
case COMMAND_SET_COLL_OBJ_GOTO_AREA_ON_FOOT:
|
|
|
|
case COMMAND_SET_COLL_OBJ_GOTO_AREA_IN_CAR:
|
|
|
|
case COMMAND_SET_COLL_OBJ_FOLLOW_CAR_ON_FOOT_WITH_OFFSET:
|
|
|
|
case COMMAND_SET_COLL_OBJ_GUARD_ATTACK:
|
|
|
|
case COMMAND_SET_COLL_OBJ_FOLLOW_ROUTE:
|
|
|
|
case COMMAND_SET_COLL_OBJ_GOTO_COORD_ON_FOOT:
|
|
|
|
case COMMAND_SET_COLL_OBJ_GOTO_COORD_IN_CAR:
|
|
|
|
case COMMAND_SET_COLL_OBJ_RUN_TO_AREA:
|
|
|
|
case COMMAND_SET_COLL_OBJ_RUN_TO_COORD:
|
|
|
|
case COMMAND_ADD_PEDS_IN_AREA_TO_COLL:
|
|
|
|
case COMMAND_ADD_PEDS_IN_VEHICLE_TO_COLL:
|
|
|
|
case COMMAND_CLEAR_COLL:
|
|
|
|
case COMMAND_IS_COLL_IN_CARS:
|
|
|
|
case COMMAND_LOCATE_COLL_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_IN_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_COLL_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_COLL_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_COLL_IN_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_ANY_MEANS_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_ON_FOOT_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_IN_CAR_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_ANY_MEANS_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_ON_FOOT_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_IN_CAR_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_ANY_MEANS_PLAYER_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_ON_FOOT_PLAYER_2D:
|
|
|
|
case COMMAND_LOCATE_COLL_IN_CAR_PLAYER_2D:
|
|
|
|
case COMMAND_IS_COLL_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_COLL_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_COLL_IN_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_COLL_STOPPED_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_COLL_STOPPED_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_COLL_STOPPED_IN_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_GET_NUMBER_OF_PEDS_IN_COLL:
|
|
|
|
*/
|
|
|
|
case COMMAND_SET_CHAR_HEED_THREATS:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-27 09:51:09 +00:00
|
|
|
pPed->bRespondsToThreats = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_PLAYER_HEED_THREATS:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-27 09:51:09 +00:00
|
|
|
pPed->bRespondsToThreats = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_CONTROLLER_MODE:
|
2020-05-02 16:39:26 +00:00
|
|
|
#if defined(GTA_PC) && !defined(DETECT_PAD_INPUT_SWITCH)
|
2019-10-27 09:51:09 +00:00
|
|
|
ScriptParams[0] = 0;
|
2020-05-02 16:39:26 +00:00
|
|
|
#else
|
2020-05-02 21:11:02 +00:00
|
|
|
ScriptParams[0] = CPad::IsAffectedByController ? CPad::GetPad(0)->Mode : 0;
|
2020-05-02 16:39:26 +00:00
|
|
|
#endif
|
2019-10-27 09:51:09 +00:00
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SET_CAN_RESPRAY_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR);
|
2019-10-27 09:51:09 +00:00
|
|
|
((CAutomobile*)pVehicle)->bFixedColour = (ScriptParams[1] == 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_TAXI:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-27 09:51:09 +00:00
|
|
|
int mi = pVehicle->GetModelIndex();
|
|
|
|
UpdateCompareFlag(mi == MI_TAXI || mi == MI_CABBIE || mi == MI_BORGNINE);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_UNLOAD_SPECIAL_CHARACTER:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStreaming::SetMissionDoesntRequireSpecialChar(ScriptParams[0] - 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_RESET_NUM_OF_MODELS_KILLED_BY_PLAYER:
|
|
|
|
CDarkel::ResetModelsKilledByPlayer();
|
|
|
|
return 0;
|
|
|
|
case COMMAND_GET_NUM_OF_MODELS_KILLED_BY_PLAYER:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
ScriptParams[0] = CDarkel::QueryModelsKilledByPlayer(ScriptParams[0]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_ACTIVATE_GARAGE:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CGarages::ActivateGarage(ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_SWITCH_TAXI_TIMER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
if (ScriptParams[0] != 0){
|
2019-12-31 23:55:00 +00:00
|
|
|
CWorld::Players[CWorld::PlayerInFocus].m_nUnusedTaxiTimer = CTimer::GetTimeInMilliseconds();
|
|
|
|
CWorld::Players[CWorld::PlayerInFocus].m_bUnusedTaxiThing = true;
|
2019-10-27 09:51:09 +00:00
|
|
|
}else{
|
2019-12-31 23:55:00 +00:00
|
|
|
CWorld::Players[CWorld::PlayerInFocus].m_bUnusedTaxiThing = false;
|
2019-10-27 09:51:09 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_CREATE_OBJECT_NO_OFFSET:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
int mi = ScriptParams[0] >= 0 ? ScriptParams[0] : CTheScripts::UsedObjectArray[-ScriptParams[0]].index;
|
2020-01-01 20:55:01 +00:00
|
|
|
CObject* pObj = new CObject(mi, false);
|
|
|
|
; pObj->ObjectCreatedBy = MISSION_OBJECT;
|
2019-10-27 09:51:09 +00:00
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-10-27 09:51:09 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2020-05-05 01:45:18 +00:00
|
|
|
pObj->SetPosition(pos);
|
2019-10-27 09:51:09 +00:00
|
|
|
pObj->SetOrientation(0.0f, 0.0f, 0.0f);
|
|
|
|
pObj->GetMatrix().UpdateRW();
|
|
|
|
pObj->UpdateRwFrame();
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, pObj);
|
|
|
|
CWorld::Add(pObj);
|
|
|
|
ScriptParams[0] = CPools::GetObjectPool()->GetIndex(pObj);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ScriptParams[0], CLEANUP_OBJECT);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_BOAT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-27 09:51:09 +00:00
|
|
|
UpdateCompareFlag(pVehicle->m_vehType == VEHICLE_TYPE_BOAT);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_OBJ_GOTO_AREA_ANY_MEANS:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-27 09:51:09 +00:00
|
|
|
float infX = *(float*)&ScriptParams[1];
|
|
|
|
float infY = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
CVector pos;
|
|
|
|
pos.x = (infX + supX) / 2;
|
|
|
|
pos.y = (infY + supY) / 2;
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2020-04-19 16:34:08 +00:00
|
|
|
float radius = Max(pos.x - infX, pos.y - infY);
|
2019-10-27 09:51:09 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->SetObjective(OBJECTIVE_GOTO_AREA_ANY_MEANS, pos, radius);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
//case COMMAND_SET_COLL_OBJ_GOTO_AREA_ANY_MEANS:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPlayerInfo* pPlayer = &CWorld::Players[ScriptParams[0]];
|
|
|
|
UpdateCompareFlag(CTheScripts::IsPlayerStopped(pPlayer));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_CHAR_STOPPED:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
UpdateCompareFlag(CTheScripts::IsPedStopped(pPed));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_MESSAGE_WAIT:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
m_nWakeTime = CTimer::GetTimeInMilliseconds() + ScriptParams[0];
|
|
|
|
if (ScriptParams[1] != 0)
|
|
|
|
m_bSkipWakeTime = true;
|
|
|
|
return 1;
|
|
|
|
case COMMAND_ADD_PARTICLE_EFFECT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
2020-01-01 20:55:01 +00:00
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-10-27 09:51:09 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CParticleObject::AddObject(ScriptParams[0], pos, ScriptParams[4] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SWITCH_WIDESCREEN:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
if (ScriptParams[0] != 0)
|
|
|
|
TheCamera.SetWideScreenOn();
|
|
|
|
else
|
|
|
|
TheCamera.SetWideScreenOff();
|
|
|
|
return 0;
|
|
|
|
case COMMAND_ADD_SPRITE_BLIP_FOR_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-27 09:51:09 +00:00
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
int id = CRadar::SetEntityBlip(BLIP_CAR, ScriptParams[0], 0, BLIP_DISPLAY_BOTH);
|
|
|
|
CRadar::SetBlipSprite(id, ScriptParams[1]);
|
|
|
|
ScriptParams[0] = id;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_SPRITE_BLIP_FOR_CHAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-27 09:51:09 +00:00
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
int id = CRadar::SetEntityBlip(BLIP_CHAR, ScriptParams[0], 1, BLIP_DISPLAY_BOTH);
|
|
|
|
CRadar::SetBlipSprite(id, ScriptParams[1]);
|
|
|
|
ScriptParams[0] = id;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_SPRITE_BLIP_FOR_OBJECT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-10-27 09:51:09 +00:00
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
int id = CRadar::SetEntityBlip(BLIP_OBJECT, ScriptParams[0], 6, BLIP_DISPLAY_BOTH);
|
|
|
|
CRadar::SetBlipSprite(id, ScriptParams[1]);
|
|
|
|
ScriptParams[0] = id;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_SPRITE_BLIP_FOR_CONTACT_POINT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-10-27 09:51:09 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
int id = CRadar::SetCoordBlip(BLIP_CONTACT_POINT, pos, 2, BLIP_DISPLAY_BOTH);
|
|
|
|
CRadar::SetBlipSprite(id, ScriptParams[3]);
|
|
|
|
ScriptParams[0] = id;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_ADD_SPRITE_BLIP_FOR_COORD:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-10-27 09:51:09 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
int id = CRadar::SetCoordBlip(BLIP_COORD, pos, 5, BLIP_DISPLAY_BOTH);
|
|
|
|
CRadar::SetBlipSprite(id, ScriptParams[3]);
|
|
|
|
ScriptParams[0] = id;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_ONLY_DAMAGED_BY_PLAYER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-27 09:51:09 +00:00
|
|
|
pPed->bOnlyDamagedByPlayer = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CAR_ONLY_DAMAGED_BY_PLAYER:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-27 09:51:09 +00:00
|
|
|
pVehicle->bOnlyDamagedByPlayer = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_PROOFS:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-10-27 09:51:09 +00:00
|
|
|
pPed->bBulletProof = (ScriptParams[1] != 0);
|
|
|
|
pPed->bFireProof = (ScriptParams[2] != 0);
|
|
|
|
pPed->bExplosionProof = (ScriptParams[3] != 0);
|
|
|
|
pPed->bCollisionProof = (ScriptParams[4] != 0);
|
|
|
|
pPed->bMeleeProof = (ScriptParams[5] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CAR_PROOFS:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-10-27 09:51:09 +00:00
|
|
|
pVehicle->bBulletProof = (ScriptParams[1] != 0);
|
|
|
|
pVehicle->bFireProof = (ScriptParams[2] != 0);
|
|
|
|
pVehicle->bExplosionProof = (ScriptParams[3] != 0);
|
|
|
|
pVehicle->bCollisionProof = (ScriptParams[4] != 0);
|
|
|
|
pVehicle->bMeleeProof = (ScriptParams[5] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_IN_CAR_3D:
|
|
|
|
PlayerInAngledAreaCheckCommand(command, &m_nIp);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_DEACTIVATE_GARAGE:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CGarages::DeActivateGarage(ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_GET_NUMBER_OF_CARS_COLLECTED_BY_GARAGE:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
ScriptParams[0] = CGarages::QueryCarsCollected(ScriptParams[0]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_HAS_CAR_BEEN_TAKEN_TO_GARAGE:
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
UpdateCompareFlag(CGarages::HasThisCarBeenCollected(ScriptParams[0], ScriptParams[1] - 1));
|
|
|
|
return 0;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-10-27 09:51:09 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands700To799(int32 command)
|
2019-11-09 13:44:17 +00:00
|
|
|
{
|
|
|
|
switch (command){
|
|
|
|
case COMMAND_SET_SWAT_REQUIRED:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
FindPlayerPed()->m_pWanted->m_bSwatRequired = (ScriptParams[0] != 0);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_FBI_REQUIRED:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
FindPlayerPed()->m_pWanted->m_bFbiRequired = (ScriptParams[0] != 0);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_ARMY_REQUIRED:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
FindPlayerPed()->m_pWanted->m_bArmyRequired = (ScriptParams[0] != 0);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CAR_IN_WATER:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-05-14 12:26:59 +00:00
|
|
|
UpdateCompareFlag(pVehicle && pVehicle->bIsInWater);
|
2019-12-31 23:35:54 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CLOSEST_CHAR_NODE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-12-31 23:35:54 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CPathNode* pNode = &ThePaths.m_pathNodes[ThePaths.FindNodeClosestToCoors(pos, 1, 999999.9f)];
|
2020-05-03 13:57:57 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = pNode->GetPosition();
|
2019-12-31 23:35:54 +00:00
|
|
|
StoreParameters(&m_nIp, 3);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CLOSEST_CAR_NODE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-12-31 23:35:54 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CPathNode* pNode = &ThePaths.m_pathNodes[ThePaths.FindNodeClosestToCoors(pos, 0, 999999.9f)];
|
2020-05-03 13:57:57 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = pNode->GetPosition();
|
2019-12-31 23:35:54 +00:00
|
|
|
StoreParameters(&m_nIp, 3);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CAR_GOTO_COORDINATES_ACCURATE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-12-31 23:35:54 +00:00
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-12-31 23:35:54 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pos.z += pVehicle->GetDistanceFromCentreOfMassToBaseOfModel();
|
|
|
|
if (CCarCtrl::JoinCarWithRoadSystemGotoCoors(pVehicle, pos, false))
|
|
|
|
pVehicle->AutoPilot.m_nCarMission = MISSION_GOTO_COORDS_STRAIGHT_ACCURATE;
|
|
|
|
else
|
|
|
|
pVehicle->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_ACCURATE;
|
2020-04-30 13:45:45 +00:00
|
|
|
pVehicle->SetStatus(STATUS_PHYSICS);
|
2019-12-31 23:35:54 +00:00
|
|
|
pVehicle->bEngineOn = true;
|
2020-04-19 16:34:08 +00:00
|
|
|
pVehicle->AutoPilot.m_nCruiseSpeed = Max(6, pVehicle->AutoPilot.m_nCruiseSpeed);
|
2019-12-31 23:35:54 +00:00
|
|
|
pVehicle->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_PACMAN_RACE:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPacManPickups::StartPacManRace(ScriptParams[0]);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_PACMAN_RECORD:
|
2019-12-31 23:35:54 +00:00
|
|
|
CPacManPickups::StartPacManRecord();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_NUMBER_OF_POWER_PILLS_EATEN:
|
2019-12-31 23:35:54 +00:00
|
|
|
ScriptParams[0] = CPacManPickups::QueryPowerPillsEatenInRace();
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_PACMAN:
|
2019-12-31 23:35:54 +00:00
|
|
|
CPacManPickups::CleanUpPacManStuff();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_PACMAN_SCRAMBLE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-12-31 23:35:54 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CPacManPickups::StartPacManScramble(pos, *(float*)&ScriptParams[3], ScriptParams[4]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_NUMBER_OF_POWER_PILLS_CARRIED:
|
2019-12-31 23:35:54 +00:00
|
|
|
ScriptParams[0] = CPacManPickups::QueryPowerPillsCarriedByPlayer();
|
2020-02-01 22:12:20 +00:00
|
|
|
StoreParameters(&m_nIp, 1);
|
2019-12-31 23:35:54 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_NUMBER_OF_POWER_PILLS_CARRIED:
|
2019-12-31 23:35:54 +00:00
|
|
|
CPacManPickups::ResetPowerPillsCarriedByPlayer();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CAR_ON_SCREEN:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(TheCamera.IsSphereVisible(pVehicle->GetBoundCentre(), pVehicle->GetBoundRadius()));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_ON_SCREEN:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(TheCamera.IsSphereVisible(pPed->GetBoundCentre(), pPed->GetBoundRadius()));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_OBJECT_ON_SCREEN:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(TheCamera.IsSphereVisible(pObject->GetBoundCentre(), pObject->GetBoundRadius()));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GOSUB_FILE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(m_nStackPointer < MAX_STACK_DEPTH);
|
2019-12-31 23:35:54 +00:00
|
|
|
m_anStack[m_nStackPointer++] = m_nIp;
|
2020-02-23 10:12:44 +00:00
|
|
|
SetIP(ScriptParams[0]);
|
2019-12-31 23:35:54 +00:00
|
|
|
// ScriptParams[1] == filename
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_GROUND_Z_FOR_3D_COORD:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
bool success;
|
|
|
|
*(float*)&ScriptParams[0] = CWorld::FindGroundZFor3DCoord(pos.x, pos.y, pos.z, &success);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_SCRIPT_FIRE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-12-31 23:35:54 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
ScriptParams[0] = gFireManager.StartScriptFire(pos, nil, 0.8f, 1);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_SCRIPT_FIRE_EXTINGUISHED:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(gFireManager.IsScriptFireExtinguish(ScriptParams[0]));
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REMOVE_SCRIPT_FIRE:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
gFireManager.RemoveScriptFire(ScriptParams[0]);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_COMEDY_CONTROLS:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-12-31 23:35:54 +00:00
|
|
|
pVehicle->bComedyControls = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_BOAT_GOTO_COORDS:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_BOAT);
|
2019-12-31 23:35:54 +00:00
|
|
|
CBoat* pBoat = (CBoat*)pVehicle;
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-12-31 23:35:54 +00:00
|
|
|
CWaterLevel::GetWaterLevel(pos.x, pos.y, pos.z, &pos.z, false);
|
|
|
|
pBoat->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_ASTHECROWSWIMS;
|
|
|
|
pBoat->AutoPilot.m_vecDestinationCoors = pos;
|
2020-04-30 13:45:45 +00:00
|
|
|
pBoat->SetStatus(STATUS_PHYSICS);
|
2020-04-19 16:34:08 +00:00
|
|
|
pBoat->AutoPilot.m_nCruiseSpeed = Max(6, pBoat->AutoPilot.m_nCruiseSpeed);
|
2019-12-31 23:35:54 +00:00
|
|
|
pBoat->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_BOAT_STOP:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-01-01 12:16:38 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2019-12-31 23:35:54 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_BOAT);
|
2019-12-31 23:35:54 +00:00
|
|
|
CBoat* pBoat = (CBoat*)pVehicle;
|
|
|
|
pBoat->AutoPilot.m_nCarMission = MISSION_NONE;
|
2020-04-30 13:45:45 +00:00
|
|
|
pBoat->SetStatus(STATUS_PHYSICS);
|
2019-12-31 23:35:54 +00:00
|
|
|
pBoat->bEngineOn = false;
|
|
|
|
pBoat->AutoPilot.m_nCruiseSpeed = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_SHOOTING_IN_AREA:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[1];
|
|
|
|
float y1 = *(float*)&ScriptParams[2];
|
|
|
|
float x2 = *(float*)&ScriptParams[3];
|
|
|
|
float y2 = *(float*)&ScriptParams[4];
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(pPed->bIsShooting && pPed->IsWithinArea(x1, y1, x2, y2));
|
|
|
|
if (!ScriptParams[5])
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
|
2019-12-31 23:35:54 +00:00
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_SHOOTING_IN_AREA:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[1];
|
|
|
|
float y1 = *(float*)&ScriptParams[2];
|
|
|
|
float x2 = *(float*)&ScriptParams[3];
|
|
|
|
float y2 = *(float*)&ScriptParams[4];
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(pPed->bIsShooting && pPed->IsWithinArea(x1, y1, x2, y2));
|
|
|
|
if (!ScriptParams[5])
|
|
|
|
return 0;
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, x1, y1, x2, y2, MAP_Z_LOW_LIMIT);
|
2019-12-31 23:35:54 +00:00
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugSquare(x1, y1, x2, y2);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CURRENT_PLAYER_WEAPON:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-05-11 02:55:57 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
2019-12-31 23:35:54 +00:00
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(ScriptParams[1] == pPed->m_weapons[pPed->m_currentWeapon].m_eWeaponType);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CURRENT_CHAR_WEAPON:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(ScriptParams[1] == pPed->m_weapons[pPed->m_currentWeapon].m_eWeaponType);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_NUMBER_OF_POWER_PILLS_EATEN:
|
2019-12-31 23:35:54 +00:00
|
|
|
CPacManPickups::ResetPowerPillsEatenInRace();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ADD_POWER_PILL:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2019-12-31 23:35:54 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CPacManPickups::GenerateOnePMPickUp(pos);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_BOAT_CRUISE_SPEED:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_BOAT);
|
2019-12-31 23:35:54 +00:00
|
|
|
CBoat* pBoat = (CBoat*)pVehicle;
|
2020-02-02 11:09:39 +00:00
|
|
|
pBoat->AutoPilot.m_nCruiseSpeed = *(float*)&ScriptParams[1];
|
2020-01-31 20:28:22 +00:00
|
|
|
return 0;
|
2019-12-31 23:35:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_RANDOM_CHAR_IN_AREA:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
int ped_handle = -1;
|
|
|
|
CVector pos = FindPlayerCoors();
|
2020-01-31 20:28:22 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[0];
|
|
|
|
float y1 = *(float*)&ScriptParams[1];
|
|
|
|
float x2 = *(float*)&ScriptParams[2];
|
|
|
|
float y2 = *(float*)&ScriptParams[3];
|
2019-12-31 23:35:54 +00:00
|
|
|
int i = CPools::GetPedPool()->GetSize();
|
|
|
|
while (--i && ped_handle == -1){
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetSlot(i);
|
|
|
|
if (!pPed)
|
|
|
|
continue;
|
|
|
|
if (CTheScripts::LastRandomPedId == CPools::GetPedPool()->GetIndex(pPed))
|
|
|
|
continue;
|
|
|
|
if (pPed->CharCreatedBy != RANDOM_CHAR)
|
|
|
|
continue;
|
|
|
|
if (!pPed->IsPedInControl())
|
|
|
|
continue;
|
|
|
|
if (pPed->bRemoveFromWorld)
|
|
|
|
continue;
|
|
|
|
if (pPed->bFadeOut)
|
|
|
|
continue;
|
|
|
|
if (pPed->GetModelIndex() == MI_SCUM_WOM || pPed->GetModelIndex() == MI_SCUM_MAN)
|
|
|
|
continue;
|
|
|
|
if (!ThisIsAValidRandomPed(pPed->m_nPedType))
|
|
|
|
continue;
|
|
|
|
if (pPed->bIsLeader || pPed->m_leader)
|
|
|
|
continue;
|
|
|
|
if (!pPed->IsWithinArea(x1, y1, x2, y2))
|
|
|
|
continue;
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z - PED_FIND_Z_OFFSET > pPed->GetPosition().z)
|
2019-12-31 23:35:54 +00:00
|
|
|
continue;
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z + PED_FIND_Z_OFFSET < pPed->GetPosition().z)
|
2019-12-31 23:35:54 +00:00
|
|
|
continue;
|
|
|
|
ped_handle = CPools::GetPedPool()->GetIndex(pPed);
|
|
|
|
CTheScripts::LastRandomPedId = ped_handle;
|
|
|
|
pPed->CharCreatedBy = MISSION_CHAR;
|
|
|
|
pPed->bRespondsToThreats = false;
|
|
|
|
++CPopulation::ms_nTotalMissionPeds;
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ped_handle, CLEANUP_CHAR);
|
|
|
|
}
|
|
|
|
ScriptParams[0] = ped_handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_RANDOM_CHAR_IN_ZONE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-02-16 09:44:33 +00:00
|
|
|
char zone[KEY_LENGTH_IN_SCRIPT];
|
|
|
|
strncpy(zone, (const char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
2019-12-31 23:35:54 +00:00
|
|
|
int nZone = CTheZones::FindZoneByLabelAndReturnIndex(zone);
|
|
|
|
if (nZone != -1)
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-12-31 23:35:54 +00:00
|
|
|
CZone* pZone = CTheZones::GetZone(nZone);
|
|
|
|
int ped_handle = -1;
|
|
|
|
CVector pos = FindPlayerCoors();
|
|
|
|
int i = CPools::GetPedPool()->GetSize();
|
|
|
|
while (--i && ped_handle == -1) {
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetSlot(i);
|
|
|
|
if (!pPed)
|
|
|
|
continue;
|
|
|
|
if (CTheScripts::LastRandomPedId == CPools::GetPedPool()->GetIndex(pPed))
|
|
|
|
continue;
|
|
|
|
if (pPed->CharCreatedBy != RANDOM_CHAR)
|
|
|
|
continue;
|
|
|
|
if (!pPed->IsPedInControl())
|
|
|
|
continue;
|
|
|
|
if (pPed->bRemoveFromWorld)
|
|
|
|
continue;
|
|
|
|
if (pPed->bFadeOut)
|
|
|
|
continue;
|
|
|
|
if (pPed->GetModelIndex() == MI_SCUM_WOM || pPed->GetModelIndex() == MI_SCUM_MAN)
|
|
|
|
continue;
|
|
|
|
if (!ThisIsAValidRandomPed(pPed->m_nPedType))
|
|
|
|
continue;
|
|
|
|
if (pPed->bIsLeader || pPed->m_leader)
|
|
|
|
continue;
|
2020-05-06 10:23:26 +00:00
|
|
|
if (!CTheZones::PointLiesWithinZone(&pPed->GetPosition(), pZone))
|
2019-12-31 23:35:54 +00:00
|
|
|
continue;
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z - PED_FIND_Z_OFFSET > pPed->GetPosition().z)
|
2019-12-31 23:35:54 +00:00
|
|
|
continue;
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z + PED_FIND_Z_OFFSET < pPed->GetPosition().z)
|
2019-12-31 23:35:54 +00:00
|
|
|
continue;
|
|
|
|
ped_handle = CPools::GetPedPool()->GetIndex(pPed);
|
|
|
|
CTheScripts::LastRandomPedId = ped_handle;
|
|
|
|
pPed->CharCreatedBy = MISSION_CHAR;
|
|
|
|
pPed->bRespondsToThreats = false;
|
|
|
|
++CPopulation::ms_nTotalMissionPeds;
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ped_handle, CLEANUP_CHAR);
|
|
|
|
}
|
|
|
|
ScriptParams[0] = ped_handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_IN_TAXI:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(pPed->bInVehicle && pPed->m_pMyVehicle->IsTaxi());
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_SHOOTING:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(pPed->bIsShooting);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_SHOOTING:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(pPed->bIsShooting);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CREATE_MONEY_PICKUP:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y) + PICKUP_PLACEMENT_OFFSET;
|
2019-12-31 23:35:54 +00:00
|
|
|
CPickups::GetActualPickupIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
ScriptParams[0] = CPickups::GenerateNewOne(pos, MI_MONEY, PICKUP_MONEY, ScriptParams[3]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_ACCURACY:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-12-31 23:35:54 +00:00
|
|
|
pPed->m_wepAccuracy = ScriptParams[1];
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CAR_SPEED:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-12-31 23:35:54 +00:00
|
|
|
*(float*)&ScriptParams[0] = pVehicle->GetSpeed().Magnitude() * GAME_SPEED_TO_METERS_PER_SECOND;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_CUTSCENE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-02-16 09:44:33 +00:00
|
|
|
char name[KEY_LENGTH_IN_SCRIPT];
|
|
|
|
strncpy(name, (const char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-12-31 23:35:54 +00:00
|
|
|
CCutsceneMgr::LoadCutsceneData(name);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CREATE_CUTSCENE_OBJECT:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CCutsceneObject* pCutObj = CCutsceneMgr::CreateCutsceneObject(ScriptParams[0]);
|
|
|
|
ScriptParams[0] = CPools::GetObjectPool()->GetIndex(pCutObj);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CUTSCENE_ANIM:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-16 09:44:33 +00:00
|
|
|
char name[KEY_LENGTH_IN_SCRIPT];
|
2019-12-31 23:35:54 +00:00
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-02-16 09:44:33 +00:00
|
|
|
strncpy(name, (const char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-12-31 23:35:54 +00:00
|
|
|
CCutsceneMgr::SetCutsceneAnim(name, pObject);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_START_CUTSCENE:
|
|
|
|
CCutsceneMgr::ms_cutsceneLoadStatus = 1;
|
|
|
|
return 0;
|
|
|
|
case COMMAND_GET_CUTSCENE_TIME:
|
|
|
|
ScriptParams[0] = CCutsceneMgr::GetCutsceneTimeInMilleseconds();
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
case COMMAND_HAS_CUTSCENE_FINISHED:
|
|
|
|
UpdateCompareFlag(CCutsceneMgr::HasCutsceneFinished());
|
|
|
|
return 0;
|
|
|
|
case COMMAND_CLEAR_CUTSCENE:
|
|
|
|
CCutsceneMgr::DeleteCutsceneData();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_RESTORE_CAMERA_JUMPCUT:
|
2019-12-31 23:35:54 +00:00
|
|
|
TheCamera.RestoreWithJumpCut();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CREATE_COLLECTABLE1:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y) + PICKUP_PLACEMENT_OFFSET;
|
2019-12-31 23:35:54 +00:00
|
|
|
CPickups::GenerateNewOne(pos, MI_COLLECTABLE1, PICKUP_COLLECTABLE1, 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_COLLECTABLE1_TOTAL:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CWorld::Players[CWorld::PlayerInFocus].m_nTotalPackages = ScriptParams[0];
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PROJECTILE_IN_AREA:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(CProjectileInfo::IsProjectileInRange(infX, supX, infY, supY, infZ, supZ, false));
|
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugCube(infX, infY, infZ, supX, supY, supZ);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DESTROY_PROJECTILES_IN_AREA:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(CProjectileInfo::IsProjectileInRange(infX, supX, infY, supY, infZ, supZ, true));
|
|
|
|
if (CTheScripts::DbgFlag)
|
|
|
|
CTheScripts::DrawDebugCube(infX, infY, infZ, supX, supY, supZ);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DROP_MINE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y) + PICKUP_PLACEMENT_OFFSET;
|
2019-12-31 23:35:54 +00:00
|
|
|
CPickups::GenerateNewOne(pos, MI_CARMINE, PICKUP_MINE_INACTIVE, 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DROP_NAUTICAL_MINE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y) + PICKUP_PLACEMENT_OFFSET;
|
2019-12-31 23:35:54 +00:00
|
|
|
CPickups::GenerateNewOne(pos, MI_NAUTICALMINE, PICKUP_MINE_INACTIVE, 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_MODEL:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(ScriptParams[1] == pPed->GetModelIndex());
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_SPECIAL_MODEL:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-16 09:44:33 +00:00
|
|
|
char name[KEY_LENGTH_IN_SCRIPT];
|
|
|
|
strncpy(name, (const char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
for (int i = 0; i < KEY_LENGTH_IN_SCRIPT; i++)
|
2019-12-31 23:35:54 +00:00
|
|
|
name[i] = tolower(name[i]);
|
|
|
|
CStreaming::RequestSpecialModel(ScriptParams[0], name, STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-12-31 23:35:54 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CREATE_CUTSCENE_HEAD:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2019-12-31 23:35:54 +00:00
|
|
|
CCutsceneHead* pCutHead = CCutsceneMgr::AddCutsceneHead(pObject, ScriptParams[1]);
|
|
|
|
ScriptParams[0] = CPools::GetObjectPool()->GetIndex(pCutHead);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CUTSCENE_HEAD_ANIM:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pCutHead = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pCutHead);
|
2020-02-16 09:44:33 +00:00
|
|
|
char name[KEY_LENGTH_IN_SCRIPT];
|
|
|
|
strncpy(name, (const char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2019-12-31 23:35:54 +00:00
|
|
|
CTimer::Stop();
|
|
|
|
CCutsceneMgr::SetHeadAnim(name, pCutHead);
|
|
|
|
CTimer::Update();
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SIN:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)&ScriptParams[0] = Sin(DEGTORAD(*(float*)&ScriptParams[0]));
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_COS:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
*(float*)&ScriptParams[0] = Cos(DEGTORAD(*(float*)&ScriptParams[0]));
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CAR_FORWARD_X:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
|
|
|
float forwardX = pVehicle->GetForward().x / pVehicle->GetForward().Magnitude2D();
|
|
|
|
*(float*)&ScriptParams[0] = forwardX;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CAR_FORWARD_Y:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
|
|
|
float forwardY = pVehicle->GetForward().y / pVehicle->GetForward().Magnitude2D();
|
|
|
|
*(float*)&ScriptParams[0] = forwardY;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CHANGE_GARAGE_TYPE:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
2020-02-15 11:53:42 +00:00
|
|
|
CGarages::ChangeGarageType(ScriptParams[0], (eGarageType)ScriptParams[1], 0);
|
2019-12-31 23:35:54 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ACTIVATE_CRUSHER_CRANE:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 10);
|
|
|
|
float infX = *(float*)&ScriptParams[2];
|
|
|
|
float infY = *(float*)&ScriptParams[3];
|
|
|
|
float supX = *(float*)&ScriptParams[4];
|
|
|
|
float supY = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[4];
|
|
|
|
supX = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[5];
|
|
|
|
supY = *(float*)&ScriptParams[3];
|
|
|
|
}
|
|
|
|
CCranes::ActivateCrane(infX, supX, infY, supY,
|
|
|
|
*(float*)&ScriptParams[6], *(float*)&ScriptParams[7], *(float*)&ScriptParams[8],
|
2020-05-24 09:01:07 +00:00
|
|
|
DEGTORAD(*(float*)&ScriptParams[9]), true, false,
|
2019-12-31 23:35:54 +00:00
|
|
|
*(float*)&ScriptParams[0], *(float*)&ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_2_NUMBERS:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CMessages::AddMessageWithNumber(text, ScriptParams[2], ScriptParams[3], ScriptParams[0], ScriptParams[1], -1, -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_2_NUMBERS_NOW:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CMessages::AddMessageJumpQWithNumber(text, ScriptParams[2], ScriptParams[3], ScriptParams[0], ScriptParams[1], -1, -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_2_NUMBERS_SOON:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CMessages::AddMessageSoonWithNumber(text, ScriptParams[2], ScriptParams[3], ScriptParams[0], ScriptParams[1], -1, -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_3_NUMBERS:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CMessages::AddMessageWithNumber(text, ScriptParams[3], ScriptParams[4], ScriptParams[0], ScriptParams[1], ScriptParams[2], -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_3_NUMBERS_NOW:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CMessages::AddMessageJumpQWithNumber(text, ScriptParams[3], ScriptParams[4], ScriptParams[0], ScriptParams[1], ScriptParams[2], -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_3_NUMBERS_SOON:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CMessages::AddMessageSoonWithNumber(text, ScriptParams[3], ScriptParams[4], ScriptParams[0], ScriptParams[1], ScriptParams[2], -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_4_NUMBERS:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CMessages::AddMessageWithNumber(text, ScriptParams[4], ScriptParams[5], ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_4_NUMBERS_NOW:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CMessages::AddMessageJumpQWithNumber(text, ScriptParams[4], ScriptParams[5], ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_4_NUMBERS_SOON:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CMessages::AddMessageSoonWithNumber(text, ScriptParams[4], ScriptParams[5], ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_5_NUMBERS:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
CMessages::AddMessageWithNumber(text, ScriptParams[5], ScriptParams[6], ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], ScriptParams[4], -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_5_NUMBERS_NOW:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
CMessages::AddMessageJumpQWithNumber(text, ScriptParams[5], ScriptParams[6], ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], ScriptParams[4], -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_5_NUMBERS_SOON:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
CMessages::AddMessageSoonWithNumber(text, ScriptParams[5], ScriptParams[6], ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], ScriptParams[4], -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_6_NUMBERS:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CMessages::AddMessageWithNumber(text, ScriptParams[6], ScriptParams[7], ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], ScriptParams[4], ScriptParams[5]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_6_NUMBERS_NOW:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CMessages::AddMessageJumpQWithNumber(text, ScriptParams[6], ScriptParams[7], ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], ScriptParams[4], ScriptParams[5]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_6_NUMBERS_SOON:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CMessages::AddMessageSoonWithNumber(text, ScriptParams[6], ScriptParams[7], ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], ScriptParams[4], ScriptParams[5]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_FOLLOW_CHAR_IN_FORMATION:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-12-31 23:35:54 +00:00
|
|
|
CPed* pTargetPed = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->SetObjective(OBJECTIVE_FOLLOW_PED_IN_FORMATION, pTargetPed);
|
|
|
|
pPed->SetFormation((eFormation)ScriptParams[2]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PLAYER_MADE_PROGRESS:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::ProgressMade += ScriptParams[0];
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_PROGRESS_TOTAL:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::TotalProgressInGame = ScriptParams[0];
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_JUMP_DISTANCE:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-04-19 16:34:08 +00:00
|
|
|
CStats::MaximumJumpDistance = Max(CStats::MaximumJumpDistance, *(float*)&ScriptParams[0]);
|
2019-12-31 23:35:54 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_JUMP_HEIGHT:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-04-19 16:34:08 +00:00
|
|
|
CStats::MaximumJumpHeight = Max(CStats::MaximumJumpHeight, *(float*)&ScriptParams[0]);
|
2019-12-31 23:35:54 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_JUMP_FLIPS:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-04-19 16:34:08 +00:00
|
|
|
CStats::MaximumJumpFlips = Max(CStats::MaximumJumpFlips, ScriptParams[0]);
|
2019-12-31 23:35:54 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_JUMP_SPINS:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-04-19 16:34:08 +00:00
|
|
|
CStats::MaximumJumpSpins = Max(CStats::MaximumJumpSpins, ScriptParams[0]);
|
2019-12-31 23:35:54 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_JUMP_STUNT:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-04-19 16:34:08 +00:00
|
|
|
CStats::BestStuntJump = Max(CStats::BestStuntJump, ScriptParams[0]);
|
2019-12-31 23:35:54 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_UNIQUE_JUMP_FOUND:
|
2019-12-31 23:35:54 +00:00
|
|
|
++CStats::NumberOfUniqueJumpsFound;
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_UNIQUE_JUMPS_TOTAL:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::TotalNumberOfUniqueJumps = ScriptParams[0];
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_PASSENGER_DROPPED_OFF_TAXI:
|
2019-12-31 23:35:54 +00:00
|
|
|
++CStats::PassengersDroppedOffWithTaxi;
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_MONEY_MADE_TAXI:
|
2019-12-31 23:35:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::MoneyMadeWithTaxi += ScriptParams[0];
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_MISSION_GIVEN:
|
2019-12-31 23:35:54 +00:00
|
|
|
++CStats::MissionsGiven;
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_MISSION_PASSED:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
2020-02-16 09:44:33 +00:00
|
|
|
char name[KEY_LENGTH_IN_SCRIPT];
|
|
|
|
strncpy(name, (const char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
|
|
|
strncpy(CStats::LastMissionPassedName, name, KEY_LENGTH_IN_SCRIPT);
|
2019-12-31 23:35:54 +00:00
|
|
|
++CStats::MissionsPassed;
|
|
|
|
CStats::CheckPointReachedSuccessfully();
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_RUNNING:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2019-12-31 23:35:54 +00:00
|
|
|
pPed->bIsRunning = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REMOVE_ALL_SCRIPT_FIRES:
|
2019-12-31 23:35:54 +00:00
|
|
|
gFireManager.RemoveAllScriptFires();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_FIRST_CAR_COLOUR:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(pVehicle->m_currentColour1 == ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_SECOND_CAR_COLOUR:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(pVehicle->m_currentColour2 == ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_CHAR_BEEN_DAMAGED_BY_WEAPON:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
if (!pPed)
|
|
|
|
printf("HAS_CHAR_BEEN_DAMAGED_BY_WEAPON - Character doesn't exist\n");
|
|
|
|
UpdateCompareFlag(pPed && pPed->m_lastWepDam == ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_CAR_BEEN_DAMAGED_BY_WEAPON:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
|
|
|
if (!pVehicle)
|
|
|
|
printf("HAS_CAR_BEEN_DAMAGED_BY_WEAPON - Vehicle doesn't exist\n");
|
|
|
|
UpdateCompareFlag(pVehicle && pVehicle->m_nLastWeaponDamage == ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_IN_CHARS_GROUP:
|
2019-12-31 23:35:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
CPed* pLeader = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
|
|
|
script_assert(pLeader);
|
2019-12-31 23:35:54 +00:00
|
|
|
UpdateCompareFlag(pPed->m_leader == pLeader);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-11-09 13:44:17 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands800To899(int32 command)
|
2019-11-09 13:44:17 +00:00
|
|
|
{
|
2020-01-03 16:48:13 +00:00
|
|
|
CMatrix tmp_matrix;
|
2019-11-09 13:44:17 +00:00
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_CHAR_IN_PLAYERS_GROUP:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
CPed* pLeader = CWorld::Players[ScriptParams[1]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
|
|
|
script_assert(pLeader);
|
2020-01-03 16:48:13 +00:00
|
|
|
UpdateCompareFlag(pPed->m_leader == pLeader);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_EXPLODE_CHAR_HEAD:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pPed->m_nPedState == PED_DRIVING) {
|
|
|
|
pPed->SetDead();
|
|
|
|
if (!pPed->IsPlayer())
|
|
|
|
pPed->FlagToDestroyWhenNextProcessed();
|
|
|
|
}
|
|
|
|
else if (CGame::nastyGame && pPed->IsPedInControl()) {
|
2020-04-23 20:25:18 +00:00
|
|
|
pPed->ApplyHeadShot(WEAPONTYPE_SNIPERRIFLE, pPed->GetNodePosition(PED_HEAD), true);
|
2020-01-03 16:48:13 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
pPed->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_EXPLODE_PLAYER_HEAD:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
if (CGame::nastyGame) {
|
2020-04-23 20:25:18 +00:00
|
|
|
pPed->ApplyHeadShot(WEAPONTYPE_SNIPERRIFLE, pPed->GetNodePosition(PED_HEAD), true);
|
2020-01-03 16:48:13 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
pPed->SetDie(ANIM_KO_SHOT_FRONT1, 4.0f, 0.0f);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ANCHOR_BOAT:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CBoat* pBoat = (CBoat*)CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pBoat && pBoat->m_vehType == VEHICLE_TYPE_BOAT);
|
2020-01-03 16:48:13 +00:00
|
|
|
pBoat->m_bIsAnchored = (ScriptParams[1] == 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_ZONE_GROUP:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
2020-02-16 09:44:33 +00:00
|
|
|
char zone[KEY_LENGTH_IN_SCRIPT];
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, zone);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
int zone_id = CTheZones::FindZoneByLabelAndReturnIndex(zone);
|
|
|
|
if (zone_id < 0) {
|
|
|
|
printf("Couldn't find zone - %s\n", zone);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
CTheZones::SetPedGroup(zone_id, ScriptParams[0], ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_CAR_FIRE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
ScriptParams[0] = gFireManager.StartScriptFire(pVehicle->GetPosition(), pVehicle, 0.8f, 1);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_CHAR_FIRE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
ScriptParams[0] = gFireManager.StartScriptFire(pPed->GetPosition(), pPed, 0.8f, 1);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_RANDOM_CAR_OF_TYPE_IN_AREA:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
int handle = -1;
|
|
|
|
uint32 i = CPools::GetVehiclePool()->GetSize();
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float supX = *(float*)&ScriptParams[2];
|
|
|
|
float supY = *(float*)&ScriptParams[3];
|
|
|
|
while (i--) {
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i);
|
|
|
|
if (!pVehicle)
|
|
|
|
continue;
|
|
|
|
if (ScriptParams[4] != pVehicle->GetModelIndex() && ScriptParams[4] >= 0)
|
|
|
|
continue;
|
|
|
|
if (pVehicle->VehicleCreatedBy != RANDOM_VEHICLE)
|
|
|
|
continue;
|
|
|
|
if (!pVehicle->IsWithinArea(infX, infY, supX, supY))
|
|
|
|
continue;
|
|
|
|
handle = CPools::GetVehiclePool()->GetIndex(pVehicle);
|
|
|
|
pVehicle->VehicleCreatedBy = MISSION_VEHICLE;
|
|
|
|
++CCarCtrl::NumMissionCars;
|
|
|
|
--CCarCtrl::NumRandomCars;
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(handle, CLEANUP_CAR);
|
|
|
|
}
|
|
|
|
ScriptParams[0] = handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_RANDOM_CAR_OF_TYPE_IN_ZONE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
2020-02-16 09:44:33 +00:00
|
|
|
char zone[KEY_LENGTH_IN_SCRIPT];
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, zone);
|
2020-01-03 16:48:13 +00:00
|
|
|
int zone_id = CTheZones::FindZoneByLabelAndReturnIndex(zone);
|
|
|
|
if (zone_id != -1)
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2020-01-03 16:48:13 +00:00
|
|
|
CZone* pZone = CTheZones::GetZone(zone_id);
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
int handle = -1;
|
|
|
|
uint32 i = CPools::GetVehiclePool()->GetSize();
|
|
|
|
while (i--) {
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i);
|
|
|
|
if (!pVehicle)
|
|
|
|
continue;
|
|
|
|
if (ScriptParams[0] != pVehicle->GetModelIndex() && ScriptParams[0] >= 0)
|
|
|
|
continue;
|
|
|
|
if (pVehicle->VehicleCreatedBy != RANDOM_VEHICLE)
|
|
|
|
continue;
|
2020-05-06 10:23:26 +00:00
|
|
|
if (!CTheZones::PointLiesWithinZone(&pVehicle->GetPosition(), pZone))
|
2020-01-03 16:48:13 +00:00
|
|
|
continue;
|
|
|
|
handle = CPools::GetVehiclePool()->GetIndex(pVehicle);
|
|
|
|
pVehicle->VehicleCreatedBy = MISSION_VEHICLE;
|
|
|
|
++CCarCtrl::NumMissionCars;
|
|
|
|
--CCarCtrl::NumRandomCars;
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(handle, CLEANUP_CAR);
|
|
|
|
}
|
|
|
|
ScriptParams[0] = handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_RESPRAY_HAPPENED:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CGarages::HasResprayHappened(ScriptParams[0]));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAMERA_ZOOM:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_FOLLOWPED)
|
|
|
|
TheCamera.SetZoomValueFollowPedScript(ScriptParams[0]);
|
|
|
|
else if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_CAM_ON_A_STRING)
|
|
|
|
TheCamera.SetZoomValueCamStringScript(ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CREATE_PICKUP_WITH_AMMO:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
int16 model = ScriptParams[0];
|
|
|
|
if (model < 0)
|
|
|
|
model = CTheScripts::UsedObjectArray[-model].index;
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[3];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y) + PICKUP_PLACEMENT_OFFSET;
|
|
|
|
CPickups::GetActualPickupIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
ScriptParams[0] = CPickups::GenerateNewOne(pos, model, ScriptParams[1], ScriptParams[2]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_RAM_CAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
CVehicle* pTarget = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTarget);
|
2020-01-03 16:48:13 +00:00
|
|
|
CCarAI::TellCarToRamOtherCar(pVehicle, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_BLOCK_CAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
CVehicle* pTarget = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTarget);
|
2020-01-03 16:48:13 +00:00
|
|
|
CCarAI::TellCarToBlockOtherCar(pVehicle, pTarget);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_CATCH_TRAIN:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->SetObjective(OBJECTIVE_CATCH_TRAIN);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
//case COMMAND_SET_COLL_OBJ_CATCH_TRAIN:
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_PLAYER_NEVER_GETS_TIRED:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerInfo* pPlayer = &CWorld::Players[ScriptParams[0]];
|
|
|
|
pPlayer->m_bInfiniteSprint = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_PLAYER_FAST_RELOAD:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerInfo* pPlayer = &CWorld::Players[ScriptParams[0]];
|
|
|
|
pPlayer->m_bFastReload = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_BLEEDING:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->bPedIsBleeding = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_FUNNY_SUSPENSION:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
// no action
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_BIG_WHEELS:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR);
|
2020-01-03 16:48:13 +00:00
|
|
|
CAutomobile* pCar = (CAutomobile*)pVehicle;
|
|
|
|
pCar->bBigWheels = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_FREE_RESPRAYS:
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-30 21:46:44 +00:00
|
|
|
CGarages::SetFreeResprays(ScriptParams[0] != 0);
|
2020-01-03 16:48:13 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_PLAYER_VISIBLE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->bIsVisible = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_VISIBLE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->bIsVisible = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_VISIBLE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
pVehicle->bIsVisible = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_AREA_OCCUPIED:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 11);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
int16 total;
|
|
|
|
CWorld::FindObjectsIntersectingCube(CVector(infX, infY, infZ), CVector(supX, supY, supZ), &total, 2, nil,
|
2020-01-31 15:31:24 +00:00
|
|
|
!!ScriptParams[6], !!ScriptParams[7], !!ScriptParams[8], !!ScriptParams[9], !!ScriptParams[10]);
|
2020-01-03 16:48:13 +00:00
|
|
|
UpdateCompareFlag(total > 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_DRUG_RUN:
|
2020-01-03 16:48:13 +00:00
|
|
|
CPlane::CreateIncomingCesna();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_DRUG_RUN_BEEN_COMPLETED:
|
2020-01-03 16:48:13 +00:00
|
|
|
UpdateCompareFlag(CPlane::HasCesnaLanded());
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_DRUG_PLANE_BEEN_SHOT_DOWN:
|
2020-01-03 16:48:13 +00:00
|
|
|
UpdateCompareFlag(CPlane::HasCesnaBeenDestroyed());
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SAVE_PLAYER_FROM_FIRES:
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
gFireManager.ExtinguishPoint(CWorld::Players[ScriptParams[0]].GetPos(), 3.0f);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DISPLAY_TEXT:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_fAtX = *(float*)&ScriptParams[0];
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_fAtY = *(float*)&ScriptParams[1];
|
|
|
|
uint16 len = CMessages::GetWideStringLength(text);
|
|
|
|
for (uint16 i = 0; i < len; i++)
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_Text[i] = text[i];
|
|
|
|
for (uint16 i = len; i < SCRIPT_TEXT_MAX_LENGTH; i++)
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_Text[i] = 0;
|
|
|
|
++CTheScripts::NumberOfIntroTextLinesThisFrame;
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_SCALE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_fScaleX = *(float*)&ScriptParams[0];
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_fScaleY = *(float*)&ScriptParams[1];
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_COLOUR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_sColor =
|
|
|
|
CRGBA(ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_JUSTIFY:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_bJustify = (ScriptParams[0] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_CENTRE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_bCentered = (ScriptParams[0] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_WRAPX:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_fWrapX = *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_CENTRE_SIZE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_fCenterSize = *(float*)&ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_BACKGROUND:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_bBackground = (ScriptParams[0] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_BACKGROUND_COLOUR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_sBackgroundColor =
|
|
|
|
CRGBA(ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_BACKGROUND_ONLY_TEXT:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_bBackgroundOnly = (ScriptParams[0] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_PROPORTIONAL:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_bTextProportional = (ScriptParams[0] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_FONT:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_nFont = ScriptParams[0];
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_INDUSTRIAL_PASSED:
|
2020-01-03 16:48:13 +00:00
|
|
|
CStats::IndustrialPassed = true;
|
|
|
|
DMAudio.PlayRadioAnnouncement(13); //TODO: enum?
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_COMMERCIAL_PASSED:
|
2020-01-03 16:48:13 +00:00
|
|
|
CStats::CommercialPassed = true;
|
|
|
|
DMAudio.PlayRadioAnnouncement(14); //TODO: enum?
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SUBURBAN_PASSED:
|
2020-01-03 16:48:13 +00:00
|
|
|
CStats::SuburbanPassed = true;
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ROTATE_OBJECT:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-01-03 16:48:13 +00:00
|
|
|
float heading = LimitAngleOnCircle(
|
|
|
|
RADTODEG(Atan2(-pObject->GetForward().x, pObject->GetForward().y)));
|
|
|
|
float headingTarget = *(float*)&ScriptParams[1];
|
2020-05-18 19:43:06 +00:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
float rotateBy = *(float*)&ScriptParams[2] * CTimer::GetTimeStepFix();
|
|
|
|
#else
|
2020-01-03 16:48:13 +00:00
|
|
|
float rotateBy = *(float*)&ScriptParams[2];
|
2020-05-18 19:43:06 +00:00
|
|
|
#endif
|
2020-01-03 16:48:13 +00:00
|
|
|
if (headingTarget == heading) { // using direct comparasion here is fine
|
|
|
|
UpdateCompareFlag(true);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
float angleClockwise = LimitAngleOnCircle(headingTarget - heading);
|
|
|
|
float angleCounterclockwise = LimitAngleOnCircle(heading - headingTarget);
|
|
|
|
float newHeading;
|
|
|
|
if (angleClockwise < angleCounterclockwise)
|
|
|
|
newHeading = rotateBy < angleClockwise ? heading + rotateBy : headingTarget;
|
|
|
|
else
|
|
|
|
newHeading = rotateBy < angleCounterclockwise ? heading - rotateBy : headingTarget;
|
|
|
|
bool obstacleInPath = false;
|
|
|
|
if (ScriptParams[3]) {
|
|
|
|
CVector pos = pObject->GetPosition();
|
|
|
|
tmp_matrix.SetRotateZ(DEGTORAD(newHeading));
|
|
|
|
tmp_matrix.GetPosition() += pos;
|
|
|
|
CColModel* pColModel = pObject->GetColModel();
|
|
|
|
CVector cp1 = tmp_matrix * pColModel->boundingBox.min;
|
|
|
|
CVector cp2 = tmp_matrix * CVector(pColModel->boundingBox.max.x, pColModel->boundingBox.min.y, pColModel->boundingBox.min.z);
|
|
|
|
CVector cp3 = tmp_matrix * CVector(pColModel->boundingBox.min.x, pColModel->boundingBox.max.y, pColModel->boundingBox.min.z);
|
|
|
|
CVector cp4 = tmp_matrix * CVector(pColModel->boundingBox.min.x, pColModel->boundingBox.min.y, pColModel->boundingBox.max.z);
|
|
|
|
int16 collisions;
|
|
|
|
CWorld::FindObjectsIntersectingAngledCollisionBox(pColModel->boundingBox, tmp_matrix, pos,
|
2020-04-19 16:34:08 +00:00
|
|
|
Min(cp1.x, Min(cp2.x, Min(cp3.x, cp4.x))),
|
|
|
|
Min(cp1.y, Min(cp2.y, Min(cp3.y, cp4.y))),
|
|
|
|
Max(cp1.x, Max(cp2.x, Max(cp3.x, cp4.x))),
|
|
|
|
Max(cp1.y, Max(cp2.y, Max(cp3.y, cp4.y))),
|
2020-01-03 16:48:13 +00:00
|
|
|
&collisions, 2, nil, false, true, true, false, false);
|
|
|
|
if (collisions > 0)
|
|
|
|
obstacleInPath = true;
|
|
|
|
}
|
|
|
|
if (obstacleInPath) {
|
|
|
|
UpdateCompareFlag(true);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
pObject->SetHeading(DEGTORAD(newHeading));
|
|
|
|
pObject->GetMatrix().UpdateRW();
|
|
|
|
pObject->UpdateRwFrame();
|
|
|
|
UpdateCompareFlag(newHeading == headingTarget); // using direct comparasion here is fine
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SLIDE_OBJECT:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-01-03 16:48:13 +00:00
|
|
|
CVector pos = pObject->GetPosition();
|
|
|
|
CVector posTarget = *(CVector*)&ScriptParams[1];
|
2020-05-18 19:43:06 +00:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CVector slideBy = *(CVector*)&ScriptParams[4] * CTimer::GetTimeStepFix();
|
|
|
|
#else
|
2020-01-03 16:48:13 +00:00
|
|
|
CVector slideBy = *(CVector*)&ScriptParams[4];
|
2020-05-18 19:43:06 +00:00
|
|
|
#endif
|
2020-01-03 16:48:13 +00:00
|
|
|
if (posTarget == pos) { // using direct comparasion here is fine
|
|
|
|
UpdateCompareFlag(true);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
CVector posDiff = pos - posTarget;
|
|
|
|
CVector newPosition;
|
|
|
|
if (posDiff.x < 0)
|
|
|
|
newPosition.x = -posDiff.x < slideBy.x ? posTarget.x : pos.x + slideBy.x;
|
|
|
|
else
|
|
|
|
newPosition.x = posDiff.x < slideBy.x ? posTarget.x : pos.x - slideBy.x;
|
|
|
|
if (posDiff.y < 0)
|
|
|
|
newPosition.y = -posDiff.y < slideBy.y ? posTarget.y : pos.y + slideBy.y;
|
|
|
|
else
|
|
|
|
newPosition.y = posDiff.y < slideBy.y ? posTarget.y : pos.y - slideBy.y;
|
|
|
|
if (posDiff.z < 0)
|
|
|
|
newPosition.z = -posDiff.z < slideBy.z ? posTarget.z : pos.z + slideBy.z;
|
|
|
|
else
|
|
|
|
newPosition.z = posDiff.z < slideBy.z ? posTarget.z : pos.z - slideBy.z;
|
|
|
|
bool obstacleInPath = false;
|
|
|
|
if (ScriptParams[7]) {
|
|
|
|
tmp_matrix = pObject->GetMatrix();
|
|
|
|
tmp_matrix.GetPosition() = newPosition;
|
|
|
|
CColModel* pColModel = pObject->GetColModel();
|
|
|
|
CVector cp1 = tmp_matrix * pColModel->boundingBox.min;
|
|
|
|
CVector cp2 = tmp_matrix * CVector(pColModel->boundingBox.max.x, pColModel->boundingBox.min.y, pColModel->boundingBox.min.z);
|
|
|
|
CVector cp3 = tmp_matrix * CVector(pColModel->boundingBox.min.x, pColModel->boundingBox.max.y, pColModel->boundingBox.min.z);
|
|
|
|
CVector cp4 = tmp_matrix * CVector(pColModel->boundingBox.min.x, pColModel->boundingBox.min.y, pColModel->boundingBox.max.z);
|
|
|
|
int16 collisions;
|
2020-04-18 02:58:43 +00:00
|
|
|
CWorld::FindObjectsIntersectingAngledCollisionBox(pColModel->boundingBox, tmp_matrix, newPosition,
|
2020-04-19 16:34:08 +00:00
|
|
|
Min(cp1.x, Min(cp2.x, Min(cp3.x, cp4.x))),
|
|
|
|
Min(cp1.y, Min(cp2.y, Min(cp3.y, cp4.y))),
|
|
|
|
Max(cp1.x, Max(cp2.x, Max(cp3.x, cp4.x))),
|
|
|
|
Max(cp1.y, Max(cp2.y, Max(cp3.y, cp4.y))),
|
2020-01-03 16:48:13 +00:00
|
|
|
&collisions, 2, nil, false, true, true, false, false);
|
|
|
|
if (collisions > 0)
|
|
|
|
obstacleInPath = true;
|
|
|
|
}
|
|
|
|
if (obstacleInPath) {
|
|
|
|
UpdateCompareFlag(true);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
pObject->Teleport(newPosition);
|
|
|
|
UpdateCompareFlag(newPosition == posTarget); // using direct comparasion here is fine
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_REMOVE_CHAR_ELEGANTLY:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
if (pPed && pPed->CharCreatedBy == MISSION_CHAR){
|
|
|
|
CWorld::RemoveReferencesToDeletedObject(pPed);
|
|
|
|
if (pPed->bInVehicle){
|
|
|
|
if (pPed->m_pMyVehicle){
|
|
|
|
if (pPed == pPed->m_pMyVehicle->pDriver){
|
|
|
|
pPed->m_pMyVehicle->RemoveDriver();
|
2020-04-30 13:45:45 +00:00
|
|
|
pPed->m_pMyVehicle->SetStatus(STATUS_ABANDONED);
|
2020-01-03 16:48:13 +00:00
|
|
|
if (pPed->m_pMyVehicle->m_nDoorLock == CARLOCK_LOCKED_INITIALLY)
|
|
|
|
pPed->m_pMyVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
|
|
|
|
if (pPed->m_nPedType == PEDTYPE_COP && pPed->m_pMyVehicle->IsLawEnforcementVehicle())
|
|
|
|
pPed->m_pMyVehicle->ChangeLawEnforcerState(0);
|
|
|
|
}else{
|
|
|
|
pPed->m_pMyVehicle->RemovePassenger(pPed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
delete pPed;
|
|
|
|
--CPopulation::ms_nTotalMissionPeds;
|
|
|
|
}else{
|
|
|
|
pPed->CharCreatedBy = RANDOM_CHAR;
|
|
|
|
pPed->bRespondsToThreats = true;
|
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->ClearLeader();
|
|
|
|
--CPopulation::ms_nTotalMissionPeds;
|
|
|
|
pPed->bFadeOut = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.RemoveEntityFromList(ScriptParams[0], CLEANUP_CHAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_SET_CHAR_STAY_IN_SAME_PLACE:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->bKindaStayInSamePlace = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_NASTY_GAME:
|
2020-01-03 16:48:13 +00:00
|
|
|
UpdateCompareFlag(CGame::nastyGame);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_UNDRESS_CHAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 09:44:33 +00:00
|
|
|
char name[KEY_LENGTH_IN_SCRIPT];
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, name);
|
2020-02-16 09:44:33 +00:00
|
|
|
for (int i = 0; i < KEY_LENGTH_IN_SCRIPT; i++)
|
2020-01-03 16:48:13 +00:00
|
|
|
name[i] = tolower(name[i]);
|
|
|
|
int mi = pPed->GetModelIndex();
|
|
|
|
pPed->DeleteRwObject();
|
|
|
|
if (pPed->IsPlayer())
|
|
|
|
mi = 0;
|
|
|
|
CStreaming::RequestSpecialModel(mi, name, STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2020-01-03 16:48:13 +00:00
|
|
|
CWorld::Remove(pPed);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DRESS_CHAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
int mi = pPed->GetModelIndex();
|
|
|
|
pPed->m_modelIndex = -1;
|
|
|
|
pPed->SetModelIndex(mi);
|
|
|
|
CWorld::Add(pPed);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_CHASE_SCENE:
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTimer::Suspend();
|
|
|
|
CStreaming::DeleteAllRwObjects();
|
|
|
|
CRecordDataForChase::StartChaseScene(*(float*)&ScriptParams[0]);
|
|
|
|
CTimer::Resume();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_STOP_CHASE_SCENE:
|
2020-01-03 16:48:13 +00:00
|
|
|
CRecordDataForChase::CleanUpChaseScene();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_EXPLOSION_IN_AREA:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
float infX = *(float*)&ScriptParams[1];
|
|
|
|
float infY = *(float*)&ScriptParams[2];
|
|
|
|
float infZ = *(float*)&ScriptParams[3];
|
|
|
|
float supX = *(float*)&ScriptParams[4];
|
|
|
|
float supY = *(float*)&ScriptParams[5];
|
|
|
|
float supZ = *(float*)&ScriptParams[6];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[4];
|
|
|
|
supX = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[5];
|
|
|
|
supY = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[6];
|
|
|
|
supZ = *(float*)&ScriptParams[3];
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(CExplosion::TestForExplosionInArea((eExplosionType)ScriptParams[0],
|
|
|
|
infX, supX, infY, supY, infZ, supZ));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_EXPLOSION_IN_ZONE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-16 09:44:33 +00:00
|
|
|
char zone[KEY_LENGTH_IN_SCRIPT];
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, zone);
|
2020-01-03 16:48:13 +00:00
|
|
|
int zone_id = CTheZones::FindZoneByLabelAndReturnIndex(zone);
|
|
|
|
if (zone_id != -1)
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2020-01-03 16:48:13 +00:00
|
|
|
CZone* pZone = CTheZones::GetZone(zone_id);
|
|
|
|
UpdateCompareFlag(CExplosion::TestForExplosionInArea((eExplosionType)ScriptParams[0],
|
|
|
|
pZone->minx, pZone->maxx, pZone->miny, pZone->maxy, pZone->minz, pZone->maxz));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_DRUG_DROP_OFF:
|
2020-01-03 16:48:13 +00:00
|
|
|
CPlane::CreateDropOffCesna();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_DROP_OFF_PLANE_BEEN_SHOT_DOWN:
|
2020-01-03 16:48:13 +00:00
|
|
|
UpdateCompareFlag(CPlane::HasDropOffCesnaBeenShotDown());
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_FIND_DROP_OFF_PLANE_COORDINATES:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CVector pos = CPlane::FindDropOffCesnaCoordinates();
|
|
|
|
*(CVector*)&ScriptParams[0] = pos;
|
|
|
|
StoreParameters(&m_nIp, 3);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CREATE_FLOATING_PACKAGE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y) + PICKUP_PLACEMENT_OFFSET;
|
|
|
|
ScriptParams[0] = CPickups::GenerateNewOne(pos, MI_FLOATPACKAGE1, PICKUP_FLOATINGPACKAGE, 0);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PLACE_OBJECT_RELATIVE_TO_CAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-01-03 16:48:13 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
CVector offset = *(CVector*)&ScriptParams[2];
|
|
|
|
CPhysical::PlacePhysicalRelativeToOtherPhysical(pVehicle, pObject, offset);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_MAKE_OBJECT_TARGETTABLE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-01-03 16:48:13 +00:00
|
|
|
CPlayerPed* pPlayerPed = CWorld::Players[CWorld::PlayerInFocus].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPlayerPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPlayerPed->MakeObjectTargettable(ScriptParams[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ADD_ARMOUR_TO_PLAYER:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerPed* pPlayerPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPlayerPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPlayerPed->m_fArmour = clamp(pPlayerPed->m_fArmour + ScriptParams[1], 0.0f, 100.0f);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ADD_ARMOUR_TO_CHAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->m_fArmour = clamp(pPed->m_fArmour + ScriptParams[1], 0.0f, 100.0f);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_OPEN_GARAGE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-30 21:46:44 +00:00
|
|
|
CGarages::OpenGarage(ScriptParams[0]);
|
2020-01-03 16:48:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLOSE_GARAGE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-04-08 11:16:59 +00:00
|
|
|
CGarages::CloseGarage(ScriptParams[0]);
|
2020-01-03 16:48:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_WARP_CHAR_FROM_CAR_TO_COORD:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
if (pPed->bInVehicle){
|
|
|
|
if (pPed->m_pMyVehicle->bIsBus)
|
|
|
|
pPed->bRenderPedInCar = true;
|
|
|
|
if (pPed->m_pMyVehicle->pDriver == pPed){
|
|
|
|
pPed->m_pMyVehicle->RemoveDriver();
|
2020-04-30 13:45:45 +00:00
|
|
|
pPed->m_pMyVehicle->SetStatus(STATUS_ABANDONED);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->m_pMyVehicle->bEngineOn = false;
|
|
|
|
pPed->m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
|
|
|
|
}else{
|
|
|
|
pPed->m_pMyVehicle->RemovePassenger(pPed);
|
|
|
|
}
|
|
|
|
pPed->m_pMyVehicle->SetMoveSpeed(0.0f, 0.0f, -0.00001f);
|
|
|
|
pPed->m_pMyVehicle->SetTurnSpeed(0.0f, 0.0f, 0.0f);
|
|
|
|
}
|
|
|
|
pPed->bInVehicle = false;
|
|
|
|
pPed->m_pMyVehicle = nil;
|
|
|
|
pPed->SetPedState(PED_IDLE);
|
|
|
|
pPed->m_nLastPedState = PED_NONE;
|
|
|
|
pPed->bUsesCollision = true;
|
|
|
|
pPed->SetMoveSpeed(0.0f, 0.0f, 0.0f);
|
|
|
|
pPed->AddWeaponModel(CWeaponInfo::GetWeaponInfo(pPed->m_weapons[pPed->m_currentWeapon].m_eWeaponType)->m_nModelId);
|
|
|
|
pPed->RemoveInCarAnims();
|
|
|
|
if (pPed->m_pVehicleAnim)
|
|
|
|
pPed->m_pVehicleAnim->blendDelta = -1000.0f;
|
|
|
|
pPed->m_pVehicleAnim = nil;
|
|
|
|
pPed->RestartNonPartialAnims();
|
|
|
|
pPed->SetMoveState(PEDMOVE_NONE);
|
|
|
|
CAnimManager::BlendAnimation(pPed->GetClump(), pPed->m_animGroup, ANIM_IDLE_STANCE, 100.0f);
|
|
|
|
pos.z += pPed->GetDistanceFromCentreOfMassToBaseOfModel();
|
|
|
|
pPed->Teleport(pos);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, pPed);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
float range = *(float*)&ScriptParams[3];
|
|
|
|
int mi = ScriptParams[4] < 0 ? CTheScripts::UsedObjectArray[-ScriptParams[4]].index : ScriptParams[4];
|
|
|
|
int16 total;
|
|
|
|
CEntity* apEntities[16];
|
|
|
|
CWorld::FindObjectsOfTypeInRange(mi, pos, range, true, &total, 16, apEntities, true, false, false, true, true);
|
|
|
|
if (total == 0)
|
|
|
|
CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(LEVEL_NONE), pos, range, true, &total, 16, apEntities);
|
|
|
|
if (total == 0)
|
|
|
|
CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(CTheZones::FindZoneForPoint(pos)), pos, range, true, &total, 16, apEntities);
|
|
|
|
CEntity* pClosestEntity = nil;
|
2020-02-01 13:10:46 +00:00
|
|
|
float min_dist = 2.0f * range;
|
2020-01-03 16:48:13 +00:00
|
|
|
for (int i = 0; i < total; i++) {
|
|
|
|
float dist = (apEntities[i]->GetPosition() - pos).Magnitude();
|
|
|
|
if (dist < min_dist) {
|
|
|
|
min_dist = dist;
|
|
|
|
pClosestEntity = apEntities[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pClosestEntity) {
|
|
|
|
pClosestEntity->bIsVisible = (ScriptParams[5] != 0);
|
|
|
|
CTheScripts::AddToInvisibilitySwapArray(pClosestEntity, ScriptParams[5] != 0);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_CHAR_SPOTTED_CHAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
CPed* pTarget = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTarget);
|
2020-01-03 16:48:13 +00:00
|
|
|
UpdateCompareFlag(pPed->OurPedCanSeeThisOne(pTarget));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_HAIL_TAXI:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->SetObjective(OBJECTIVE_HAIL_TAXI);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_OBJECT_BEEN_DAMAGED:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-02-01 19:47:04 +00:00
|
|
|
UpdateCompareFlag(pObject->bRenderDamaged || !pObject->bIsVisible);
|
2020-01-03 16:48:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_KILL_FRENZY_HEADSHOT:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CDarkel::StartFrenzy((eWeaponType)ScriptParams[0], ScriptParams[1], ScriptParams[2],
|
|
|
|
ScriptParams[3], text, ScriptParams[4], ScriptParams[5],
|
|
|
|
ScriptParams[6], ScriptParams[7] != 0, true);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ACTIVATE_MILITARY_CRANE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 10);
|
|
|
|
float infX = *(float*)&ScriptParams[2];
|
|
|
|
float infY = *(float*)&ScriptParams[3];
|
|
|
|
float supX = *(float*)&ScriptParams[4];
|
|
|
|
float supY = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[4];
|
|
|
|
supX = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[5];
|
|
|
|
supY = *(float*)&ScriptParams[3];
|
|
|
|
}
|
|
|
|
CCranes::ActivateCrane(infX, supX, infY, supY,
|
|
|
|
*(float*)&ScriptParams[6], *(float*)&ScriptParams[7], *(float*)&ScriptParams[8],
|
|
|
|
DEGTORAD(*(float*)&ScriptParams[9]), false, true,
|
|
|
|
*(float*)&ScriptParams[0], *(float*)&ScriptParams[1]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_WARP_PLAYER_INTO_CAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, pVehicle);
|
|
|
|
pPed->WarpPedIntoCar(pVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_WARP_CHAR_INTO_CAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, pVehicle);
|
|
|
|
pPed->WarpPedIntoCar(pVehicle);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
//case COMMAND_SWITCH_CAR_RADIO:
|
|
|
|
//case COMMAND_SET_AUDIO_STREAM:
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_2_NUMBERS_BIG:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CMessages::AddBigMessageWithNumber(text, ScriptParams[2], ScriptParams[3] - 1, ScriptParams[0], ScriptParams[1], -1, -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_3_NUMBERS_BIG:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CMessages::AddBigMessageWithNumber(text, ScriptParams[3], ScriptParams[4] - 1, ScriptParams[0], ScriptParams[1], ScriptParams[2], -1, -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_4_NUMBERS_BIG:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CMessages::AddBigMessageWithNumber(text, ScriptParams[4], ScriptParams[5] - 1, ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], -1, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_5_NUMBERS_BIG:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
CMessages::AddBigMessageWithNumber(text, ScriptParams[5], ScriptParams[6] - 1, ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], ScriptParams[4], -1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_WITH_6_NUMBERS_BIG:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CMessages::AddBigMessageWithNumber(text, ScriptParams[6], ScriptParams[7] - 1, ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3], ScriptParams[4], ScriptParams[5]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_WAIT_STATE:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->SetWaitState((eWaitState)ScriptParams[1], ScriptParams[2] >= 0 ? &ScriptParams[2] : nil);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAMERA_BEHIND_PLAYER:
|
2020-01-03 16:48:13 +00:00
|
|
|
TheCamera.SetCameraDirectlyBehindForFollowPed_CamOnAString();
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_MOTION_BLUR:
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
TheCamera.SetMotionBlur(0, 0, 0, 0, ScriptParams[0]);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_STRING_IN_STRING:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* string = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CMessages::AddMessageWithString(text, ScriptParams[0], ScriptParams[1], string);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CREATE_RANDOM_CHAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CZoneInfo zoneinfo;
|
|
|
|
CTheZones::GetZoneInfoForTimeOfDay(&CWorld::Players[CWorld::PlayerInFocus].GetPos(), &zoneinfo);
|
|
|
|
int mi;
|
2020-02-16 02:15:58 +00:00
|
|
|
ePedType pedtype = PEDTYPE_COP;
|
2020-01-03 16:48:13 +00:00
|
|
|
int attempt = 0;
|
|
|
|
while (pedtype != PEDTYPE_CIVMALE && pedtype != PEDTYPE_CIVFEMALE && attempt < 5) {
|
|
|
|
mi = CPopulation::ChooseCivilianOccupation(zoneinfo.pedGroup);
|
|
|
|
if (CModelInfo::GetModelInfo(mi)->GetRwObject())
|
|
|
|
pedtype = ((CPedModelInfo*)(CModelInfo::GetModelInfo(mi)))->m_pedType;
|
|
|
|
attempt++;
|
|
|
|
}
|
|
|
|
if (!CModelInfo::GetModelInfo(mi)->GetRwObject()) {
|
|
|
|
mi = MI_MALE01;
|
|
|
|
pedtype = ((CPedModelInfo*)(CModelInfo::GetModelInfo(mi)))->m_pedType;
|
|
|
|
}
|
|
|
|
CPed* ped = new CCivilianPed(pedtype, mi);
|
|
|
|
ped->CharCreatedBy = MISSION_CHAR;
|
|
|
|
ped->bRespondsToThreats = false;
|
|
|
|
ped->bAllowMedicsToReviveMe = false;
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
pos.z += 1.0f;
|
2020-05-05 01:45:18 +00:00
|
|
|
ped->SetPosition(pos);
|
2020-01-03 16:48:13 +00:00
|
|
|
ped->SetOrientation(0.0f, 0.0f, 0.0f);
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, ped);
|
|
|
|
CWorld::Add(ped);
|
2020-05-06 10:23:26 +00:00
|
|
|
ped->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pos);
|
2020-01-03 16:48:13 +00:00
|
|
|
CPopulation::ms_nTotalMissionPeds++;
|
|
|
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(ped);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ScriptParams[0], CLEANUP_CHAR);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_STEAL_ANY_CAR:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-01-03 16:48:13 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->SetObjective(OBJECTIVE_STEAL_ANY_CAR);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_2_REPEATED_PHONE_MESSAGES:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text1 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text2 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_Repeatedly(ScriptParams[0], text1, text2, nil, nil, nil, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_2_PHONE_MESSAGES:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text1 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text2 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_JustOnce(ScriptParams[0], text1, text2, nil, nil, nil, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_3_REPEATED_PHONE_MESSAGES:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text1 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text2 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text3 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_Repeatedly(ScriptParams[0], text1, text2, text3, nil, nil, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_3_PHONE_MESSAGES:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text1 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text2 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text3 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_JustOnce(ScriptParams[0], text1, text2, text3, nil, nil, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_4_REPEATED_PHONE_MESSAGES:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text1 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text2 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text3 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text4 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_Repeatedly(ScriptParams[0], text1, text2, text3, text4, nil, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_4_PHONE_MESSAGES:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text1 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text2 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text3 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text4 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-01-03 16:48:13 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_JustOnce(ScriptParams[0], text1, text2, text3, text4, nil, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_SNIPER_BULLET_IN_AREA:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(CBulletInfo::TestForSniperBullet(infX, supX, infY, supY, infZ, supZ));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GIVE_PLAYER_DETONATOR:
|
2020-01-03 16:48:13 +00:00
|
|
|
CGarages::GivePlayerDetonator();
|
|
|
|
return 0;
|
|
|
|
//case COMMAND_SET_COLL_OBJ_STEAL_ANY_CAR:
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_OBJECT_VELOCITY:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-01-03 16:48:13 +00:00
|
|
|
pObject->SetMoveSpeed(*(CVector*)&ScriptParams[1] * METERS_PER_SECOND_TO_GAME_SPEED);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_OBJECT_COLLISION:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-01-03 16:48:13 +00:00
|
|
|
pObject->bUsesCollision = (ScriptParams[1] != 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_ICECREAM_JINGLE_ON:
|
2020-01-03 16:48:13 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-01-03 16:48:13 +00:00
|
|
|
// Adding this check to correspond to command name.
|
|
|
|
// All original game scripts always assume that the vehicle is actually Mr. Whoopee,
|
2020-02-15 11:53:42 +00:00
|
|
|
// but maybe there are mods that use it as "is alarm activated"?
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle->GetModelIndex() == MI_MRWHOOP);
|
2020-01-03 16:48:13 +00:00
|
|
|
UpdateCompareFlag(pVehicle->m_bSirenOrAlarm);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-11-09 13:44:17 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands900To999(int32 command)
|
2019-11-09 13:44:17 +00:00
|
|
|
{
|
2020-02-15 11:53:42 +00:00
|
|
|
char str[52];
|
2020-02-16 09:44:33 +00:00
|
|
|
char onscreen_str[KEY_LENGTH_IN_SCRIPT];
|
2020-02-02 11:47:03 +00:00
|
|
|
switch (command) {
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_STRING_IN_STRING_NOW:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* source = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* pstr = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-02-02 11:47:03 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
2020-02-16 09:44:33 +00:00
|
|
|
CMessages::AddMessageJumpQWithString(source, ScriptParams[0], ScriptParams[1], pstr);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
//case COMMAND_PRINT_STRING_IN_STRING_SOON:
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_5_REPEATED_PHONE_MESSAGES:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text1 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text2 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text3 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text4 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text5 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-02-02 11:47:03 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_Repeatedly(ScriptParams[0], text1, text2, text3, text4, text5, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_5_PHONE_MESSAGES:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text1 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text2 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text3 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text4 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text5 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-02-02 11:47:03 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_JustOnce(ScriptParams[0], text1, text2, text3, text4, text5, nil);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_6_REPEATED_PHONE_MESSAGES:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text1 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text2 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text3 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text4 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text5 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text6 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-02-02 11:47:03 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_Repeatedly(ScriptParams[0], text1, text2, text3, text4, text5, text6);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_6_PHONE_MESSAGES:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text1 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text2 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text3 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text4 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text5 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
|
|
|
wchar* text6 = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-02-02 11:47:03 +00:00
|
|
|
gPhoneInfo.SetPhoneMessage_JustOnce(ScriptParams[0], text1, text2, text3, text4, text5, text6);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_POINT_OBSCURED_BY_A_MISSION_ENTITY:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0] - *(float*)&ScriptParams[3];
|
|
|
|
float supX = *(float*)&ScriptParams[0] + *(float*)&ScriptParams[3];
|
|
|
|
float infY = *(float*)&ScriptParams[1] - *(float*)&ScriptParams[4];
|
|
|
|
float supY = *(float*)&ScriptParams[1] + *(float*)&ScriptParams[4];
|
|
|
|
float infZ = *(float*)&ScriptParams[2] - *(float*)&ScriptParams[5];
|
|
|
|
float supZ = *(float*)&ScriptParams[2] + *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
float tmp = infX;
|
|
|
|
infX = supX;
|
|
|
|
supX = tmp;
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
float tmp = infY;
|
|
|
|
infY = supY;
|
|
|
|
supY = tmp;
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
float tmp = infZ;
|
|
|
|
infZ = supZ;
|
|
|
|
supZ = tmp;
|
|
|
|
}
|
|
|
|
int16 total;
|
|
|
|
CWorld::FindMissionEntitiesIntersectingCube(CVector(infX, infY, infZ), CVector(supX, supY, supZ), &total, 2, nil, true, true, true);
|
|
|
|
UpdateCompareFlag(total > 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_ALL_MODELS_NOW:
|
2020-02-02 11:47:03 +00:00
|
|
|
CTimer::Stop();
|
|
|
|
CStreaming::LoadAllRequestedModels(false);
|
2020-02-15 11:53:42 +00:00
|
|
|
CTimer::Update();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ADD_TO_OBJECT_VELOCITY:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-06-12 21:16:10 +00:00
|
|
|
pObject->SetMoveSpeed(pObject->GetMoveSpeed() + METERS_PER_SECOND_TO_GAME_SPEED * *(CVector*)&ScriptParams[1]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DRAW_SPRITE:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 9);
|
|
|
|
CTheScripts::IntroRectangles[CTheScripts::NumberOfIntroRectanglesThisFrame].m_bIsUsed = true;
|
|
|
|
CTheScripts::IntroRectangles[CTheScripts::NumberOfIntroRectanglesThisFrame].m_nTextureId = ScriptParams[0] - 1;
|
|
|
|
CTheScripts::IntroRectangles[CTheScripts::NumberOfIntroRectanglesThisFrame].m_sRect = CRect(
|
|
|
|
*(float*)&ScriptParams[1], *(float*)&ScriptParams[2], *(float*)&ScriptParams[1] + *(float*)&ScriptParams[3], *(float*)&ScriptParams[2] + *(float*)&ScriptParams[4]);
|
|
|
|
CTheScripts::IntroRectangles[CTheScripts::NumberOfIntroRectanglesThisFrame].m_sColor = CRGBA(ScriptParams[5], ScriptParams[6], ScriptParams[7], ScriptParams[8]);
|
|
|
|
CTheScripts::NumberOfIntroRectanglesThisFrame++;
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DRAW_RECT:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 8);
|
|
|
|
CTheScripts::IntroRectangles[CTheScripts::NumberOfIntroRectanglesThisFrame].m_bIsUsed = true;
|
|
|
|
CTheScripts::IntroRectangles[CTheScripts::NumberOfIntroRectanglesThisFrame].m_nTextureId = -1;
|
|
|
|
CTheScripts::IntroRectangles[CTheScripts::NumberOfIntroRectanglesThisFrame].m_sRect = CRect(
|
|
|
|
*(float*)&ScriptParams[0], *(float*)&ScriptParams[1], *(float*)&ScriptParams[0] + *(float*)&ScriptParams[2], *(float*)&ScriptParams[1] + *(float*)&ScriptParams[3]);
|
|
|
|
CTheScripts::IntroRectangles[CTheScripts::NumberOfIntroRectanglesThisFrame].m_sColor = CRGBA(ScriptParams[4], ScriptParams[5], ScriptParams[6], ScriptParams[7]);
|
|
|
|
CTheScripts::NumberOfIntroRectanglesThisFrame++;
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_SPRITE:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-16 09:44:33 +00:00
|
|
|
strncpy(str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
for (int i = 0; i < KEY_LENGTH_IN_SCRIPT; i++)
|
2020-02-15 11:53:42 +00:00
|
|
|
str[i] = tolower(str[i]);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2020-02-02 11:47:03 +00:00
|
|
|
int slot = CTxdStore::FindTxdSlot("script");
|
|
|
|
CTxdStore::PushCurrentTxd();
|
|
|
|
CTxdStore::SetCurrentTxd(slot);
|
2020-02-15 11:53:42 +00:00
|
|
|
CTheScripts::ScriptSprites[ScriptParams[0] - 1].SetTexture(str);
|
2020-02-02 11:47:03 +00:00
|
|
|
CTxdStore::PopCurrentTxd();
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_TEXTURE_DICTIONARY:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
2020-02-15 11:53:42 +00:00
|
|
|
strcpy(str, "models\\");
|
2020-02-16 09:44:33 +00:00
|
|
|
strncpy(str + sizeof("models\\"), (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
2020-02-15 11:53:42 +00:00
|
|
|
strcat(str, ".txd");
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2020-02-02 11:47:03 +00:00
|
|
|
int slot = CTxdStore::FindTxdSlot("script");
|
|
|
|
if (slot == -1)
|
|
|
|
slot = CTxdStore::AddTxdSlot("script");
|
2020-02-15 11:53:42 +00:00
|
|
|
CTxdStore::LoadTxd(slot, str);
|
2020-02-02 11:47:03 +00:00
|
|
|
CTxdStore::AddRef(slot);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REMOVE_TEXTURE_DICTIONARY:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
for (int i = 0; i < ARRAY_SIZE(CTheScripts::ScriptSprites); i++)
|
|
|
|
CTheScripts::ScriptSprites[i].Delete();
|
|
|
|
CTxdStore::RemoveTxd(CTxdStore::FindTxdSlot("script"));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_OBJECT_DYNAMIC:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-02-02 11:47:03 +00:00
|
|
|
if (ScriptParams[1]) {
|
|
|
|
if (pObject->bIsStatic) {
|
2020-04-05 23:01:03 +00:00
|
|
|
pObject->bIsStatic = false;
|
2020-02-02 11:47:03 +00:00
|
|
|
pObject->AddToMovingList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (!pObject->bIsStatic) {
|
2020-04-05 23:01:03 +00:00
|
|
|
pObject->bIsStatic = true;
|
2020-02-02 11:47:03 +00:00
|
|
|
pObject->RemoveFromMovingList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_ANIM_SPEED:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-02 11:47:03 +00:00
|
|
|
CAnimBlendAssociation* pAssoc = RpAnimBlendClumpGetFirstAssociation(pPed->GetClump());
|
|
|
|
if (pAssoc)
|
|
|
|
pAssoc->speed = *(float*)&ScriptParams[1];
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PLAY_MISSION_PASSED_TUNE:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-16 09:44:33 +00:00
|
|
|
DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND);
|
2020-02-02 11:47:03 +00:00
|
|
|
DMAudio.PlayFrontEndTrack(ScriptParams[0] + STREAMED_SOUND_MISSION_COMPLETED - 1, 0);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_AREA:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CWorld::ClearExcitingStuffFromArea(pos, *(float*)&ScriptParams[3], ScriptParams[4]);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_FREEZE_ONSCREEN_TIMER:
|
2020-02-02 11:47:03 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CUserDisplay::OnscnTimer.m_bDisabled = ScriptParams[0] != 0;
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SWITCH_CAR_SIREN:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-02 11:47:03 +00:00
|
|
|
pVehicle->m_bSirenOrAlarm = ScriptParams[1] != 0;
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SWITCH_PED_ROADS_ON_ANGLED:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
ThePaths.SwitchRoadsInAngledArea(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1], *(float*)&ScriptParams[2],
|
|
|
|
*(float*)&ScriptParams[3], *(float*)&ScriptParams[4], *(float*)&ScriptParams[5], *(float*)&ScriptParams[6], 0, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SWITCH_PED_ROADS_OFF_ANGLED:
|
2020-02-02 11:47:03 +00:00
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
ThePaths.SwitchRoadsInAngledArea(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1], *(float*)&ScriptParams[2],
|
|
|
|
*(float*)&ScriptParams[3], *(float*)&ScriptParams[4], *(float*)&ScriptParams[5], *(float*)&ScriptParams[6], 0, 0);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SWITCH_ROADS_ON_ANGLED:
|
2020-02-02 11:47:03 +00:00
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
ThePaths.SwitchRoadsInAngledArea(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1], *(float*)&ScriptParams[2],
|
|
|
|
*(float*)&ScriptParams[3], *(float*)&ScriptParams[4], *(float*)&ScriptParams[5], *(float*)&ScriptParams[6], 1, 1);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SWITCH_ROADS_OFF_ANGLED:
|
2020-02-02 11:47:03 +00:00
|
|
|
CollectParameters(&m_nIp, 7);
|
|
|
|
ThePaths.SwitchRoadsInAngledArea(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1], *(float*)&ScriptParams[2],
|
|
|
|
*(float*)&ScriptParams[3], *(float*)&ScriptParams[4], *(float*)&ScriptParams[5], *(float*)&ScriptParams[6], 1, 0);
|
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_WATERTIGHT:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR);
|
2020-02-02 11:47:03 +00:00
|
|
|
CAutomobile* pCar = (CAutomobile*)pVehicle;
|
|
|
|
pCar->bWaterTight = ScriptParams[1] != 0;
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ADD_MOVING_PARTICLE_EFFECT:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 12);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2020-04-19 16:34:08 +00:00
|
|
|
float size = Max(0.0f, *(float*)&ScriptParams[7]);
|
2020-02-02 11:47:03 +00:00
|
|
|
eParticleObjectType type = (eParticleObjectType)ScriptParams[0];
|
|
|
|
RwRGBA color;
|
|
|
|
if (type == POBJECT_SMOKE_TRAIL){
|
|
|
|
color.alpha = -1;
|
|
|
|
color.red = ScriptParams[8];
|
|
|
|
color.green = ScriptParams[9];
|
|
|
|
color.blue = ScriptParams[10];
|
|
|
|
}else{
|
|
|
|
color.alpha = color.red = color.blue = color.green = 0;
|
|
|
|
}
|
|
|
|
CVector target = *(CVector*)&ScriptParams[4];
|
|
|
|
CParticleObject::AddObject(type, pos, target, size, ScriptParams[11], color, 1);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_CANT_BE_DRAGGED_OUT:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-02 11:47:03 +00:00
|
|
|
pPed->bDontDragMeOutCar = ScriptParams[1] != 0;
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_TURN_CAR_TO_FACE_COORD:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-02 11:47:03 +00:00
|
|
|
const CVector& pos = pVehicle->GetPosition();
|
|
|
|
float heading = CGeneral::GetATanOfXY(pos.y - *(float*)&ScriptParams[2], pos.x - *(float*)&ScriptParams[1]) + HALFPI;
|
|
|
|
if (heading > TWOPI)
|
|
|
|
heading -= TWOPI;
|
|
|
|
pVehicle->SetHeading(heading);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CRANE_LIFTING_CAR:
|
2020-02-02 11:47:03 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[2]);
|
|
|
|
UpdateCompareFlag(CCranes::IsThisCarPickedUp(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1], pVehicle));
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DRAW_SPHERE:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
2020-05-11 02:55:57 +00:00
|
|
|
C3dMarkers::PlaceMarkerSet((uintptr)this + m_nIp, 4, pos, *(float*)&ScriptParams[3],
|
2020-02-15 11:53:42 +00:00
|
|
|
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A,
|
|
|
|
SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_STATUS:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-04-30 13:45:45 +00:00
|
|
|
pVehicle->SetStatus((eEntityStatus)ScriptParams[1]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_MALE:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-15 11:53:42 +00:00
|
|
|
UpdateCompareFlag(pPed->m_nPedType != PEDTYPE_CIVFEMALE && pPed->m_nPedType != PEDTYPE_PROSTITUTE);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SCRIPT_NAME:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
2020-02-16 09:44:33 +00:00
|
|
|
strncpy(str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
for (int i = 0; i < KEY_LENGTH_IN_SCRIPT; i++)
|
2020-02-15 11:53:42 +00:00
|
|
|
str[i] = tolower(str[i]);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
|
|
|
strncpy(m_abScriptName, str, KEY_LENGTH_IN_SCRIPT);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CHANGE_GARAGE_TYPE_WITH_CAR_MODEL:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CGarages::ChangeGarageType(ScriptParams[0], (eGarageType)ScriptParams[1], ScriptParams[2]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_FIND_DRUG_PLANE_COORDINATES:
|
2020-02-15 11:53:42 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = CPlane::FindDrugPlaneCoordinates();
|
|
|
|
StoreParameters(&m_nIp, 3);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SAVE_INT_TO_DEBUG_FILE:
|
2020-02-15 11:53:42 +00:00
|
|
|
// TODO: implement something here
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SAVE_FLOAT_TO_DEBUG_FILE:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SAVE_NEWLINE_TO_DEBUG_FILE:
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_POLICE_RADIO_MESSAGE:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
DMAudio.PlaySuspectLastSeen(*(float*)&ScriptParams[0], *(float*)&ScriptParams[1], *(float*)&ScriptParams[2]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_STRONG:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-15 11:53:42 +00:00
|
|
|
pVehicle->bTakeLessDamage = ScriptParams[1] != 0;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REMOVE_ROUTE:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CRouteNode::RemoveRoute(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SWITCH_RUBBISH:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CRubbish::SetVisibility(ScriptParams[0] != 0);;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REMOVE_PARTICLE_EFFECTS_IN_AREA:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
2020-02-15 20:30:51 +00:00
|
|
|
float x1 = *(float*)&ScriptParams[0];
|
|
|
|
float y1 = *(float*)&ScriptParams[1];
|
|
|
|
float z1 = *(float*)&ScriptParams[2];
|
|
|
|
float x2 = *(float*)&ScriptParams[3];
|
|
|
|
float y2 = *(float*)&ScriptParams[4];
|
|
|
|
float z2 = *(float*)&ScriptParams[5];
|
2020-02-15 11:53:42 +00:00
|
|
|
CParticleObject* tmp = CParticleObject::pCloseListHead;
|
|
|
|
while (tmp) {
|
|
|
|
CParticleObject* next = tmp->m_pNext;
|
|
|
|
if (tmp->IsWithinArea(x1, y1, z1, x2, y2, z2))
|
|
|
|
tmp->RemoveObject();
|
|
|
|
tmp = next;
|
|
|
|
}
|
|
|
|
tmp = CParticleObject::pFarListHead;
|
|
|
|
while (tmp) {
|
|
|
|
CParticleObject* next = tmp->m_pNext;
|
|
|
|
if (tmp->IsWithinArea(x1, y1, z1, x2, y2, z2))
|
|
|
|
tmp->RemoveObject();
|
|
|
|
tmp = next;
|
|
|
|
}
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SWITCH_STREAMING:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStreaming::ms_disableStreaming = ScriptParams[0] == 0;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_GARAGE_OPEN:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CGarages::IsGarageOpen(ScriptParams[0]));
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_GARAGE_CLOSED:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CGarages::IsGarageClosed(ScriptParams[0]));
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_CATALINA_HELI:
|
2020-02-15 11:53:42 +00:00
|
|
|
CHeli::StartCatalinaFlyBy();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CATALINA_HELI_TAKE_OFF:
|
2020-02-15 11:53:42 +00:00
|
|
|
CHeli::CatalinaTakeOff();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REMOVE_CATALINA_HELI:
|
2020-02-15 11:53:42 +00:00
|
|
|
CHeli::RemoveCatalinaHeli();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_CATALINA_HELI_BEEN_SHOT_DOWN:
|
2020-02-15 11:53:42 +00:00
|
|
|
UpdateCompareFlag(CHeli::HasCatalinaBeenShotDown());
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SWAP_NEAREST_BUILDING_MODEL:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
float radius = *(float*)&ScriptParams[3];
|
|
|
|
int mi1 = ScriptParams[4] >= 0 ? ScriptParams[4] : CTheScripts::UsedObjectArray[-ScriptParams[4]].index;
|
|
|
|
int mi2 = ScriptParams[5] >= 0 ? ScriptParams[5] : CTheScripts::UsedObjectArray[-ScriptParams[5]].index;
|
|
|
|
int16 total;
|
|
|
|
CEntity* apEntities[16];
|
|
|
|
CWorld::FindObjectsOfTypeInRange(mi1, pos, radius, true, &total, 16, apEntities, true, false, false, false, false);
|
|
|
|
if (total == 0)
|
|
|
|
CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(LEVEL_NONE), pos, radius, true, &total, 16, apEntities);
|
|
|
|
if (total == 0)
|
|
|
|
CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(CTheZones::FindZoneForPoint(pos)), pos, radius, true, &total, 16, apEntities);
|
|
|
|
CEntity* pClosestEntity = nil;
|
|
|
|
float min_dist = 2.0f * radius;
|
|
|
|
for (int i = 0; i < total; i++) {
|
|
|
|
float dist = (apEntities[i]->GetPosition() - pos).Magnitude();
|
|
|
|
if (dist < min_dist) {
|
|
|
|
min_dist = dist;
|
|
|
|
pClosestEntity = apEntities[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!pClosestEntity) {
|
|
|
|
printf("Failed to find building\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
CBuilding* pReplacedBuilding = ((CBuilding*)pClosestEntity);
|
|
|
|
pReplacedBuilding->ReplaceWithNewModel(mi2);
|
|
|
|
CTheScripts::AddToBuildingSwapArray(pReplacedBuilding, mi1, mi2);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SWITCH_WORLD_PROCESSING:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CWorld::bProcessCutsceneOnly = ScriptParams[0] == 0;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REMOVE_ALL_PLAYER_WEAPONS:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-15 11:53:42 +00:00
|
|
|
pPed->ClearWeapons();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GRAB_CATALINA_HELI:
|
2020-02-15 20:30:51 +00:00
|
|
|
{
|
2020-02-15 11:53:42 +00:00
|
|
|
CHeli* pHeli = CHeli::FindPointerToCatalinasHeli();
|
|
|
|
ScriptParams[0] = pHeli ? CPools::GetVehiclePool()->GetIndex(pHeli) : -1;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 20:30:51 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_AREA_OF_CARS:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
CWorld::ClearCarsFromArea(infX, infY, infZ, supX, supY, supZ);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_ROTATING_GARAGE_DOOR:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CGarages::SetGarageDoorToRotate(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ADD_SPHERE:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
float radius = *(float*)&ScriptParams[3];
|
|
|
|
CTheScripts::GetActualScriptSphereIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
2020-05-11 02:55:57 +00:00
|
|
|
ScriptParams[0] = CTheScripts::AddScriptSphere((uintptr)this + m_nIp, pos, radius);
|
2020-02-15 11:53:42 +00:00
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REMOVE_SPHERE:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::RemoveScriptSphere(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CATALINA_HELI_FLY_AWAY:
|
2020-02-15 11:53:42 +00:00
|
|
|
CHeli::MakeCatalinaHeliFlyAway();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_EVERYONE_IGNORE_PLAYER:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-15 11:53:42 +00:00
|
|
|
if (ScriptParams[1]) {
|
|
|
|
pPed->m_pWanted->m_bIgnoredByEveryone = true;
|
|
|
|
CWorld::StopAllLawEnforcersInTheirTracks();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pPed->m_pWanted->m_bIgnoredByEveryone = false;
|
|
|
|
}
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_STORE_CAR_CHAR_IS_IN_NO_SAVE:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-15 11:53:42 +00:00
|
|
|
CVehicle* pVehicle = pPed->bInVehicle ? pPed->m_pMyVehicle : nil;
|
|
|
|
ScriptParams[0] = CPools::GetVehiclePool()->GetIndex(pVehicle);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_STORE_CAR_PLAYER_IS_IN_NO_SAVE:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-15 11:53:42 +00:00
|
|
|
CVehicle* pVehicle = pPed->bInVehicle ? pPed->m_pMyVehicle : nil;
|
|
|
|
ScriptParams[0] = CPools::GetVehiclePool()->GetIndex(pVehicle);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PHONE_DISPLAYING_MESSAGE:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(gPhoneInfo.IsMessageBeingDisplayed(ScriptParams[0]));
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DISPLAY_ONSCREEN_TIMER_WITH_STRING:
|
2020-02-15 20:30:51 +00:00
|
|
|
{
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
|
2020-03-01 14:42:47 +00:00
|
|
|
int16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
|
2020-02-15 11:53:42 +00:00
|
|
|
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
|
2020-02-16 09:44:33 +00:00
|
|
|
strncpy(onscreen_str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2020-02-15 11:53:42 +00:00
|
|
|
CUserDisplay::OnscnTimer.AddClock(var, onscreen_str);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 20:30:51 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DISPLAY_ONSCREEN_COUNTER_WITH_STRING:
|
2020-02-15 20:30:51 +00:00
|
|
|
{
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
|
2020-03-01 14:42:47 +00:00
|
|
|
int16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
|
2020-02-16 09:44:33 +00:00
|
|
|
strncpy(onscreen_str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2020-02-15 11:53:42 +00:00
|
|
|
CUserDisplay::OnscnTimer.AddCounter(var, ScriptParams[0], onscreen_str);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 20:30:51 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CREATE_RANDOM_CAR_FOR_CAR_PARK:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
if (CCarCtrl::NumRandomCars >= 30)
|
|
|
|
return 0;
|
|
|
|
int attempts;
|
|
|
|
int model = -1;
|
|
|
|
int index = CGeneral::GetRandomNumberInRange(0, 50);
|
|
|
|
for (attempts = 0; attempts < 50; attempts++) {
|
|
|
|
if (model != -1)
|
|
|
|
break;
|
|
|
|
model = CStreaming::ms_vehiclesLoaded[index];
|
2020-03-15 15:47:21 +00:00
|
|
|
if (model == -1)
|
|
|
|
continue;
|
2020-02-15 11:53:42 +00:00
|
|
|
// desperatly want to believe this was inlined :|
|
|
|
|
CBaseModelInfo* pInfo = CModelInfo::GetModelInfo(model);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pInfo->GetModelType() == MITYPE_VEHICLE);
|
2020-02-15 11:53:42 +00:00
|
|
|
CVehicleModelInfo* pVehicleInfo = (CVehicleModelInfo*)pInfo;
|
|
|
|
if (pVehicleInfo->m_vehicleType != VEHICLE_TYPE_CAR) {
|
|
|
|
switch (model) {
|
|
|
|
case MI_LANDSTAL:
|
|
|
|
case MI_LINERUN:
|
|
|
|
case MI_FIRETRUCK:
|
|
|
|
case MI_TRASH:
|
|
|
|
case MI_STRETCH:
|
|
|
|
case MI_MULE:
|
|
|
|
case MI_AMBULAN:
|
|
|
|
case MI_FBICAR:
|
|
|
|
case MI_MRWHOOP:
|
|
|
|
case MI_BFINJECT:
|
|
|
|
case MI_CORPSE:
|
|
|
|
case MI_POLICE:
|
|
|
|
case MI_ENFORCER:
|
|
|
|
case MI_SECURICA:
|
|
|
|
case MI_PREDATOR:
|
|
|
|
case MI_BUS:
|
|
|
|
case MI_RHINO:
|
|
|
|
case MI_BARRACKS:
|
|
|
|
case MI_TRAIN:
|
|
|
|
case MI_CHOPPER:
|
|
|
|
case MI_DODO:
|
|
|
|
case MI_COACH:
|
|
|
|
case MI_RCBANDIT:
|
|
|
|
case MI_BELLYUP:
|
|
|
|
case MI_MRWONGS:
|
|
|
|
case MI_MAFIA:
|
|
|
|
case MI_YARDIE:
|
|
|
|
case MI_YAKUZA:
|
|
|
|
case MI_DIABLOS:
|
|
|
|
case MI_COLUMB:
|
|
|
|
case MI_HOODS:
|
|
|
|
case MI_AIRTRAIN:
|
|
|
|
case MI_DEADDODO:
|
|
|
|
case MI_SPEEDER:
|
|
|
|
case MI_REEFER:
|
|
|
|
case MI_PANLANT:
|
|
|
|
case MI_FLATBED:
|
|
|
|
case MI_YANKEE:
|
|
|
|
case MI_ESCAPE:
|
|
|
|
case MI_BORGNINE:
|
|
|
|
case MI_TOYZ:
|
|
|
|
case MI_GHOST:
|
|
|
|
case MI_MIAMI_RCBARON:
|
|
|
|
case MI_MIAMI_RCRAIDER:
|
|
|
|
model = -1;
|
|
|
|
break;
|
|
|
|
case MI_IDAHO:
|
|
|
|
case MI_STINGER:
|
|
|
|
case MI_PEREN:
|
|
|
|
case MI_SENTINEL:
|
|
|
|
case MI_PATRIOT:
|
|
|
|
case MI_MANANA:
|
|
|
|
case MI_INFERNUS:
|
|
|
|
case MI_BLISTA:
|
|
|
|
case MI_PONY:
|
|
|
|
case MI_CHEETAH:
|
|
|
|
case MI_MOONBEAM:
|
|
|
|
case MI_ESPERANT:
|
|
|
|
case MI_TAXI:
|
|
|
|
case MI_KURUMA:
|
|
|
|
case MI_BOBCAT:
|
|
|
|
case MI_BANSHEE:
|
|
|
|
case MI_CABBIE:
|
|
|
|
case MI_STALLION:
|
|
|
|
case MI_RUMPO:
|
|
|
|
case 151:
|
|
|
|
case 152:
|
|
|
|
case 153:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("CREATE_RANDOM_CAR_FOR_CAR_PARK - Unknown car model %d\n", CStreaming::ms_vehiclesLoaded[index]);
|
|
|
|
model = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
model = -1;
|
|
|
|
if (++index >= 50)
|
|
|
|
index = 0;
|
|
|
|
}
|
|
|
|
if (model == -1)
|
|
|
|
return 0;
|
|
|
|
CVehicle* car;
|
|
|
|
if (!CModelInfo::IsBikeModel(model))
|
|
|
|
car = new CAutomobile(model, MISSION_VEHICLE);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
pos.z += car->GetDistanceFromCentreOfMassToBaseOfModel();
|
2020-05-05 01:45:18 +00:00
|
|
|
car->SetPosition(pos);
|
2020-02-15 11:53:42 +00:00
|
|
|
car->SetHeading(DEGTORAD(*(float*)&ScriptParams[3]));
|
|
|
|
CTheScripts::ClearSpaceForMissionEntity(pos, car);
|
2020-04-30 13:45:45 +00:00
|
|
|
car->SetStatus(STATUS_ABANDONED);
|
2020-05-20 20:25:01 +00:00
|
|
|
car->bIsLocked = false;
|
2020-02-15 11:53:42 +00:00
|
|
|
car->bIsCarParkVehicle = true;
|
|
|
|
CCarCtrl::JoinCarWithRoadSystem(car);
|
|
|
|
car->AutoPilot.m_nCarMission = MISSION_NONE;
|
|
|
|
car->AutoPilot.m_nTempAction = TEMPACT_NONE;
|
|
|
|
car->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_STOP_FOR_CARS;
|
|
|
|
car->AutoPilot.m_nCruiseSpeed = car->AutoPilot.m_fMaxTrafficSpeed = 9.0f;
|
|
|
|
car->AutoPilot.m_nCurrentLane = car->AutoPilot.m_nNextLane = 0;
|
|
|
|
car->bEngineOn = false;
|
2020-05-06 10:23:26 +00:00
|
|
|
car->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pos);
|
2020-02-15 11:53:42 +00:00
|
|
|
CWorld::Add(car);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_COLLISION_IN_MEMORY:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CCollision::ms_collisionInMemory == ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_WANTED_MULTIPLIER:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
FindPlayerPed()->m_pWanted->m_fCrimeSensitivity = *(float*)&ScriptParams[0];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAMERA_IN_FRONT_OF_PLAYER:
|
2020-02-15 11:53:42 +00:00
|
|
|
TheCamera.SetCameraDirectlyInFrontForFollowPed_CamOnAString();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CAR_VISIBLY_DAMAGED:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-15 11:53:42 +00:00
|
|
|
UpdateCompareFlag(pVehicle->bIsDamaged);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DOES_OBJECT_EXIST:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CPools::GetObjectPool()->GetAt(ScriptParams[0]));
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_SCENE:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
CTimer::Stop();
|
|
|
|
CStreaming::LoadScene(pos);
|
|
|
|
CTimer::Update();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ADD_STUCK_CAR_CHECK:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-15 11:53:42 +00:00
|
|
|
CTheScripts::StuckCars.AddCarToCheck(ScriptParams[0], *(float*)&ScriptParams[1], ScriptParams[2]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REMOVE_STUCK_CAR_CHECK:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::StuckCars.RemoveCarFromCheck(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CAR_STUCK:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
UpdateCompareFlag(CTheScripts::StuckCars.HasCarBeenStuckForAWhile(ScriptParams[0]));
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_MISSION_AUDIO:
|
2020-02-16 09:44:33 +00:00
|
|
|
strncpy(str, (char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
for (int i = 0; i < KEY_LENGTH_IN_SCRIPT; i++)
|
2020-02-15 11:53:42 +00:00
|
|
|
str[i] = tolower(str[i]);
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2020-02-15 11:53:42 +00:00
|
|
|
DMAudio.PreloadMissionAudio(str);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_MISSION_AUDIO_LOADED:
|
2020-02-15 11:53:42 +00:00
|
|
|
UpdateCompareFlag(DMAudio.GetMissionAudioLoadingStatus() == 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PLAY_MISSION_AUDIO:
|
2020-02-15 11:53:42 +00:00
|
|
|
DMAudio.PlayLoadedMissionAudio();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_MISSION_AUDIO_FINISHED:
|
2020-02-15 11:53:42 +00:00
|
|
|
UpdateCompareFlag(DMAudio.IsMissionAudioSampleFinished());
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CLOSEST_CAR_NODE_WITH_HEADING:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
int node = ThePaths.FindNodeClosestToCoors(pos, 0, 999999.9f, true, true);
|
2020-05-03 13:57:57 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = ThePaths.m_pathNodes[node].GetPosition();
|
2020-02-15 11:53:42 +00:00
|
|
|
*(float*)&ScriptParams[3] = ThePaths.FindNodeOrientationForCarPlacement(node);
|
|
|
|
StoreParameters(&m_nIp, 4);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_IMPORT_GARAGE_SLOT_BEEN_FILLED:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
UpdateCompareFlag(CGarages::HasImportExportGarageCollectedThisCar(ScriptParams[0], ScriptParams[1] - 1));
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_THIS_PRINT:
|
2020-02-15 20:30:51 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-02-15 11:53:42 +00:00
|
|
|
CMessages::ClearThisPrint(text);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 20:30:51 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_THIS_BIG_PRINT:
|
2020-02-15 20:30:51 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-02-15 11:53:42 +00:00
|
|
|
CMessages::ClearThisBigPrint(text);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 20:30:51 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_MISSION_AUDIO_POSITION:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
|
|
|
DMAudio.SetMissionAudioLocation(pos.x, pos.y, pos.z);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ACTIVATE_SAVE_MENU:
|
2020-02-15 11:53:42 +00:00
|
|
|
FrontEndMenuManager.m_bSaveMenuActive = true;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_SAVE_GAME_FINISHED:
|
2020-02-15 11:53:42 +00:00
|
|
|
UpdateCompareFlag(!FrontEndMenuManager.m_bMenuActive);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_NO_SPECIAL_CAMERA_FOR_THIS_GARAGE:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CGarages::SetLeaveCameraForThisGarage(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_PICKUP_OLD:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CObject* pObject = CPickups::aPickUps[CPickups::GetActualPickupIndex(ScriptParams[0])].m_pObject;
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
ScriptParams[0] = CRadar::SetEntityBlip(BLIP_OBJECT, CPools::GetObjectPool()->GetIndex(pObject), ScriptParams[1], (eBlipDisplay)ScriptParams[2]);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ADD_BLIP_FOR_PICKUP:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CObject* pObject = CPickups::aPickUps[CPickups::GetActualPickupIndex(ScriptParams[0])].m_pObject;
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
int handle = CRadar::SetEntityBlip(BLIP_OBJECT, CPools::GetObjectPool()->GetIndex(pObject), 6, BLIP_DISPLAY_BOTH);
|
|
|
|
CRadar::ChangeBlipScale(handle, 3);
|
|
|
|
ScriptParams[0] = handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ADD_SPRITE_BLIP_FOR_PICKUP:
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CObject* pObject = CPickups::aPickUps[CPickups::GetActualPickupIndex(ScriptParams[0])].m_pObject;
|
|
|
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
|
|
|
int handle = CRadar::SetEntityBlip(BLIP_OBJECT, CPools::GetObjectPool()->GetIndex(pObject), 6, BLIP_DISPLAY_BOTH);
|
|
|
|
CRadar::SetBlipSprite(handle, ScriptParams[1]);
|
|
|
|
ScriptParams[0] = handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_PED_DENSITY_MULTIPLIER:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPopulation::PedDensityMultiplier = *(float*)&ScriptParams[0];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_FORCE_RANDOM_PED_TYPE:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPopulation::m_AllRandomPedsThisType = ScriptParams[0];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_DRAW_BEFORE_FADE:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_bTextBeforeFade = ScriptParams[0] != 0;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_COLLECTABLE1S_COLLECTED:
|
2020-02-15 11:53:42 +00:00
|
|
|
ScriptParams[0] = CWorld::Players[CWorld::PlayerInFocus].m_nCollectedPackages;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_EL_BURRO_TIME:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::RegisterElBurroTime(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_SPRITES_DRAW_BEFORE_FADE:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroRectangles[CTheScripts::NumberOfIntroRectanglesThisFrame].m_bBeforeFade = ScriptParams[0] != 0;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TEXT_RIGHT_JUSTIFY:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_bRightJustify = ScriptParams[0] != 0;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PRINT_HELP:
|
2020-02-15 20:30:51 +00:00
|
|
|
{
|
2020-02-15 11:53:42 +00:00
|
|
|
if (CCamera::m_bUseMouse3rdPerson && (
|
|
|
|
strncmp((char*)&CTheScripts::ScriptSpace[m_nIp], "HELP15", 7) == 0 ||
|
|
|
|
strncmp((char*)&CTheScripts::ScriptSpace[m_nIp], "GUN_2A", 7) == 0 ||
|
|
|
|
strncmp((char*)&CTheScripts::ScriptSpace[m_nIp], "GUN_3A", 7) == 0 ||
|
2020-02-15 20:30:51 +00:00
|
|
|
strncmp((char*)&CTheScripts::ScriptSpace[m_nIp], "GUN_4A", 7) == 0)) {
|
2020-02-16 09:44:33 +00:00
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
2020-02-15 11:53:42 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-02-15 11:53:42 +00:00
|
|
|
CHud::SetHelpMessage(text, false);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-15 20:30:51 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_HELP:
|
2020-02-15 11:53:42 +00:00
|
|
|
CHud::SetHelpMessage(nil, false);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_FLASH_HUD_OBJECT:
|
2020-02-15 11:53:42 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CHud::m_ItemToFlash = ScriptParams[0];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-11-09 13:44:17 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands1000To1099(int32 command)
|
2019-11-09 13:44:17 +00:00
|
|
|
{
|
2020-02-16 20:08:54 +00:00
|
|
|
#ifdef GTA_PS2
|
|
|
|
char tmp[48];
|
|
|
|
#endif
|
|
|
|
switch (command) {
|
|
|
|
//case COMMAND_FLASH_RADAR_BLIP:
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_IN_CONTROL:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
UpdateCompareFlag(pPed->IsPedInControl());
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_GENERATE_CARS_AROUND_CAMERA:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CCarCtrl::bCarsGeneratedAroundCamera = (ScriptParams[0] != 0);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_SMALL_PRINTS:
|
2020-02-16 20:08:54 +00:00
|
|
|
CMessages::ClearSmallMessagesOnly();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_HAS_MILITARY_CRANE_COLLECTED_ALL_CARS:
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(CCranes::HaveAllCarsBeenCollectedByMilitaryCrane());
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_UPSIDEDOWN_CAR_NOT_DAMAGED:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR);
|
2020-02-16 20:08:54 +00:00
|
|
|
CAutomobile* pCar = (CAutomobile*)pVehicle;
|
|
|
|
pCar->bNotDamagedUpsideDown = (ScriptParams[1] != 0);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CAN_PLAYER_START_MISSION:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPlayerPed* pPlayerPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPlayerPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(pPlayerPed->IsPedInControl() || pPlayerPed->m_nPedState == PED_DRIVING);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_MAKE_PLAYER_SAFE_FOR_CUTSCENE:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-05-26 21:25:12 +00:00
|
|
|
#ifdef MISSION_REPLAY
|
|
|
|
AllowMissionReplay = 0;
|
|
|
|
SaveGameForPause(3);
|
|
|
|
#endif
|
2020-02-16 20:08:54 +00:00
|
|
|
CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]];
|
2020-06-21 13:00:17 +00:00
|
|
|
CPad::GetPad(ScriptParams[0])->SetDisablePlayerControls(PLAYERCONTROL_CUTSCENE);
|
2020-02-16 20:08:54 +00:00
|
|
|
pPlayerInfo->MakePlayerSafe(true);
|
2020-04-10 08:23:35 +00:00
|
|
|
CCutsceneMgr::StartCutsceneProcessing();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_USE_TEXT_COMMANDS:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-24 18:17:15 +00:00
|
|
|
CTheScripts::UseTextCommands = (ScriptParams[0] != 0) ? 2 : 1;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_THREAT_FOR_PED_TYPE:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPedType::AddThreat(ScriptParams[0], ScriptParams[1]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_THREAT_FOR_PED_TYPE:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPedType::RemoveThreat(ScriptParams[0], ScriptParams[1]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CAR_COLOURS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
ScriptParams[0] = pVehicle->m_currentColour1;
|
|
|
|
ScriptParams[1] = pVehicle->m_currentColour2;
|
|
|
|
StoreParameters(&m_nIp, 2);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_ALL_CARS_CAN_BE_DAMAGED:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CWorld::SetAllCarsCanBeDamaged(ScriptParams[0] != 0);
|
|
|
|
if (!ScriptParams[0])
|
|
|
|
CWorld::ExtinguishAllCarFiresInArea(FindPlayerCoors(), 4000.0f);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_CAN_BE_DAMAGED:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
|
|
|
pVehicle->bCanBeDamaged = ScriptParams[1] != 0;
|
|
|
|
if (!ScriptParams[1])
|
|
|
|
pVehicle->ExtinguishCarFire();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
|
|
|
//case COMMAND_MAKE_PLAYER_UNSAFE:
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_COLLISION:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTimer::Stop();
|
|
|
|
CGame::currLevel = (eLevelName)ScriptParams[0];
|
|
|
|
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
|
2020-02-23 15:32:28 +00:00
|
|
|
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
|
2020-02-16 20:08:54 +00:00
|
|
|
CCollision::SortOutCollisionAfterLoad();
|
|
|
|
CStreaming::RequestIslands(CGame::currLevel);
|
|
|
|
CStreaming::LoadAllRequestedModels(true);
|
|
|
|
CTimer::Update();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_BODY_CAST_HEALTH:
|
2020-02-16 20:08:54 +00:00
|
|
|
ScriptParams[0] = CObject::nBodyCastHealth;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHARS_CHATTING:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 3);
|
|
|
|
CPed* pPed1 = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
CPed* pPed2 = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed1 && pPed2);
|
2020-02-16 20:08:54 +00:00
|
|
|
pPed1->SetChat(pPed2, ScriptParams[2]);
|
|
|
|
pPed2->SetChat(pPed1, ScriptParams[2]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
|
|
|
//case COMMAND_MAKE_PLAYER_SAFE:
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_STAYS_IN_CURRENT_LEVEL:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
if (ScriptParams[1])
|
2020-05-06 10:23:26 +00:00
|
|
|
pVehicle->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pVehicle->GetPosition());
|
2020-02-16 20:08:54 +00:00
|
|
|
else
|
|
|
|
pVehicle->m_nZoneLevel = LEVEL_NONE;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_STAYS_IN_CURRENT_LEVEL:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
if (ScriptParams[1])
|
2020-05-06 10:23:26 +00:00
|
|
|
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
|
2020-02-16 20:08:54 +00:00
|
|
|
else
|
|
|
|
pPed->m_nZoneLevel = LEVEL_NONE;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_4X4_ONE_TIME:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::Register4x4OneTime(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_4X4_TWO_TIME:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::Register4x4TwoTime(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_4X4_THREE_TIME:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::Register4x4ThreeTime(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_4X4_MAYHEM_TIME:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::Register4x4MayhemTime(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_LIFE_SAVED:
|
2020-02-16 20:08:54 +00:00
|
|
|
CStats::AnotherLifeSavedWithAmbulance();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_CRIMINAL_CAUGHT:
|
2020-02-16 20:08:54 +00:00
|
|
|
CStats::AnotherCriminalCaught();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_AMBULANCE_LEVEL:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::RegisterLevelAmbulanceMission(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_FIRE_EXTINGUISHED:
|
2020-02-16 20:08:54 +00:00
|
|
|
CStats::AnotherFireExtinguished();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_TURN_PHONE_ON:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
gPhoneInfo.m_aPhones[ScriptParams[0]].m_nState = PHONE_STATE_9;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_LONGEST_DODO_FLIGHT:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::RegisterLongestFlightInDodo(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_DEFUSE_BOMB_TIME:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::RegisterTimeTakenDefuseMission(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TOTAL_NUMBER_OF_KILL_FRENZIES:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::SetTotalNumberKillFrenzies(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_BLOW_UP_RC_BUGGY:
|
2020-02-16 20:08:54 +00:00
|
|
|
CWorld::Players[CWorld::PlayerInFocus].BlowUpRCBuggy();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REMOVE_CAR_FROM_CHASE:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CRecordDataForChase::RemoveCarFromChase(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_FRENCH_GAME:
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(CGame::frenchGame);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_GERMAN_GAME:
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(CGame::germanGame);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_MISSION_AUDIO:
|
2020-02-16 20:08:54 +00:00
|
|
|
DMAudio.ClearMissionAudio();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_FADE_IN_AFTER_NEXT_ARREST:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CRestart::bFadeInAfterNextArrest = !!ScriptParams[0];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_FADE_IN_AFTER_NEXT_DEATH:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CRestart::bFadeInAfterNextDeath = !!ScriptParams[0];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_GANG_PED_MODEL_PREFERENCE:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CGangs::SetGangPedModelOverride(ScriptParams[0], ScriptParams[1]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_USE_PEDNODE_SEEK:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
if (ScriptParams[1])
|
|
|
|
pPed->m_pNextPathNode = nil;
|
|
|
|
pPed->bUsePedNodeSeek = !!ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SWITCH_VEHICLE_WEAPONS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
pVehicle->bGunSwitchedOff = !ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_GET_OUT_OF_JAIL_FREE:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CWorld::Players[ScriptParams[0]].m_bGetOutOfJailFree = !!ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_FREE_HEALTH_CARE:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CWorld::Players[ScriptParams[0]].m_bGetOutOfHospitalFree = !!ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CAR_DOOR_CLOSED:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(!pVehicle->IsDoorMissing((eDoors)ScriptParams[1]) && pVehicle->IsDoorClosed((eDoors)ScriptParams[1]));
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_AND_LAUNCH_MISSION:
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_AND_LAUNCH_MISSION_INTERNAL:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-05-26 21:25:12 +00:00
|
|
|
#ifdef MISSION_REPLAY
|
|
|
|
missionRetryScriptIndex = ScriptParams[0];
|
|
|
|
if (missionRetryScriptIndex == 19)
|
|
|
|
CStats::LastMissionPassedName[0] = '\0';
|
|
|
|
#endif
|
2020-02-16 20:08:54 +00:00
|
|
|
CTimer::Suspend();
|
|
|
|
int offset = CTheScripts::MultiScriptArray[ScriptParams[0]];
|
|
|
|
CFileMgr::ChangeDir("\\");
|
|
|
|
int handle = CFileMgr::OpenFile("data\\main.scm", "rb");
|
|
|
|
CFileMgr::Seek(handle, offset, 0);
|
|
|
|
CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
|
|
|
|
CFileMgr::CloseFile(handle);
|
|
|
|
CRunningScript* pMissionScript = CTheScripts::StartNewScript(SIZE_MAIN_SCRIPT);
|
|
|
|
CTimer::Resume();
|
|
|
|
pMissionScript->m_bIsMissionScript = true;
|
|
|
|
pMissionScript->m_bMissionFlag = true;
|
2020-05-20 21:18:13 +00:00
|
|
|
CTheScripts::bAlreadyRunningAMissionScript = true;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_OBJECT_DRAW_LAST:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-02-16 20:08:54 +00:00
|
|
|
pObject->bDrawLast = !!ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_AMMO_IN_PLAYER_WEAPON:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
CWeapon* pWeaponSlot = &pPed->m_weapons[ScriptParams[1]];
|
|
|
|
if (pWeaponSlot->m_eWeaponType == (eWeaponType)ScriptParams[1])
|
|
|
|
ScriptParams[0] = pWeaponSlot->m_nAmmoTotal;
|
|
|
|
else
|
|
|
|
ScriptParams[0] = 0;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_AMMO_IN_CHAR_WEAPON:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
CWeapon* pWeaponSlot = &pPed->m_weapons[ScriptParams[1]];
|
|
|
|
if (pWeaponSlot->m_eWeaponType == (eWeaponType)ScriptParams[1])
|
|
|
|
ScriptParams[0] = pWeaponSlot->m_nAmmoTotal;
|
|
|
|
else
|
|
|
|
ScriptParams[0] = 0;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_KILL_FRENZY_PASSED:
|
2020-02-16 20:08:54 +00:00
|
|
|
CStats::AnotherKillFrenzyPassed();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_SAY:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
|
|
|
switch (ScriptParams[1]) {
|
|
|
|
case SCRIPT_SOUND_CHUNKY_RUN_SHOUT:
|
|
|
|
pPed->Say(SOUND_PED_FLEE_RUN);
|
|
|
|
break;
|
|
|
|
case SCRIPT_SOUND_SECURITY_GUARD_AWAY_SHOUT:
|
|
|
|
pPed->Say(SOUND_PED_FLEE_RUN);
|
|
|
|
break;
|
|
|
|
case SCRIPT_SOUND_SWAT_PED_SHOUT:
|
|
|
|
pPed->Say(SOUND_PED_PURSUIT_SWAT);
|
|
|
|
break;
|
|
|
|
case SCRIPT_SOUND_AMMUNATION_CHAT_1:
|
|
|
|
pPed->Say(SOUND_AMMUNATION_WELCOME_1);
|
|
|
|
break;
|
|
|
|
case SCRIPT_SOUND_AMMUNATION_CHAT_2:
|
|
|
|
pPed->Say(SOUND_AMMUNATION_WELCOME_2);
|
|
|
|
break;
|
|
|
|
case SCRIPT_SOUND_AMMUNATION_CHAT_3:
|
|
|
|
pPed->Say(SOUND_AMMUNATION_WELCOME_3);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_NEAR_CLIP:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
TheCamera.SetNearClipScript(*(float*)&ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_RADIO_CHANNEL:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
DMAudio.SetRadioChannel(ScriptParams[0], ScriptParams[1]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_OVERRIDE_HOSPITAL_LEVEL:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CRestart::OverrideHospitalLevel = ScriptParams[0];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_OVERRIDE_POLICE_STATION_LEVEL:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CRestart::OverridePoliceStationLevel = ScriptParams[0];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_FORCE_RAIN:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CWeather::bScriptsForceRain = !!ScriptParams[0];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DOES_GARAGE_CONTAIN_CAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(CGarages::IsThisCarWithinGarageArea(ScriptParams[0], pVehicle));
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_TRACTION:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
|
|
|
float fTraction = *(float*)&ScriptParams[1];
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR || pVehicle->m_vehType == VEHICLE_TYPE_BIKE);
|
2020-02-16 20:08:54 +00:00
|
|
|
if (pVehicle->m_vehType == VEHICLE_TYPE_CAR)
|
|
|
|
((CAutomobile*)pVehicle)->m_fTraction = fTraction;
|
|
|
|
else
|
|
|
|
// this is certainly not a boat, trane, heli or plane field
|
|
|
|
//((CBike*)pVehicle)->m_fTraction = fTraction;
|
|
|
|
*(float*)(((char*)pVehicle) + 1088) = fTraction;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ARE_MEASUREMENTS_IN_METRES:
|
2020-02-16 20:08:54 +00:00
|
|
|
#ifdef USE_MEASUREMENTS_IN_METERS
|
|
|
|
UpdateCompareFlag(true);
|
|
|
|
#else
|
|
|
|
UpdateCompareFlag(false)
|
|
|
|
#endif
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CONVERT_METRES_TO_FEET:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
float fMeterValue = *(float*)&ScriptParams[0];
|
2020-02-22 23:29:38 +00:00
|
|
|
float fFeetValue = fMeterValue / METERS_IN_FOOT;
|
2020-02-16 20:08:54 +00:00
|
|
|
*(float*)&ScriptParams[0] = fFeetValue;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_MARK_ROADS_BETWEEN_LEVELS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
ThePaths.MarkRoadsBetweenLevelsInArea(infX, supX, infY, supY, infZ, supZ);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_MARK_PED_ROADS_BETWEEN_LEVELS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
ThePaths.PedMarkRoadsBetweenLevelsInArea(infX, supX, infY, supY, infZ, supZ);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_AVOID_LEVEL_TRANSITIONS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
pVehicle->AutoPilot.m_bStayInCurrentLevel = !!ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_AVOID_LEVEL_TRANSITIONS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
// not implemented
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_THREAT_FOR_PED_TYPE:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
UpdateCompareFlag(CPedType::IsThreat(ScriptParams[0], ScriptParams[1]));
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_AREA_OF_CHARS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
float infX = *(float*)&ScriptParams[0];
|
|
|
|
float infY = *(float*)&ScriptParams[1];
|
|
|
|
float infZ = *(float*)&ScriptParams[2];
|
|
|
|
float supX = *(float*)&ScriptParams[3];
|
|
|
|
float supY = *(float*)&ScriptParams[4];
|
|
|
|
float supZ = *(float*)&ScriptParams[5];
|
|
|
|
if (infX > supX) {
|
|
|
|
infX = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[0];
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
infY = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[1];
|
|
|
|
}
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[2];
|
|
|
|
}
|
|
|
|
CWorld::ClearPedsFromArea(infX, infY, infZ, supX, supY, supZ);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_TOTAL_NUMBER_OF_MISSIONS:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CStats::SetTotalNumberMissions(ScriptParams[0]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CONVERT_METRES_TO_FEET_INT:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
ScriptParams[0] *= FEET_IN_METER;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_FASTEST_TIME:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CStats::RegisterFastestTime(ScriptParams[0], ScriptParams[1]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_REGISTER_HIGHEST_SCORE:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CStats::RegisterHighestScore(ScriptParams[0], ScriptParams[1]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
//case COMMAND_WARP_CHAR_INTO_CAR_AS_PASSENGER:
|
|
|
|
//case COMMAND_IS_CAR_PASSENGER_SEAT_FREE:
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CHAR_IN_CAR_PASSENGER_SEAT:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(ScriptParams[1] >= 0 && ScriptParams[1] < ARRAY_SIZE(pVehicle->pPassengers));
|
2020-02-16 20:08:54 +00:00
|
|
|
CPed* pPassenger = pVehicle->pPassengers[ScriptParams[1]];
|
|
|
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pPassenger);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_IS_CHRIS_CRIMINAL:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
pPed->bChrisCriminal = !!ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_START_CREDITS:
|
2020-02-16 20:08:54 +00:00
|
|
|
CCredits::Start();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_STOP_CREDITS:
|
2020-02-16 20:08:54 +00:00
|
|
|
CCredits::Stop();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ARE_CREDITS_FINISHED:
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(CCredits::AreCreditsDone());
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CREATE_SINGLE_PARTICLE:
|
2020-04-14 21:33:55 +00:00
|
|
|
CollectParameters(&m_nIp, 8);
|
2020-02-16 20:08:54 +00:00
|
|
|
CParticle::AddParticle((tParticleType)ScriptParams[0], *(CVector*)&ScriptParams[1],
|
|
|
|
*(CVector*)&ScriptParams[4], nil, *(float*)&ScriptParams[7], 0, 0, 0, 0);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_IGNORE_LEVEL_TRANSITIONS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
if (ScriptParams[1])
|
2020-04-19 04:14:13 +00:00
|
|
|
pPed->m_nZoneLevel = LEVEL_IGNORE;
|
2020-02-16 20:08:54 +00:00
|
|
|
else
|
2020-05-06 10:23:26 +00:00
|
|
|
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
|
2020-02-16 20:08:54 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_GET_CHASE_CAR:
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CRecordDataForChase::TurnChaseCarIntoScriptCar(ScriptParams[0]);
|
|
|
|
ScriptParams[0] = CPools::GetVehiclePool()->GetIndex(pVehicle);
|
|
|
|
StoreParameters(&m_nIp, 1);
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ScriptParams[0], CLEANUP_CAR);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
case COMMAND_START_BOAT_FOAM_ANIMATION:
|
|
|
|
CSpecialParticleStuff::StartBoatFoamAnimation();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_UPDATE_BOAT_FOAM_ANIMATION:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-22 12:35:46 +00:00
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-02-22 12:35:46 +00:00
|
|
|
CSpecialParticleStuff::UpdateBoatFoamAnimation(&pObject->GetMatrix());
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_MUSIC_DOES_FADE:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-23 15:32:28 +00:00
|
|
|
TheCamera.m_bIgnoreFadingStuffForMusic = (ScriptParams[0] == 0);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_INTRO_IS_PLAYING:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
if (ScriptParams[0]) {
|
|
|
|
CGame::playingIntro = true;
|
|
|
|
CStreaming::RemoveCurrentZonesModels();
|
|
|
|
} else {
|
|
|
|
CGame::playingIntro = false;
|
|
|
|
DMAudio.ChangeMusicMode(MUSICMODE_GAME);
|
|
|
|
int mi;
|
|
|
|
CModelInfo::GetModelInfo("bridgefukb", &mi);
|
|
|
|
CStreaming::RequestModel(mi, STREAMFLAGS_DEPENDENCY);
|
|
|
|
CStreaming::LoadAllRequestedModels(false);
|
|
|
|
}
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_PLAYER_HOOKER:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]];
|
|
|
|
if (ScriptParams[1] < 0) {
|
|
|
|
pPlayerInfo->m_pHooker = nil;
|
|
|
|
pPlayerInfo->m_nNextSexFrequencyUpdateTime = 0;
|
|
|
|
pPlayerInfo->m_nNextSexMoneyUpdateTime = 0;
|
|
|
|
} else {
|
|
|
|
CPed* pHooker = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pHooker);
|
2020-02-16 20:08:54 +00:00
|
|
|
pPlayerInfo->m_pHooker = (CCivilianPed*)pHooker;
|
|
|
|
pPlayerInfo->m_nNextSexFrequencyUpdateTime = CTimer::GetTimeInMilliseconds() + 1000;
|
|
|
|
pPlayerInfo->m_nNextSexMoneyUpdateTime = CTimer::GetTimeInMilliseconds() + 3000;
|
|
|
|
}
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PLAY_END_OF_GAME_TUNE:
|
2020-02-16 20:08:54 +00:00
|
|
|
DMAudio.PlayPreloadedCutSceneMusic();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_STOP_END_OF_GAME_TUNE:
|
2020-02-16 20:08:54 +00:00
|
|
|
DMAudio.StopCutSceneMusic();
|
|
|
|
DMAudio.ChangeMusicMode(MUSICMODE_GAME);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CAR_MODEL:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
ScriptParams[0] = pVehicle->GetModelIndex();
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_SITTING_IN_CAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_pMyVehicle == pVehicle);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_SITTING_IN_ANY_CAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_SCRIPT_FIRE_AUDIO:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
gFireManager.SetScriptFireAudio(ScriptParams[0], !!ScriptParams[1]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ARE_ANY_CAR_CHEATS_ACTIVATED:
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(CVehicle::bAllDodosCheat || CVehicle::bCheat3);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_SUFFERS_CRITICAL_HITS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
pPed->bNoCriticalHits = (ScriptParams[0] == 0);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_LIFTING_A_PHONE:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(pPed->GetPedState() == PED_MAKE_CALL);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_SITTING_IN_CAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_pMyVehicle == pVehicle);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_SITTING_IN_ANY_CAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_ON_FOOT:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(!pPed->bInVehicle && pPed->m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER &&
|
|
|
|
pPed->m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_ON_FOOT:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(!pPed->bInVehicle && pPed->m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER &&
|
|
|
|
pPed->m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
|
|
|
#ifndef GTA_PS2
|
2019-11-09 13:44:17 +00:00
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-11-09 13:44:17 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:16:13 +00:00
|
|
|
int8 CRunningScript::ProcessCommands1100To1199(int32 command)
|
2019-11-09 13:44:17 +00:00
|
|
|
{
|
2020-02-16 20:08:54 +00:00
|
|
|
char tmp[48];
|
2019-11-09 13:44:17 +00:00
|
|
|
switch (command) {
|
2020-02-16 20:08:54 +00:00
|
|
|
#endif
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_COLLISION_WITH_SCREEN:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CTimer::Stop();
|
|
|
|
CGame::currLevel = (eLevelName)ScriptParams[0];
|
|
|
|
if (CGame::currLevel != CCollision::ms_collisionInMemory) {
|
|
|
|
DMAudio.SetEffectsFadeVol(0);
|
|
|
|
CPad::StopPadsShaking();
|
|
|
|
CCollision::LoadCollisionScreen(CGame::currLevel);
|
|
|
|
DMAudio.Service();
|
|
|
|
CPopulation::DealWithZoneChange(CCollision::ms_collisionInMemory, CGame::currLevel, false);
|
|
|
|
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
|
2020-02-23 15:32:28 +00:00
|
|
|
CStreaming::RemoveUnusedBuildings(CGame::currLevel);
|
2020-02-16 20:08:54 +00:00
|
|
|
CCollision::SortOutCollisionAfterLoad();
|
|
|
|
CStreaming::RequestIslands(CGame::currLevel);
|
|
|
|
CStreaming::RequestBigBuildings(CGame::currLevel);
|
|
|
|
CStreaming::LoadAllRequestedModels(true);
|
|
|
|
DMAudio.SetEffectsFadeVol(127);
|
|
|
|
}
|
|
|
|
CTimer::Update();
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_SPLASH_SCREEN:
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, tmp);
|
2020-02-16 20:08:54 +00:00
|
|
|
for (int i = 0; i < KEY_LENGTH_IN_SCRIPT; i++)
|
|
|
|
tmp[i] = tolower(tmp[i]);
|
|
|
|
m_nIp += 8;
|
|
|
|
LoadSplash(tmp);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_IGNORE_LEVEL_TRANSITIONS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
if (ScriptParams[1])
|
2020-04-19 04:14:13 +00:00
|
|
|
pVehicle->m_nZoneLevel = LEVEL_IGNORE;
|
2020-02-16 20:08:54 +00:00
|
|
|
else
|
2020-05-06 10:23:26 +00:00
|
|
|
pVehicle->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pVehicle->GetPosition());
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_MAKE_CRAIGS_CAR_A_BIT_STRONGER:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
|
|
|
script_assert(pVehicle->m_vehType == VEHICLE_TYPE_CAR);
|
2020-02-16 20:08:54 +00:00
|
|
|
CAutomobile* pCar = (CAutomobile*)pVehicle;
|
2020-04-08 12:17:07 +00:00
|
|
|
pCar->bMoreResistantToDamage = ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_JAMES_CAR_ON_PATH_TO_PLAYER:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
2020-04-15 22:19:08 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
2020-02-16 20:08:54 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
CCarCtrl::JoinCarWithRoadSystemGotoCoors(pVehicle, FindPlayerCoors(), false);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOAD_END_OF_GAME_TUNE:
|
2020-04-08 20:50:45 +00:00
|
|
|
DMAudio.ChangeMusicMode(MUSICMODE_CUTSCENE);
|
2020-02-16 20:08:54 +00:00
|
|
|
printf("Start preload end of game audio\n");
|
|
|
|
DMAudio.PreloadCutSceneMusic(STREAMED_SOUND_GAME_COMPLETED);
|
|
|
|
printf("End preload end of game audio\n");
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ENABLE_PLAYER_CONTROL_CAMERA:
|
2020-06-21 13:00:17 +00:00
|
|
|
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_CAMERA);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
#ifndef GTA_PS2
|
|
|
|
// To be precise, on PS2 previous handlers were in 1000-1099 function
|
|
|
|
// These are "beta" VC commands (with bugs)
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_OBJECT_ROTATION:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-02-16 20:08:54 +00:00
|
|
|
CWorld::Remove(pObject);
|
|
|
|
pObject->SetOrientation(
|
|
|
|
DEGTORAD(*(float*)&ScriptParams[1]),
|
|
|
|
DEGTORAD(*(float*)&ScriptParams[2]),
|
|
|
|
DEGTORAD(*(float*)&ScriptParams[3]));
|
|
|
|
pObject->GetMatrix().UpdateRW();
|
|
|
|
pObject->UpdateRwFrame();
|
|
|
|
CWorld::Add(pObject);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_DEBUG_CAMERA_COORDINATES:
|
2020-02-16 20:08:54 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = TheCamera.Cams[2].Source;
|
|
|
|
StoreParameters(&m_nIp, 3);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_DEBUG_CAMERA_FRONT_VECTOR:
|
2020-02-16 20:08:54 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = TheCamera.Cams[2].Front;
|
|
|
|
StoreParameters(&m_nIp, 3);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_TARGETTING_ANY_CHAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
CEntity* pTarget = pPed->m_pPointGunAt;
|
|
|
|
UpdateCompareFlag(pTarget && pTarget->IsPed());
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_TARGETTING_CHAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
CPed* pTestedPed = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTestedPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
CEntity* pTarget = pPed->m_pPointGunAt;
|
|
|
|
UpdateCompareFlag(pTarget && pTarget->IsPed() && pTarget == pTestedPed);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_TARGETTING_OBJECT:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
CObject* pTestedObject = CPools::GetObjectPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTestedObject);
|
2020-02-16 20:08:54 +00:00
|
|
|
CEntity* pTarget = pPed->m_pPointGunAt;
|
|
|
|
UpdateCompareFlag(pTarget && pTarget->IsObject() && pTarget == pTestedObject);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
CTheScripts::ReadTextLabelFromScript(&m_nIp, tmp);
|
2020-02-16 20:08:54 +00:00
|
|
|
for (int i = 0; i < KEY_LENGTH_IN_SCRIPT; i++)
|
|
|
|
tmp[i] = tolower(tmp[i]);
|
|
|
|
m_nIp += 8;
|
|
|
|
CRunningScript* pScript = CTheScripts::pActiveScripts;
|
|
|
|
while (pScript) {
|
|
|
|
CRunningScript* pNext = pScript->next;
|
|
|
|
if (strcmp(pScript->m_abScriptName, tmp) == 0) {
|
|
|
|
pScript->RemoveScriptFromList(&CTheScripts::pActiveScripts);
|
|
|
|
pScript->AddScriptToList(&CTheScripts::pIdleScripts);
|
|
|
|
}
|
|
|
|
pScript = pNext;
|
|
|
|
}
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DISPLAY_TEXT_WITH_NUMBER:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-02-16 20:08:54 +00:00
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_fAtX = *(float*)&ScriptParams[0];
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_fAtY = *(float*)&ScriptParams[1];
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CMessages::InsertNumberInString(text, ScriptParams[0], -1, -1, -1, -1, -1,
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame++].m_Text);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DISPLAY_TEXT_WITH_2_NUMBERS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
2020-03-01 14:42:47 +00:00
|
|
|
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
|
2020-02-16 20:08:54 +00:00
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_fAtX = *(float*)&ScriptParams[0];
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame].m_fAtY = *(float*)&ScriptParams[1];
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CMessages::InsertNumberInString(text, ScriptParams[0], ScriptParams[1], -1, -1, -1, -1,
|
|
|
|
CTheScripts::IntroTextLines[CTheScripts::NumberOfIntroTextLinesThisFrame++].m_Text);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_FAIL_CURRENT_MISSION:
|
2020-02-16 20:08:54 +00:00
|
|
|
CTheScripts::FailCurrentMission = 2;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CLOSEST_OBJECT_OF_TYPE:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-03-04 22:10:09 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2020-02-16 20:08:54 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
float range = *(float*)&ScriptParams[3];
|
|
|
|
int mi = ScriptParams[4] < 0 ? CTheScripts::UsedObjectArray[-ScriptParams[4]].index : ScriptParams[4];
|
|
|
|
int16 total;
|
|
|
|
CEntity* apEntities[16];
|
|
|
|
CWorld::FindObjectsOfTypeInRange(mi, pos, range, true, &total, 16, apEntities, false, false, false, true, true);
|
|
|
|
CEntity* pClosestEntity = nil;
|
|
|
|
float min_dist = 2.0f * range;
|
|
|
|
for (int i = 0; i < total; i++) {
|
|
|
|
float dist = (apEntities[i]->GetPosition() - pos).Magnitude();
|
|
|
|
if (dist < min_dist) {
|
|
|
|
min_dist = dist;
|
|
|
|
pClosestEntity = apEntities[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pClosestEntity && pClosestEntity->IsDummy()) {
|
|
|
|
CPopulation::ConvertToRealObject((CDummyObject*)pClosestEntity);
|
|
|
|
CWorld::FindObjectsOfTypeInRange(mi, pos, range, true, &total, 16, apEntities, false, false, false, true, true);
|
|
|
|
pClosestEntity = nil;
|
|
|
|
float min_dist = 2.0f * range;
|
|
|
|
for (int i = 0; i < total; i++) {
|
|
|
|
float dist = (apEntities[i]->GetPosition() - pos).Magnitude();
|
|
|
|
if (dist < min_dist) {
|
|
|
|
min_dist = dist;
|
|
|
|
pClosestEntity = apEntities[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pClosestEntity->IsDummy())
|
|
|
|
pClosestEntity = nil;
|
|
|
|
}
|
|
|
|
if (pClosestEntity) {
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pClosestEntity->IsObject());
|
2020-02-16 20:08:54 +00:00
|
|
|
CObject* pObject = (CObject*)pClosestEntity;
|
|
|
|
pObject->ObjectCreatedBy = MISSION_OBJECT;
|
|
|
|
ScriptParams[0] = CPools::GetObjectPool()->GetIndex(pObject);
|
|
|
|
} else {
|
|
|
|
ScriptParams[0] = -1;
|
|
|
|
}
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_PLACE_OBJECT_RELATIVE_TO_OBJECT:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pObject);
|
2020-02-16 20:08:54 +00:00
|
|
|
CObject* pTarget = CPools::GetObjectPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTarget);
|
2020-02-16 20:08:54 +00:00
|
|
|
CVector offset = *(CVector*)&ScriptParams[2];
|
|
|
|
CPhysical::PlacePhysicalRelativeToOtherPhysical(pTarget, pObject, offset);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_ALL_OCCUPANTS_OF_CAR_LEAVE_CAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
if (pVehicle->pDriver) {
|
|
|
|
pVehicle->pDriver->bScriptObjectiveCompleted = false;
|
|
|
|
pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle);
|
|
|
|
}
|
2020-02-22 14:53:28 +00:00
|
|
|
for (int i = 0; i < ARRAY_SIZE(pVehicle->pPassengers); i++)
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
if (pVehicle->pPassengers[i]) {
|
|
|
|
pVehicle->pPassengers[i]->bScriptObjectiveCompleted = false;
|
|
|
|
pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle);
|
|
|
|
}
|
|
|
|
}
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_INTERPOLATION_PARAMETERS:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
TheCamera.SetParametersForScriptInterpolation(*(float*)&ScriptParams[0], 50.0f - *(float*)&ScriptParams[0], ScriptParams[1]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CLOSEST_CAR_NODE_WITH_HEADING_TOWARDS_POINT:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-03-04 22:10:09 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2020-02-16 20:08:54 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
float destX = *(float*)&ScriptParams[3];
|
|
|
|
float destY = *(float*)&ScriptParams[4];
|
|
|
|
int32 nid = ThePaths.FindNodeClosestToCoors(pos, 0, 999999.9f, true, true);
|
|
|
|
CPathNode* pNode = &ThePaths.m_pathNodes[nid];
|
2020-05-03 13:57:57 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = pNode->GetPosition();
|
2020-02-16 20:08:54 +00:00
|
|
|
*(float*)&ScriptParams[3] = ThePaths.FindNodeOrientationForCarPlacementFacingDestination(nid, destX, destY, true);
|
|
|
|
StoreParameters(&m_nIp, 4);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CLOSEST_CAR_NODE_WITH_HEADING_AWAY_POINT:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 5);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[0];
|
2020-03-04 22:10:09 +00:00
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
2020-02-16 20:08:54 +00:00
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
float destX = *(float*)&ScriptParams[3];
|
|
|
|
float destY = *(float*)&ScriptParams[4];
|
|
|
|
int32 nid = ThePaths.FindNodeClosestToCoors(pos, 0, 999999.9f, true, true);
|
|
|
|
CPathNode* pNode = &ThePaths.m_pathNodes[nid];
|
2020-05-03 13:57:57 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = pNode->GetPosition();
|
2020-02-16 20:08:54 +00:00
|
|
|
*(float*)&ScriptParams[3] = ThePaths.FindNodeOrientationForCarPlacementFacingDestination(nid, destX, destY, false);
|
|
|
|
StoreParameters(&m_nIp, 4);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_DEBUG_CAMERA_POINT_AT:
|
2020-02-16 20:08:54 +00:00
|
|
|
*(CVector*)&ScriptParams[0] = TheCamera.Cams[2].Source + TheCamera.Cams[2].Front;
|
|
|
|
StoreParameters(&m_nIp, 3);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_ATTACH_CHAR_TO_CAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
// empty implementation
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_DETACH_CHAR_FROM_CAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
// empty implementation
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
case COMMAND_SET_CAR_CHANGE_LANE: // for some reason changed in SA
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
pVehicle->AutoPilot.m_bStayInFastLane = !ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_CHAR_LAST_WEAPON_DAMAGE:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
pPed->m_lastWepDam = -1;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CLEAR_CAR_LAST_WEAPON_DAMAGE:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
|
|
|
pVehicle->m_nLastWeaponDamage = -1;
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_RANDOM_COP_IN_AREA:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 4);
|
|
|
|
int ped_handle = -1;
|
|
|
|
CVector pos = FindPlayerCoors();
|
|
|
|
float x1 = *(float*)&ScriptParams[0];
|
|
|
|
float y1 = *(float*)&ScriptParams[1];
|
|
|
|
float x2 = *(float*)&ScriptParams[2];
|
|
|
|
float y2 = *(float*)&ScriptParams[3];
|
|
|
|
int i = CPools::GetPedPool()->GetSize();
|
|
|
|
while (--i && ped_handle == -1) {
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetSlot(i);
|
|
|
|
if (!pPed)
|
|
|
|
continue;
|
|
|
|
if (CTheScripts::LastRandomPedId == CPools::GetPedPool()->GetIndex(pPed))
|
|
|
|
continue;
|
|
|
|
if (pPed->m_nPedType != PEDTYPE_COP)
|
|
|
|
continue;
|
|
|
|
if (pPed->CharCreatedBy != RANDOM_CHAR)
|
|
|
|
continue;
|
|
|
|
if (!pPed->IsPedInControl() && pPed->GetPedState() != PED_DRIVING)
|
|
|
|
continue;
|
|
|
|
if (pPed->bRemoveFromWorld)
|
|
|
|
continue;
|
|
|
|
if (pPed->bFadeOut)
|
|
|
|
continue;
|
|
|
|
if (pPed->bIsLeader || pPed->m_leader)
|
|
|
|
continue;
|
|
|
|
if (!pPed->IsWithinArea(x1, y1, x2, y2))
|
|
|
|
continue;
|
|
|
|
if (pos.z - PED_FIND_Z_OFFSET > pPed->GetPosition().z)
|
|
|
|
continue;
|
|
|
|
if (pos.z + PED_FIND_Z_OFFSET < pPed->GetPosition().z)
|
|
|
|
continue;
|
|
|
|
ped_handle = CPools::GetPedPool()->GetIndex(pPed);
|
|
|
|
CTheScripts::LastRandomPedId = ped_handle;
|
|
|
|
pPed->CharCreatedBy = MISSION_CHAR;
|
|
|
|
pPed->bRespondsToThreats = false;
|
|
|
|
++CPopulation::ms_nTotalMissionPeds;
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ped_handle, CLEANUP_CHAR);
|
|
|
|
}
|
|
|
|
ScriptParams[0] = ped_handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_RANDOM_COP_IN_ZONE:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
char zone[KEY_LENGTH_IN_SCRIPT];
|
|
|
|
strncpy(zone, (const char*)&CTheScripts::ScriptSpace[m_nIp], KEY_LENGTH_IN_SCRIPT);
|
|
|
|
int nZone = CTheZones::FindZoneByLabelAndReturnIndex(zone);
|
|
|
|
if (nZone != -1)
|
|
|
|
m_nIp += KEY_LENGTH_IN_SCRIPT;
|
|
|
|
CZone* pZone = CTheZones::GetZone(nZone);
|
|
|
|
int ped_handle = -1;
|
|
|
|
CVector pos = FindPlayerCoors();
|
|
|
|
int i = CPools::GetPedPool()->GetSize();
|
|
|
|
while (--i && ped_handle == -1) {
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetSlot(i);
|
|
|
|
if (!pPed)
|
|
|
|
continue;
|
|
|
|
if (CTheScripts::LastRandomPedId == CPools::GetPedPool()->GetIndex(pPed))
|
|
|
|
continue;
|
|
|
|
if (pPed->m_nPedType != PEDTYPE_COP)
|
|
|
|
continue;
|
|
|
|
if (pPed->CharCreatedBy != RANDOM_CHAR)
|
|
|
|
continue;
|
|
|
|
if (!pPed->IsPedInControl() && pPed->GetPedState() != PED_DRIVING)
|
|
|
|
continue;
|
|
|
|
if (pPed->bRemoveFromWorld)
|
|
|
|
continue;
|
|
|
|
if (pPed->bFadeOut)
|
|
|
|
continue;
|
|
|
|
if (pPed->bIsLeader || pPed->m_leader)
|
|
|
|
continue;
|
2020-05-06 10:23:26 +00:00
|
|
|
if (!CTheZones::PointLiesWithinZone(&pPed->GetPosition(), pZone))
|
2020-02-16 20:08:54 +00:00
|
|
|
continue;
|
|
|
|
if (pos.z - PED_FIND_Z_OFFSET > pPed->GetPosition().z)
|
|
|
|
continue;
|
|
|
|
if (pos.z + PED_FIND_Z_OFFSET < pPed->GetPosition().z)
|
|
|
|
continue;
|
|
|
|
ped_handle = CPools::GetPedPool()->GetIndex(pPed);
|
|
|
|
CTheScripts::LastRandomPedId = ped_handle;
|
|
|
|
pPed->CharCreatedBy = MISSION_CHAR;
|
|
|
|
pPed->bRespondsToThreats = false;
|
|
|
|
++CPopulation::ms_nTotalMissionPeds;
|
|
|
|
if (m_bIsMissionScript)
|
|
|
|
CTheScripts::MissionCleanup.AddEntityToList(ped_handle, CLEANUP_CHAR);
|
|
|
|
}
|
|
|
|
ScriptParams[0] = ped_handle;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CHAR_OBJ_FLEE_CAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->SetObjective(OBJECTIVE_FLEE_CAR, pVehicle);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_DRIVER_OF_CAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
CPed* pDriver = pVehicle->pDriver;
|
|
|
|
if (pDriver)
|
|
|
|
ScriptParams[0] = CPools::GetPedPool()->GetIndex(pDriver);
|
|
|
|
else
|
|
|
|
ScriptParams[0] = -1;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_NUMBER_OF_FOLLOWERS:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pLeader = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pLeader);
|
2020-02-16 20:08:54 +00:00
|
|
|
int total = 0;
|
|
|
|
int i = CPools::GetPedPool()->GetSize();
|
|
|
|
while (--i) {
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetSlot(i);
|
|
|
|
if (!pPed)
|
|
|
|
continue;
|
|
|
|
if (pPed->m_leader == pLeader)
|
|
|
|
total++;
|
|
|
|
}
|
|
|
|
ScriptParams[0] = total;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GIVE_REMOTE_CONTROLLED_MODEL_TO_PLAYER:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 6);
|
|
|
|
CVector pos = *(CVector*)&ScriptParams[1];
|
|
|
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
|
|
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
|
|
|
CRemote::GivePlayerRemoteControlledCar(pos.x, pos.y, pos.z, DEGTORAD(*(float*)&ScriptParams[4]), ScriptParams[5]);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CURRENT_PLAYER_WEAPON:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
ScriptParams[0] = pPed->m_weapons[pPed->m_currentWeapon].m_eWeaponType;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_CURRENT_CHAR_WEAPON:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
ScriptParams[0] = pPed->m_weapons[pPed->m_currentWeapon].m_eWeaponType;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_OBJECT_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_OBJECT_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_OBJECT_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_OBJECT_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_OBJECT_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_OBJECT_3D:
|
2020-02-16 20:08:54 +00:00
|
|
|
LocateCharObjectCommand(command, &m_nIp);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
case COMMAND_SET_CAR_HANDBRAKE_TURN_LEFT: // this will be changed in final VC version to a more general SET_TEMP_ACTION
|
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
pVehicle->AutoPilot.m_nTempAction = TEMPACT_HANDBRAKETURNLEFT;
|
|
|
|
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_HANDBRAKE_TURN_RIGHT:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
pVehicle->AutoPilot.m_nTempAction = TEMPACT_HANDBRAKETURNRIGHT;
|
|
|
|
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_CAR_HANDBRAKE_STOP:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-16 20:08:54 +00:00
|
|
|
pVehicle->AutoPilot.m_nTempAction = TEMPACT_HANDBRAKESTRAIGHT;
|
|
|
|
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + ScriptParams[1];
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_ON_ANY_BIKE:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(pPed->bInVehicle&& pPed->m_pMyVehicle->m_vehType == VEHICLE_TYPE_BIKE);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_LOCATE_SNIPER_BULLET_2D:
|
|
|
|
case COMMAND_LOCATE_SNIPER_BULLET_3D:
|
2020-02-16 20:08:54 +00:00
|
|
|
LocateSniperBulletCommand(command, &m_nIp);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_GET_NUMBER_OF_SEATS_IN_MODEL:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
ScriptParams[0] = CVehicleModelInfo::GetMaximumNumberOfPassengersFromNumberOfDoors(ScriptParams[0]) + 1;
|
|
|
|
StoreParameters(&m_nIp, 1);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_PLAYER_ON_ANY_BIKE:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(pPed->bInVehicle && pPed->m_pMyVehicle->m_vehType == VEHICLE_TYPE_BIKE);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_IS_CHAR_LYING_DOWN:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
UpdateCompareFlag(pPed->bFallenDown);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_CAN_CHAR_SEE_DEAD_CHAR:
|
2020-02-16 20:08:54 +00:00
|
|
|
{
|
|
|
|
CollectParameters(&m_nIp, 2);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-16 20:08:54 +00:00
|
|
|
int pedtype = ScriptParams[1];
|
|
|
|
bool can = false;
|
|
|
|
for (int i = 0; i < pPed->m_numNearPeds; i++) {
|
|
|
|
CPed* pTestPed = pPed->m_nearPeds[i];
|
|
|
|
if (pTestPed->m_fHealth <= 0.0f && pTestPed->m_nPedType == pedtype && pPed->OurPedCanSeeThisOne(pTestPed))
|
|
|
|
can = true;
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(can);
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
}
|
2019-11-09 13:44:17 +00:00
|
|
|
case COMMAND_SET_ENTER_CAR_RANGE_MULTIPLIER:
|
2020-02-16 20:08:54 +00:00
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CPed::nEnterCarRangeMultiplier = *(float*)&ScriptParams[0];
|
|
|
|
#else
|
|
|
|
CPed::nEnterCarRangeMultiplier = (float)ScriptParams[0];
|
|
|
|
#endif
|
2020-02-02 11:47:03 +00:00
|
|
|
return 0;
|
2020-04-23 22:01:41 +00:00
|
|
|
#endif
|
|
|
|
#ifndef GTA3_1_1_PATCH
|
|
|
|
case COMMAND_SET_THREAT_REACTION_RANGE_MULTIPLIER:
|
|
|
|
CollectParameters(&m_nIp, 1);
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
CPed::nThreatReactionRangeMultiplier = *(float*)&ScriptParams[0];
|
|
|
|
#else
|
|
|
|
CPed::nThreatReactionRangeMultiplier = (float)ScriptParams[0];
|
|
|
|
#endif
|
|
|
|
return 0;
|
2020-02-16 20:08:54 +00:00
|
|
|
#endif
|
2019-11-09 13:44:17 +00:00
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(0);
|
2019-11-09 13:44:17 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-02-22 23:29:38 +00:00
|
|
|
int32 CTheScripts::GetNewUniqueScriptSphereIndex(int32 index)
|
2019-07-25 20:34:29 +00:00
|
|
|
{
|
2020-03-01 14:42:47 +00:00
|
|
|
if (ScriptSphereArray[index].m_Index >= UINT16_MAX - 1)
|
2020-02-22 23:29:38 +00:00
|
|
|
ScriptSphereArray[index].m_Index = 1;
|
|
|
|
else
|
|
|
|
ScriptSphereArray[index].m_Index++;
|
|
|
|
return (uint16)index | ScriptSphereArray[index].m_Index << 16;
|
2019-07-25 20:34:29 +00:00
|
|
|
}
|
|
|
|
|
2020-02-15 11:53:42 +00:00
|
|
|
int32 CTheScripts::GetActualScriptSphereIndex(int32 index)
|
|
|
|
{
|
|
|
|
if (index == -1)
|
|
|
|
return -1;
|
|
|
|
uint16 check = (uint32)index >> 16;
|
2020-02-15 20:30:51 +00:00
|
|
|
uint16 array_idx = index & (0xFFFF);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(array_idx < ARRAY_SIZE(ScriptSphereArray));
|
2020-02-15 11:53:42 +00:00
|
|
|
if (check != ScriptSphereArray[array_idx].m_Index)
|
|
|
|
return -1;
|
2020-02-15 20:30:51 +00:00
|
|
|
return array_idx;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
|
|
|
|
2020-02-22 23:29:38 +00:00
|
|
|
void CTheScripts::DrawScriptSpheres()
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++) {
|
|
|
|
if (ScriptSphereArray[i].m_bInUse)
|
|
|
|
C3dMarkers::PlaceMarkerSet(ScriptSphereArray[i].m_Id, 4, ScriptSphereArray[i].m_vecCenter, ScriptSphereArray[i].m_fRadius,
|
|
|
|
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A, SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-15 11:53:42 +00:00
|
|
|
int32 CTheScripts::AddScriptSphere(int32 id, CVector pos, float radius)
|
|
|
|
{
|
|
|
|
int16 i = 0;
|
|
|
|
for (i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++) {
|
|
|
|
if (!ScriptSphereArray[i].m_bInUse)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#ifdef FIX_BUGS
|
|
|
|
if (i == MAX_NUM_SCRIPT_SPHERES)
|
|
|
|
return -1;
|
|
|
|
#endif
|
|
|
|
ScriptSphereArray[i].m_bInUse = true;
|
|
|
|
ScriptSphereArray[i].m_Id = id;
|
|
|
|
ScriptSphereArray[i].m_vecCenter = pos;
|
|
|
|
ScriptSphereArray[i].m_fRadius = radius;
|
|
|
|
return GetNewUniqueScriptSphereIndex(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::RemoveScriptSphere(int32 index)
|
|
|
|
{
|
|
|
|
index = GetActualScriptSphereIndex(index);
|
|
|
|
if (index == -1)
|
|
|
|
return;
|
|
|
|
ScriptSphereArray[index].m_bInUse = false;
|
|
|
|
ScriptSphereArray[index].m_Id = 0;
|
|
|
|
}
|
|
|
|
|
2020-02-22 23:29:38 +00:00
|
|
|
void CTheScripts::AddToBuildingSwapArray(CBuilding* pBuilding, int32 old_model, int32 new_model)
|
2019-10-12 19:00:31 +00:00
|
|
|
{
|
2020-02-22 23:29:38 +00:00
|
|
|
int i = 0;
|
|
|
|
bool found = false;
|
|
|
|
while (i < MAX_NUM_BUILDING_SWAPS && !found) {
|
|
|
|
if (BuildingSwapArray[i].m_pBuilding == pBuilding)
|
|
|
|
found = true;
|
|
|
|
else
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
if (found) {
|
|
|
|
if (BuildingSwapArray[i].m_nOldModel == new_model) {
|
|
|
|
BuildingSwapArray[i].m_pBuilding = nil;
|
|
|
|
BuildingSwapArray[i].m_nOldModel = BuildingSwapArray[i].m_nNewModel = -1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
BuildingSwapArray[i].m_nNewModel = new_model;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
i = 0;
|
|
|
|
while (i < MAX_NUM_BUILDING_SWAPS && !found) {
|
|
|
|
if (BuildingSwapArray[i].m_pBuilding == nil)
|
|
|
|
found = true;
|
|
|
|
else
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
if (found) {
|
|
|
|
BuildingSwapArray[i].m_pBuilding = pBuilding;
|
|
|
|
BuildingSwapArray[i].m_nNewModel = new_model;
|
|
|
|
BuildingSwapArray[i].m_nOldModel = old_model;
|
|
|
|
}
|
|
|
|
}
|
2019-10-12 19:00:31 +00:00
|
|
|
}
|
|
|
|
|
2020-01-03 16:48:13 +00:00
|
|
|
void CTheScripts::AddToInvisibilitySwapArray(CEntity* pEntity, bool remove)
|
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
bool found = false;
|
2020-01-03 22:10:35 +00:00
|
|
|
while (i < MAX_NUM_INVISIBILITY_SETTINGS && !found) {
|
2020-01-03 16:48:13 +00:00
|
|
|
if (InvisibilitySettingArray[i] == pEntity)
|
|
|
|
found = true;
|
|
|
|
else
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
if (found) {
|
|
|
|
if (remove)
|
|
|
|
InvisibilitySettingArray[i] = nil;
|
|
|
|
}
|
|
|
|
else if (!remove) {
|
2020-02-01 13:10:46 +00:00
|
|
|
i = 0;
|
2020-01-03 22:10:35 +00:00
|
|
|
while (i < MAX_NUM_INVISIBILITY_SETTINGS && !found) {
|
2020-01-03 16:48:13 +00:00
|
|
|
if (InvisibilitySettingArray[i] == nil)
|
2020-01-03 22:10:35 +00:00
|
|
|
found = true;
|
2020-01-03 16:48:13 +00:00
|
|
|
else
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
if (found)
|
|
|
|
InvisibilitySettingArray[i] = pEntity;
|
|
|
|
}
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2020-01-03 16:48:13 +00:00
|
|
|
|
2020-02-24 09:10:21 +00:00
|
|
|
void CTheScripts::UndoBuildingSwaps()
|
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) {
|
|
|
|
if (BuildingSwapArray[i].m_pBuilding) {
|
|
|
|
BuildingSwapArray[i].m_pBuilding->ReplaceWithNewModel(BuildingSwapArray[i].m_nOldModel);
|
|
|
|
BuildingSwapArray[i].m_pBuilding = nil;
|
|
|
|
BuildingSwapArray[i].m_nOldModel = BuildingSwapArray[i].m_nNewModel = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-28 20:55:23 +00:00
|
|
|
void CTheScripts::UndoEntityInvisibilitySettings()
|
2020-02-24 09:10:21 +00:00
|
|
|
{
|
|
|
|
for (int i = 0; i < MAX_NUM_INVISIBILITY_SETTINGS; i++) {
|
|
|
|
if (InvisibilitySettingArray[i]) {
|
|
|
|
InvisibilitySettingArray[i]->bIsVisible = true;
|
|
|
|
InvisibilitySettingArray[i] = nil;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-02-22 23:29:38 +00:00
|
|
|
|
|
|
|
void CRunningScript::UpdateCompareFlag(bool flag)
|
2020-02-15 11:53:42 +00:00
|
|
|
{
|
2020-02-22 23:29:38 +00:00
|
|
|
if (m_bNotFlag)
|
|
|
|
flag = !flag;
|
|
|
|
if (m_nAndOrState == ANDOR_NONE) {
|
|
|
|
m_bCondResult = flag;
|
|
|
|
return;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2020-02-22 23:29:38 +00:00
|
|
|
if (m_nAndOrState >= ANDS_1 && m_nAndOrState <= ANDS_8) {
|
|
|
|
m_bCondResult &= flag;
|
|
|
|
if (m_nAndOrState == ANDS_1) {
|
|
|
|
m_nAndOrState = ANDOR_NONE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (m_nAndOrState >= ORS_1 && m_nAndOrState <= ORS_8) {
|
|
|
|
m_bCondResult |= flag;
|
|
|
|
if (m_nAndOrState == ORS_1) {
|
|
|
|
m_nAndOrState = ANDOR_NONE;
|
|
|
|
return;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2020-02-22 23:29:38 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
m_nAndOrState--;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::LocatePlayerCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug, decided = false;
|
|
|
|
float X, Y, Z, dX, dY, dZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ON_FOOT_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_IN_CAR_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 8 : 6);
|
|
|
|
CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]];
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_IN_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_IN_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ON_FOOT_3D:
|
|
|
|
if (!CTheScripts::IsPlayerStopped(pPlayerInfo)) {
|
|
|
|
result = false;
|
|
|
|
decided = true;
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
2020-02-22 23:29:38 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
X = *(float*)&ScriptParams[1];
|
|
|
|
Y = *(float*)&ScriptParams[2];
|
|
|
|
if (b3D) {
|
|
|
|
Z = *(float*)&ScriptParams[3];
|
|
|
|
dX = *(float*)&ScriptParams[4];
|
|
|
|
dY = *(float*)&ScriptParams[5];
|
|
|
|
dZ = *(float*)&ScriptParams[6];
|
|
|
|
debug = ScriptParams[7];
|
|
|
|
} else {
|
|
|
|
dX = *(float*)&ScriptParams[3];
|
|
|
|
dY = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
if (!decided) {
|
|
|
|
CVector pos = pPlayerInfo->GetPos();
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y &&
|
|
|
|
Z - dZ <= pos.z &&
|
|
|
|
Z + dZ >= pos.z;
|
|
|
|
} else {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y;
|
|
|
|
}
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ANY_MEANS_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_ON_FOOT_3D:
|
|
|
|
result = !pPlayerInfo->m_pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_IN_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_PLAYER_IN_CAR_3D:
|
|
|
|
result = pPlayerInfo->m_pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-22 23:29:38 +00:00
|
|
|
break;
|
|
|
|
}
|
2020-02-15 11:53:42 +00:00
|
|
|
}
|
|
|
|
}
|
2020-02-22 23:29:38 +00:00
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dY, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-22 23:29:38 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(X - dX, Y - dY, Z - dZ, X + dX, Y + dY, Z + dZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(X - dX, Y - dY, X + dX, Y + dY);
|
|
|
|
}
|
2020-01-03 16:48:13 +00:00
|
|
|
}
|
|
|
|
|
2020-02-24 09:10:21 +00:00
|
|
|
void CRunningScript::LocatePlayerCharCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug;
|
|
|
|
float X, Y, Z, dX, dY, dZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_CHAR_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_CHAR_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_CHAR_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 6 : 5);
|
|
|
|
CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]];
|
|
|
|
CPed* pTarget = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTarget);
|
2020-02-24 09:10:21 +00:00
|
|
|
CVector pos = pPlayerInfo->GetPos();
|
|
|
|
if (pTarget->bInVehicle) {
|
|
|
|
X = pTarget->m_pMyVehicle->GetPosition().x;
|
|
|
|
Y = pTarget->m_pMyVehicle->GetPosition().y;
|
|
|
|
Z = pTarget->m_pMyVehicle->GetPosition().z;
|
|
|
|
} else {
|
|
|
|
X = pTarget->GetPosition().x;
|
|
|
|
Y = pTarget->GetPosition().y;
|
|
|
|
Z = pTarget->GetPosition().z;
|
|
|
|
}
|
|
|
|
dX = *(float*)&ScriptParams[2];
|
|
|
|
dY = *(float*)&ScriptParams[3];
|
|
|
|
if (b3D) {
|
|
|
|
dZ = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
else {
|
2020-02-24 18:17:15 +00:00
|
|
|
debug = ScriptParams[4];
|
2020-02-24 09:10:21 +00:00
|
|
|
}
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y &&
|
|
|
|
Z - dZ <= pos.z &&
|
|
|
|
Z + dZ >= pos.z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y;
|
|
|
|
}
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_CHAR_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_CHAR_3D:
|
|
|
|
result = !pPlayerInfo->m_pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_CHAR_3D:
|
|
|
|
result = pPlayerInfo->m_pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-24 09:10:21 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
|
|
|
#ifdef FIX_BUGS
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dY, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-24 09:10:21 +00:00
|
|
|
#else
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dX, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-24 09:10:21 +00:00
|
|
|
#endif
|
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(X - dX, Y - dY, Z - dZ, X + dX, Y + dY, Z + dZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(X - dX, Y - dY, X + dX, Y + dY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::LocatePlayerCarCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug;
|
|
|
|
float X, Y, Z, dX, dY, dZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_CAR_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 6 : 5);
|
|
|
|
CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]];
|
|
|
|
CVehicle* pTarget = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTarget);
|
2020-02-24 09:10:21 +00:00
|
|
|
CVector pos = pPlayerInfo->GetPos();
|
|
|
|
X = pTarget->GetPosition().x;
|
|
|
|
Y = pTarget->GetPosition().y;
|
|
|
|
Z = pTarget->GetPosition().z;
|
|
|
|
dX = *(float*)&ScriptParams[2];
|
|
|
|
dY = *(float*)&ScriptParams[3];
|
|
|
|
if (b3D) {
|
|
|
|
dZ = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
debug = ScriptParams[4];
|
|
|
|
}
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y &&
|
|
|
|
Z - dZ <= pos.z &&
|
|
|
|
Z + dZ >= pos.z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y;
|
|
|
|
}
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ANY_MEANS_CAR_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_ON_FOOT_CAR_3D:
|
|
|
|
result = !pPlayerInfo->m_pPed->bInVehicle;
|
|
|
|
break;
|
2020-04-15 21:31:57 +00:00
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_PLAYER_IN_CAR_CAR_3D:
|
2020-02-24 09:10:21 +00:00
|
|
|
result = pPlayerInfo->m_pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-24 09:10:21 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dY, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-24 09:10:21 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(X - dX, Y - dY, Z - dZ, X + dX, Y + dY, Z + dZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(X - dX, Y - dY, X + dX, Y + dY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::LocateCharCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug, decided = false;
|
|
|
|
float X, Y, Z, dX, dY, dZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ON_FOOT_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_IN_CAR_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 8 : 6);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-24 09:10:21 +00:00
|
|
|
CVector pos = pPed->bInVehicle ? pPed->m_pMyVehicle->GetPosition() : pPed->GetPosition();
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_IN_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_IN_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ON_FOOT_3D:
|
|
|
|
if (!CTheScripts::IsPedStopped(pPed)) {
|
|
|
|
result = false;
|
|
|
|
decided = true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
X = *(float*)&ScriptParams[1];
|
|
|
|
Y = *(float*)&ScriptParams[2];
|
|
|
|
if (b3D) {
|
|
|
|
Z = *(float*)&ScriptParams[3];
|
|
|
|
dX = *(float*)&ScriptParams[4];
|
|
|
|
dY = *(float*)&ScriptParams[5];
|
|
|
|
dZ = *(float*)&ScriptParams[6];
|
|
|
|
debug = ScriptParams[7];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dX = *(float*)&ScriptParams[3];
|
|
|
|
dY = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
if (!decided) {
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y &&
|
|
|
|
Z - dZ <= pos.z &&
|
|
|
|
Z + dZ >= pos.z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y;
|
|
|
|
}
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ANY_MEANS_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ON_FOOT_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_ON_FOOT_3D:
|
|
|
|
result = !pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_IN_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CHAR_IN_CAR_3D:
|
|
|
|
result = pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-24 09:10:21 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dY, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-24 09:10:21 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(X - dX, Y - dY, Z - dZ, X + dX, Y + dY, Z + dZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(X - dX, Y - dY, X + dX, Y + dY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::LocateCharCharCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug;
|
|
|
|
float X, Y, Z, dX, dY, dZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_CHAR_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_CHAR_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_CHAR_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 6 : 5);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-24 09:10:21 +00:00
|
|
|
CPed* pTarget = CPools::GetPedPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTarget);
|
2020-02-24 09:10:21 +00:00
|
|
|
CVector pos = pPed->bInVehicle ? pPed->m_pMyVehicle->GetPosition() : pPed->GetPosition();
|
|
|
|
if (pTarget->bInVehicle) {
|
|
|
|
X = pTarget->m_pMyVehicle->GetPosition().x;
|
|
|
|
Y = pTarget->m_pMyVehicle->GetPosition().y;
|
|
|
|
Z = pTarget->m_pMyVehicle->GetPosition().z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
X = pTarget->GetPosition().x;
|
|
|
|
Y = pTarget->GetPosition().y;
|
|
|
|
Z = pTarget->GetPosition().z;
|
|
|
|
}
|
|
|
|
dX = *(float*)&ScriptParams[2];
|
|
|
|
dY = *(float*)&ScriptParams[3];
|
|
|
|
if (b3D) {
|
|
|
|
dZ = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
debug = ScriptParams[4];
|
|
|
|
}
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y &&
|
|
|
|
Z - dZ <= pos.z &&
|
|
|
|
Z + dZ >= pos.z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y;
|
|
|
|
}
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_CHAR_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_CHAR_3D:
|
|
|
|
result = !pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_CHAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_CHAR_3D:
|
|
|
|
result = pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-24 09:10:21 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
|
|
|
#ifdef FIX_BUGS
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dY, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-24 09:10:21 +00:00
|
|
|
#else
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dX, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-24 09:10:21 +00:00
|
|
|
#endif
|
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(X - dX, Y - dY, Z - dZ, X + dX, Y + dY, Z + dZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(X - dX, Y - dY, X + dX, Y + dY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::LocateCharCarCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug;
|
|
|
|
float X, Y, Z, dX, dY, dZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_CAR_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 6 : 5);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-24 09:10:21 +00:00
|
|
|
CVehicle* pTarget = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTarget);
|
2020-02-24 09:10:21 +00:00
|
|
|
CVector pos = pPed->bInVehicle ? pPed->m_pMyVehicle->GetPosition() : pPed->GetPosition();
|
|
|
|
X = pTarget->GetPosition().x;
|
|
|
|
Y = pTarget->GetPosition().y;
|
|
|
|
Z = pTarget->GetPosition().z;
|
|
|
|
dX = *(float*)&ScriptParams[2];
|
|
|
|
dY = *(float*)&ScriptParams[3];
|
|
|
|
if (b3D) {
|
|
|
|
dZ = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
debug = ScriptParams[4];
|
|
|
|
}
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y &&
|
|
|
|
Z - dZ <= pos.z &&
|
|
|
|
Z + dZ >= pos.z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y;
|
|
|
|
}
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_CAR_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_CAR_3D:
|
|
|
|
result = !pPed->bInVehicle;
|
|
|
|
break;
|
2020-05-27 22:00:49 +00:00
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_CAR_3D:
|
2020-02-24 09:10:21 +00:00
|
|
|
result = pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-24 09:10:21 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dY, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-24 09:10:21 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(X - dX, Y - dY, Z - dZ, X + dX, Y + dY, Z + dZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(X - dX, Y - dY, X + dX, Y + dY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::LocateCharObjectCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug;
|
|
|
|
float X, Y, Z, dX, dY, dZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_OBJECT_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_OBJECT_3D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_OBJECT_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 6 : 5);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-24 09:10:21 +00:00
|
|
|
CObject* pTarget = CPools::GetObjectPool()->GetAt(ScriptParams[1]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pTarget);
|
2020-02-24 09:10:21 +00:00
|
|
|
CVector pos = pPed->bInVehicle ? pPed->m_pMyVehicle->GetPosition() : pPed->GetPosition();
|
|
|
|
X = pTarget->GetPosition().x;
|
|
|
|
Y = pTarget->GetPosition().y;
|
|
|
|
Z = pTarget->GetPosition().z;
|
|
|
|
dX = *(float*)&ScriptParams[2];
|
|
|
|
dY = *(float*)&ScriptParams[3];
|
|
|
|
if (b3D) {
|
|
|
|
dZ = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
debug = ScriptParams[4];
|
|
|
|
}
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y &&
|
|
|
|
Z - dZ <= pos.z &&
|
|
|
|
Z + dZ >= pos.z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y;
|
|
|
|
}
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_OBJECT_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ANY_MEANS_OBJECT_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_OBJECT_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_ON_FOOT_OBJECT_3D:
|
|
|
|
result = !pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_OBJECT_2D:
|
|
|
|
case COMMAND_LOCATE_CHAR_IN_CAR_OBJECT_3D:
|
|
|
|
result = pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-24 09:10:21 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dY, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-24 09:10:21 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(X - dX, Y - dY, Z - dZ, X + dX, Y + dY, Z + dZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(X - dX, Y - dY, X + dX, Y + dY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::LocateCarCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug, decided = false;
|
|
|
|
float X, Y, Z, dX, dY, dZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_CAR_3D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CAR_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 8 : 6);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-24 09:10:21 +00:00
|
|
|
CVector pos = pVehicle->GetPosition();
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_STOPPED_CAR_2D:
|
|
|
|
case COMMAND_LOCATE_STOPPED_CAR_3D:
|
|
|
|
if (!CTheScripts::IsVehicleStopped(pVehicle)) {
|
|
|
|
result = false;
|
|
|
|
decided = true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
X = *(float*)&ScriptParams[1];
|
|
|
|
Y = *(float*)&ScriptParams[2];
|
|
|
|
if (b3D) {
|
|
|
|
Z = *(float*)&ScriptParams[3];
|
|
|
|
dX = *(float*)&ScriptParams[4];
|
|
|
|
dY = *(float*)&ScriptParams[5];
|
|
|
|
dZ = *(float*)&ScriptParams[6];
|
|
|
|
debug = ScriptParams[7];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dX = *(float*)&ScriptParams[3];
|
|
|
|
dY = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
if (!decided) {
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y &&
|
|
|
|
Z - dZ <= pos.z &&
|
|
|
|
Z + dZ >= pos.z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
in_area = X - dX <= pos.x &&
|
|
|
|
X + dX >= pos.x &&
|
|
|
|
Y - dY <= pos.y &&
|
|
|
|
Y + dY >= pos.y;
|
|
|
|
}
|
|
|
|
result = in_area;
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dY, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-24 09:10:21 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(X - dX, Y - dY, Z - dZ, X + dX, Y + dY, Z + dZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(X - dX, Y - dY, X + dX, Y + dY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::LocateSniperBulletCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug;
|
|
|
|
float X, Y, Z, dX, dY, dZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_LOCATE_SNIPER_BULLET_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 7 : 5);
|
|
|
|
X = *(float*)&ScriptParams[0];
|
|
|
|
Y = *(float*)&ScriptParams[1];
|
|
|
|
if (b3D) {
|
|
|
|
Z = *(float*)&ScriptParams[2];
|
|
|
|
dX = *(float*)&ScriptParams[3];
|
|
|
|
dY = *(float*)&ScriptParams[4];
|
|
|
|
dZ = *(float*)&ScriptParams[5];
|
|
|
|
debug = ScriptParams[6];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dX = *(float*)&ScriptParams[2];
|
|
|
|
dY = *(float*)&ScriptParams[3];
|
|
|
|
debug = ScriptParams[4];
|
|
|
|
}
|
|
|
|
result = CBulletInfo::TestForSniperBullet(X - dX, X + dX, Y - dY, Y + dY, b3D ? Z - dZ : -1000.0f, b3D ? Z + dZ : 1000.0f);
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, X - dX, Y - dY, X + dX, Y + dY, b3D ? Z : MAP_Z_LOW_LIMIT);
|
2020-02-24 09:10:21 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(X - dX, Y - dY, Z - dZ, X + dX, Y + dY, Z + dZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(X - dX, Y - dY, X + dX, Y + dY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-24 18:17:15 +00:00
|
|
|
void CRunningScript::PlayerInAreaCheckCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug, decided = false;
|
|
|
|
float infX, infY, infZ, supX, supY, supZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 8 : 6);
|
|
|
|
CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]];
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_IN_CAR_2D:
|
|
|
|
if (!CTheScripts::IsPlayerStopped(pPlayerInfo)) {
|
|
|
|
result = false;
|
|
|
|
decided = true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
infX = *(float*)&ScriptParams[1];
|
|
|
|
infY = *(float*)&ScriptParams[2];
|
|
|
|
if (b3D) {
|
|
|
|
infZ = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[6];
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[6];
|
|
|
|
supZ = *(float*)&ScriptParams[3];
|
|
|
|
}
|
|
|
|
debug = ScriptParams[7];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
supX = *(float*)&ScriptParams[3];
|
|
|
|
supY = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
if (infX > supX) {
|
|
|
|
float tmp = infX;
|
|
|
|
infX = supX;
|
|
|
|
supX = tmp;
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
float tmp = infY;
|
|
|
|
infY = supY;
|
|
|
|
supY = tmp;
|
|
|
|
}
|
|
|
|
if (!decided) {
|
|
|
|
CVector pos = pPlayerInfo->GetPos();
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = infX <= pos.x &&
|
|
|
|
supX >= pos.x &&
|
|
|
|
infY <= pos.y &&
|
|
|
|
supY >= pos.y &&
|
|
|
|
infZ <= pos.z &&
|
|
|
|
supZ >= pos.z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
in_area = infX <= pos.x &&
|
|
|
|
supX >= pos.x &&
|
|
|
|
infY <= pos.y &&
|
|
|
|
supY >= pos.y;
|
|
|
|
}
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_ON_FOOT_3D:
|
|
|
|
result = !pPlayerInfo->m_pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_AREA_IN_CAR_3D:
|
|
|
|
result = pPlayerInfo->m_pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-24 18:17:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, infX, infY, supX, supY, b3D ? (infZ + supZ) / 2 : MAP_Z_LOW_LIMIT);
|
2020-02-24 18:17:15 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(infX, infY, infZ, supX, supY, supZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(infX, infY, supX, supY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::PlayerInAngledAreaCheckCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug, decided = false;
|
|
|
|
float infX, infY, infZ, supX, supY, supZ, side2length;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_IN_CAR_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 9 : 7);
|
|
|
|
CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]];
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_IN_CAR_2D:
|
|
|
|
if (!CTheScripts::IsPlayerStopped(pPlayerInfo)) {
|
|
|
|
result = false;
|
|
|
|
decided = true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
infX = *(float*)&ScriptParams[1];
|
|
|
|
infY = *(float*)&ScriptParams[2];
|
|
|
|
if (b3D) {
|
|
|
|
infZ = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[6];
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[6];
|
|
|
|
supZ = *(float*)&ScriptParams[3];
|
|
|
|
}
|
|
|
|
side2length = *(float*)&ScriptParams[7];
|
|
|
|
debug = ScriptParams[8];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
supX = *(float*)&ScriptParams[3];
|
|
|
|
supY = *(float*)&ScriptParams[4];
|
|
|
|
side2length = *(float*)&ScriptParams[5];
|
|
|
|
debug = ScriptParams[6];
|
|
|
|
}
|
|
|
|
float initAngle = CGeneral::GetRadianAngleBetweenPoints(infX, infY, supX, supY) + HALFPI;
|
|
|
|
while (initAngle < 0.0f)
|
|
|
|
initAngle += TWOPI;
|
|
|
|
while (initAngle > TWOPI)
|
|
|
|
initAngle -= TWOPI;
|
|
|
|
// it looks like the idea is to use a rectangle using the diagonal of the rectangle as
|
|
|
|
// the side of new rectangle, with "length" being the length of second side
|
|
|
|
float rotatedSupX = supX + side2length * sin(initAngle);
|
|
|
|
float rotatedSupY = supY - side2length * cos(initAngle);
|
|
|
|
float rotatedInfX = infX + side2length * sin(initAngle);
|
|
|
|
float rotatedInfY = infY - side2length * cos(initAngle);
|
|
|
|
float side1X = supX - infX;
|
|
|
|
float side1Y = supY - infY;
|
|
|
|
float side1Length = CVector2D(side1X, side1Y).Magnitude();
|
|
|
|
float side2X = rotatedInfX - infX;
|
|
|
|
float side2Y = rotatedInfY - infY;
|
|
|
|
float side2Length = CVector2D(side2X, side2Y).Magnitude(); // == side2length?
|
|
|
|
if (!decided) {
|
|
|
|
CVector pos = pPlayerInfo->GetPos();
|
|
|
|
result = false;
|
|
|
|
float X = pos.x - infX;
|
|
|
|
float Y = pos.y - infY;
|
|
|
|
float positionAlongSide1 = X * side1X / side1Length + Y * side1Y / side1Length;
|
|
|
|
bool in_area = false;
|
|
|
|
if (positionAlongSide1 >= 0.0f && positionAlongSide1 <= side1Length) {
|
|
|
|
float positionAlongSide2 = X * side2X / side2Length + Y * side2Y / side2Length;
|
|
|
|
if (positionAlongSide2 >= 0.0f && positionAlongSide2 <= side2Length) {
|
|
|
|
in_area = !b3D || pos.z >= infZ && pos.z <= supZ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_ON_FOOT_3D:
|
|
|
|
result = !pPlayerInfo->m_pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_PLAYER_IN_ANGLED_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_PLAYER_STOPPED_IN_ANGLED_AREA_IN_CAR_3D:
|
|
|
|
result = pPlayerInfo->m_pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-24 18:17:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantAngledArea((uintptr)this + m_nIp, infX, infY, supX, supY,
|
2020-03-04 22:10:09 +00:00
|
|
|
rotatedSupX, rotatedSupY, rotatedInfX, rotatedInfY, b3D ? (infZ + supZ) / 2 : MAP_Z_LOW_LIMIT);
|
2020-02-24 18:17:15 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugAngledCube(infX, infY, infZ, supX, supY, supZ,
|
|
|
|
rotatedSupX, rotatedSupY, rotatedInfX, rotatedInfY);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugAngledSquare(infX, infY, supX, supY,
|
|
|
|
rotatedSupX, rotatedSupY, rotatedInfX, rotatedInfY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::CharInAreaCheckCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug, decided = false;
|
|
|
|
float infX, infY, infZ, supX, supY, supZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_IN_CAR_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 8 : 6);
|
|
|
|
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pPed);
|
2020-02-24 18:17:15 +00:00
|
|
|
CVector pos = pPed->bInVehicle ? pPed->m_pMyVehicle->GetPosition() : pPed->GetPosition();
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_IN_CAR_2D:
|
|
|
|
if (!CTheScripts::IsPedStopped(pPed)) {
|
|
|
|
result = false;
|
|
|
|
decided = true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
infX = *(float*)&ScriptParams[1];
|
|
|
|
infY = *(float*)&ScriptParams[2];
|
|
|
|
if (b3D) {
|
|
|
|
infZ = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[6];
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[6];
|
|
|
|
supZ = *(float*)&ScriptParams[3];
|
|
|
|
}
|
|
|
|
debug = ScriptParams[7];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
supX = *(float*)&ScriptParams[3];
|
|
|
|
supY = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
if (infX > supX) {
|
|
|
|
float tmp = infX;
|
|
|
|
infX = supX;
|
|
|
|
supX = tmp;
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
float tmp = infY;
|
|
|
|
infY = supY;
|
|
|
|
supY = tmp;
|
|
|
|
}
|
|
|
|
if (!decided) {
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = infX <= pos.x &&
|
|
|
|
supX >= pos.x &&
|
|
|
|
infY <= pos.y &&
|
|
|
|
supY >= pos.y &&
|
|
|
|
infZ <= pos.z &&
|
|
|
|
supZ >= pos.z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
in_area = infX <= pos.x &&
|
|
|
|
supX >= pos.x &&
|
|
|
|
infY <= pos.y &&
|
|
|
|
supY >= pos.y;
|
|
|
|
}
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_ON_FOOT_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_2D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_ON_FOOT_3D:
|
|
|
|
result = !pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_CHAR_IN_AREA_IN_CAR_3D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_IN_CAR_2D:
|
|
|
|
case COMMAND_IS_CHAR_STOPPED_IN_AREA_IN_CAR_3D:
|
|
|
|
result = pPed->bInVehicle;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-24 18:17:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, infX, infY, supX, supY, b3D ? (infZ + supZ) / 2 : MAP_Z_LOW_LIMIT);
|
2020-02-24 18:17:15 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(infX, infY, infZ, supX, supY, supZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(infX, infY, supX, supY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::CarInAreaCheckCommand(int32 command, uint32* pIp)
|
|
|
|
{
|
|
|
|
bool b3D, result, debug, decided = false;
|
|
|
|
float infX, infY, infZ, supX, supY, supZ;
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_CAR_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_CAR_STOPPED_IN_AREA_3D:
|
|
|
|
b3D = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
b3D = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
CollectParameters(pIp, b3D ? 8 : 6);
|
|
|
|
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(pVehicle);
|
2020-02-24 18:17:15 +00:00
|
|
|
CVector pos = pVehicle->GetPosition();
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_CAR_STOPPED_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_CAR_STOPPED_IN_AREA_2D:
|
|
|
|
if (!CTheScripts::IsVehicleStopped(pVehicle)) {
|
|
|
|
result = false;
|
|
|
|
decided = true;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
infX = *(float*)&ScriptParams[1];
|
|
|
|
infY = *(float*)&ScriptParams[2];
|
|
|
|
if (b3D) {
|
|
|
|
infZ = *(float*)&ScriptParams[3];
|
|
|
|
supX = *(float*)&ScriptParams[4];
|
|
|
|
supY = *(float*)&ScriptParams[5];
|
|
|
|
supZ = *(float*)&ScriptParams[6];
|
|
|
|
if (infZ > supZ) {
|
|
|
|
infZ = *(float*)&ScriptParams[6];
|
|
|
|
supZ = *(float*)&ScriptParams[3];
|
|
|
|
}
|
|
|
|
debug = ScriptParams[7];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
supX = *(float*)&ScriptParams[3];
|
|
|
|
supY = *(float*)&ScriptParams[4];
|
|
|
|
debug = ScriptParams[5];
|
|
|
|
}
|
|
|
|
if (infX > supX) {
|
|
|
|
float tmp = infX;
|
|
|
|
infX = supX;
|
|
|
|
supX = tmp;
|
|
|
|
}
|
|
|
|
if (infY > supY) {
|
|
|
|
float tmp = infY;
|
|
|
|
infY = supY;
|
|
|
|
supY = tmp;
|
|
|
|
}
|
|
|
|
if (!decided) {
|
|
|
|
result = false;
|
|
|
|
bool in_area;
|
|
|
|
if (b3D) {
|
|
|
|
in_area = infX <= pos.x &&
|
|
|
|
supX >= pos.x &&
|
|
|
|
infY <= pos.y &&
|
|
|
|
supY >= pos.y &&
|
|
|
|
infZ <= pos.z &&
|
|
|
|
supZ >= pos.z;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
in_area = infX <= pos.x &&
|
|
|
|
supX >= pos.x &&
|
|
|
|
infY <= pos.y &&
|
|
|
|
supY >= pos.y;
|
|
|
|
}
|
|
|
|
if (in_area) {
|
|
|
|
switch (command) {
|
|
|
|
case COMMAND_IS_CAR_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_CAR_IN_AREA_3D:
|
|
|
|
case COMMAND_IS_CAR_STOPPED_IN_AREA_2D:
|
|
|
|
case COMMAND_IS_CAR_STOPPED_IN_AREA_3D:
|
|
|
|
result = true;
|
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-02-24 18:17:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
UpdateCompareFlag(result);
|
|
|
|
if (debug)
|
2020-05-11 02:55:57 +00:00
|
|
|
CTheScripts::HighlightImportantArea((uintptr)this + m_nIp, infX, infY, supX, supY, b3D ? (infZ + supZ) / 2 : MAP_Z_LOW_LIMIT);
|
2020-02-24 18:17:15 +00:00
|
|
|
if (CTheScripts::DbgFlag) {
|
|
|
|
if (b3D)
|
|
|
|
CTheScripts::DrawDebugCube(infX, infY, infZ, supX, supY, supZ);
|
|
|
|
else
|
|
|
|
CTheScripts::DrawDebugSquare(infX, infY, supX, supY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::DoDeatharrestCheck()
|
|
|
|
{
|
|
|
|
if (!m_bDeatharrestEnabled)
|
|
|
|
return;
|
|
|
|
if (!CTheScripts::IsPlayerOnAMission())
|
|
|
|
return;
|
|
|
|
CPlayerInfo* pPlayer = &CWorld::Players[CWorld::PlayerInFocus];
|
|
|
|
if (!pPlayer->IsRestartingAfterDeath() && !pPlayer->IsRestartingAfterArrest() && !CTheScripts::UpsideDownCars.AreAnyCarsUpsideDown())
|
|
|
|
return;
|
2020-05-26 21:25:12 +00:00
|
|
|
#ifdef MISSION_REPLAY
|
|
|
|
if (AllowMissionReplay != 0)
|
|
|
|
return;
|
|
|
|
if (CanAllowMissionReplay())
|
|
|
|
AllowMissionReplay = 1;
|
|
|
|
#endif
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(m_nStackPointer > 0);
|
2020-02-24 18:17:15 +00:00
|
|
|
while (m_nStackPointer > 1)
|
|
|
|
--m_nStackPointer;
|
|
|
|
m_nIp = m_anStack[--m_nStackPointer];
|
|
|
|
int16 messageId;
|
|
|
|
if (pPlayer->IsRestartingAfterDeath())
|
|
|
|
messageId = 0;
|
|
|
|
else if (pPlayer->IsRestartingAfterArrest())
|
|
|
|
messageId = 5;
|
|
|
|
else
|
|
|
|
messageId = 10;
|
|
|
|
messageId += CGeneral::GetRandomNumberInRange(0, 5);
|
|
|
|
bool found = false;
|
|
|
|
for (int16 contact = 0; !found && contact < MAX_NUM_CONTACTS; contact++) {
|
|
|
|
int contactFlagOffset = CTheScripts::OnAMissionForContactFlag[contact];
|
|
|
|
if (contactFlagOffset && CTheScripts::ScriptSpace[contactFlagOffset] == 1) {
|
|
|
|
messageId += CTheScripts::BaseBriefIdForContact[contact];
|
2020-04-05 23:01:03 +00:00
|
|
|
found = true;
|
2020-02-24 18:17:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!found)
|
|
|
|
messageId = 8001;
|
|
|
|
char tmp[16];
|
|
|
|
sprintf(tmp, "%d", messageId);
|
|
|
|
CMessages::ClearSmallMessagesOnly();
|
|
|
|
wchar* text = TheText.Get(tmp);
|
|
|
|
// ...and do nothing about it
|
|
|
|
*(int32*)&CTheScripts::ScriptSpace[CTheScripts::OnAMissionFlag] = 0;
|
|
|
|
m_bDeatharrestExecuted = true;
|
|
|
|
m_nWakeTime = 0;
|
|
|
|
}
|
2020-02-22 23:29:38 +00:00
|
|
|
|
|
|
|
int16 CRunningScript::GetPadState(uint16 pad, uint16 button)
|
|
|
|
{
|
|
|
|
CPad* pPad = CPad::GetPad(pad);
|
|
|
|
switch (button) {
|
|
|
|
case 0: return pPad->NewState.LeftStickX;
|
|
|
|
case 1: return pPad->NewState.LeftStickY;
|
|
|
|
case 2: return pPad->NewState.RightStickX;
|
|
|
|
case 3: return pPad->NewState.RightStickY;
|
|
|
|
case 4: return pPad->NewState.LeftShoulder1;
|
|
|
|
case 5: return pPad->NewState.LeftShoulder2;
|
|
|
|
case 6: return pPad->NewState.RightShoulder1;
|
|
|
|
case 7: return pPad->NewState.RightShoulder2;
|
|
|
|
case 8: return pPad->NewState.DPadUp;
|
|
|
|
case 9: return pPad->NewState.DPadDown;
|
|
|
|
case 10: return pPad->NewState.DPadLeft;
|
|
|
|
case 11: return pPad->NewState.DPadRight;
|
|
|
|
case 12: return pPad->NewState.Start;
|
|
|
|
case 13: return pPad->NewState.Select;
|
|
|
|
case 14: return pPad->NewState.Square;
|
|
|
|
case 15: return pPad->NewState.Triangle;
|
|
|
|
case 16: return pPad->NewState.Cross;
|
|
|
|
case 17: return pPad->NewState.Circle;
|
|
|
|
case 18: return pPad->NewState.LeftShock;
|
|
|
|
case 19: return pPad->NewState.RightShock;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-06-21 10:46:23 +00:00
|
|
|
void CTheScripts::PrintListSizes()
|
|
|
|
{
|
|
|
|
int active = 0;
|
|
|
|
int idle = 0;
|
|
|
|
|
|
|
|
for (CRunningScript* pScript = pActiveScripts; pScript; pScript = pScript->GetNext())
|
|
|
|
active++;
|
|
|
|
for (CRunningScript* pScript = pIdleScripts; pScript; pScript = pScript->GetNext())
|
|
|
|
idle++;
|
|
|
|
|
|
|
|
debug("active: %d, idle: %d", active, idle);
|
|
|
|
}
|
|
|
|
|
2020-02-24 18:17:15 +00:00
|
|
|
uint32 DbgLineColour = 0x0000FFFF; // r = 0, g = 0, b = 255, a = 255
|
|
|
|
|
|
|
|
void CTheScripts::DrawDebugSquare(float infX, float infY, float supX, float supY)
|
|
|
|
{
|
|
|
|
CColPoint tmpCP;
|
|
|
|
CEntity* tmpEP;
|
|
|
|
CVector p1, p2, p3, p4;
|
|
|
|
p1 = CVector(infX, infY, -1000.0f);
|
|
|
|
CWorld::ProcessVerticalLine(p1, 1000.0f, tmpCP, tmpEP, true, false, false, false, true, false, nil);
|
|
|
|
p1.z = 2.0f + tmpCP.point.z;
|
|
|
|
p2 = CVector(supX, supY, -1000.0f);
|
|
|
|
CWorld::ProcessVerticalLine(p2, 1000.0f, tmpCP, tmpEP, true, false, false, false, true, false, nil);
|
|
|
|
p2.z = 2.0f + tmpCP.point.z;
|
|
|
|
p3 = CVector(infX, supY, -1000.0f);
|
|
|
|
CWorld::ProcessVerticalLine(p3, 1000.0f, tmpCP, tmpEP, true, false, false, false, true, false, nil);
|
|
|
|
p3.z = 2.0f + tmpCP.point.z;
|
|
|
|
p4 = CVector(supX, infY, -1000.0f);
|
|
|
|
CWorld::ProcessVerticalLine(p4, 1000.0f, tmpCP, tmpEP, true, false, false, false, true, false, nil);
|
|
|
|
p4.z = 2.0f + tmpCP.point.z;
|
|
|
|
CTheScripts::ScriptDebugLine3D(p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(p2.x, p2.y, p2.z, p3.x, p3.y, p3.z, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(p3.x, p3.y, p3.z, p4.x, p4.y, p4.z, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(p4.x, p4.y, p4.z, p1.x, p1.y, p1.z, DbgLineColour, DbgLineColour);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::DrawDebugAngledSquare(float infX, float infY, float supX, float supY, float rotSupX, float rotSupY, float rotInfX, float rotInfY)
|
|
|
|
{
|
|
|
|
CColPoint tmpCP;
|
|
|
|
CEntity* tmpEP;
|
|
|
|
CVector p1, p2, p3, p4;
|
|
|
|
p1 = CVector(infX, infY, -1000.0f);
|
|
|
|
CWorld::ProcessVerticalLine(p1, 1000.0f, tmpCP, tmpEP, true, false, false, false, true, false, nil);
|
|
|
|
p1.z = 2.0f + tmpCP.point.z;
|
|
|
|
p2 = CVector(supX, supY, -1000.0f);
|
|
|
|
CWorld::ProcessVerticalLine(p2, 1000.0f, tmpCP, tmpEP, true, false, false, false, true, false, nil);
|
|
|
|
p2.z = 2.0f + tmpCP.point.z;
|
|
|
|
p3 = CVector(rotSupX, rotSupY, -1000.0f);
|
|
|
|
CWorld::ProcessVerticalLine(p3, 1000.0f, tmpCP, tmpEP, true, false, false, false, true, false, nil);
|
|
|
|
p3.z = 2.0f + tmpCP.point.z;
|
|
|
|
p4 = CVector(rotInfX, rotInfY, -1000.0f);
|
|
|
|
CWorld::ProcessVerticalLine(p4, 1000.0f, tmpCP, tmpEP, true, false, false, false, true, false, nil);
|
|
|
|
p4.z = 2.0f + tmpCP.point.z;
|
|
|
|
CTheScripts::ScriptDebugLine3D(p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(p2.x, p2.y, p2.z, p3.x, p3.y, p3.z, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(p3.x, p3.y, p3.z, p4.x, p4.y, p4.z, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(p4.x, p4.y, p4.z, p1.x, p1.y, p1.z, DbgLineColour, DbgLineColour);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::DrawDebugCube(float infX, float infY, float infZ, float supX, float supY, float supZ)
|
|
|
|
{
|
|
|
|
CTheScripts::ScriptDebugLine3D(infX, infY, infZ, supX, infY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(supX, infY, infZ, supX, supY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(supX, supY, infZ, infX, supY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(infX, supY, infZ, infX, infY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(infX, infY, supZ, supX, infY, supZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(supX, infY, supZ, supX, supY, supZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(supX, supY, supZ, infX, supY, supZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(infX, supY, supZ, infX, infY, supZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(infX, infY, supZ, infX, infY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(supX, infY, supZ, supX, infY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(supX, supY, supZ, supX, supY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(infX, supY, supZ, infX, supY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::DrawDebugAngledCube(float infX, float infY, float infZ, float supX, float supY, float supZ, float rotSupX, float rotSupY, float rotInfX, float rotInfY)
|
|
|
|
{
|
|
|
|
CTheScripts::ScriptDebugLine3D(infX, infY, infZ, supX, infY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(supX, infY, infZ, rotSupX, rotSupY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(rotSupX, rotSupY, infZ, rotInfX, rotInfY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(rotInfX, rotInfY, infZ, infX, infY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(infX, infY, supZ, supX, infY, supZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(supX, infY, supZ, rotSupX, rotSupY, supZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(rotSupX, rotSupY, rotInfX, rotInfY, supY, supZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(rotInfX, rotInfY, supZ, infX, infY, supZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(infX, infY, supZ, infX, infY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(supX, infY, supZ, supX, infY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(rotSupX, rotSupY, supZ, rotSupX, rotSupY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
CTheScripts::ScriptDebugLine3D(rotInfX, rotInfY, supZ, rotInfX, rotInfY, infZ, DbgLineColour, DbgLineColour);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::ScriptDebugLine3D(float x1, float y1, float z1, float x2, float y2, float z2, uint32 col, uint32 col2)
|
|
|
|
{
|
|
|
|
if (NumScriptDebugLines >= MAX_NUM_STORED_LINES)
|
|
|
|
return;
|
|
|
|
aStoredLines[NumScriptDebugLines].vecInf = CVector(x1, y1, z1);
|
|
|
|
aStoredLines[NumScriptDebugLines].vecSup = CVector(x2, y2, z2);
|
|
|
|
aStoredLines[NumScriptDebugLines].color1 = col;
|
|
|
|
aStoredLines[NumScriptDebugLines++].color2 = col2;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::RenderTheScriptDebugLines()
|
|
|
|
{
|
|
|
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)1);
|
|
|
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)1);
|
|
|
|
for (int i = 0; i < NumScriptDebugLines; i++) {
|
|
|
|
CLines::RenderLineWithClipping(
|
|
|
|
aStoredLines[i].vecInf.x,
|
|
|
|
aStoredLines[i].vecInf.y,
|
|
|
|
aStoredLines[i].vecInf.z,
|
|
|
|
aStoredLines[i].vecSup.x,
|
|
|
|
aStoredLines[i].vecSup.y,
|
|
|
|
aStoredLines[i].vecSup.z,
|
|
|
|
aStoredLines[i].color1,
|
|
|
|
aStoredLines[i].color2);
|
|
|
|
}
|
|
|
|
NumScriptDebugLines = 0;
|
|
|
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)0);
|
|
|
|
}
|
|
|
|
|
2020-03-01 11:18:10 +00:00
|
|
|
#define SCRIPT_DATA_SIZE sizeof(CTheScripts::OnAMissionFlag) + sizeof(CTheScripts::BaseBriefIdForContact) + sizeof(CTheScripts::OnAMissionForContactFlag) +\
|
|
|
|
sizeof(CTheScripts::CollectiveArray) + 4 * sizeof(uint32) * MAX_NUM_BUILDING_SWAPS + 2 * sizeof(uint32) * MAX_NUM_INVISIBILITY_SETTINGS + 5 * sizeof(uint32)
|
|
|
|
|
|
|
|
void CTheScripts::SaveAllScripts(uint8* buf, uint32* size)
|
|
|
|
{
|
|
|
|
INITSAVEBUF
|
2020-03-02 19:54:13 +00:00
|
|
|
uint32 varSpace = GetSizeOfVariableSpace();
|
|
|
|
uint32 runningScripts = 0;
|
2020-03-01 11:18:10 +00:00
|
|
|
for (CRunningScript* pScript = pActiveScripts; pScript; pScript = pScript->GetNext())
|
2020-03-02 19:54:13 +00:00
|
|
|
runningScripts++;
|
2020-05-02 22:42:46 +00:00
|
|
|
*size = CRunningScript::nSaveStructSize * runningScripts + varSpace + SCRIPT_DATA_SIZE + SAVE_HEADER_SIZE + 3 * sizeof(uint32);
|
2020-03-01 11:18:10 +00:00
|
|
|
WriteSaveHeader(buf, 'S', 'C', 'R', '\0', *size - SAVE_HEADER_SIZE);
|
2020-03-02 19:54:13 +00:00
|
|
|
WriteSaveBuf(buf, varSpace);
|
|
|
|
for (uint32 i = 0; i < varSpace; i++)
|
2020-03-01 11:18:10 +00:00
|
|
|
WriteSaveBuf(buf, ScriptSpace[i]);
|
2020-05-10 15:49:33 +00:00
|
|
|
#ifdef CHECK_STRUCT_SIZES
|
2020-03-01 11:18:10 +00:00
|
|
|
static_assert(SCRIPT_DATA_SIZE == 968, "CTheScripts::SaveAllScripts");
|
2020-05-10 15:49:33 +00:00
|
|
|
#endif
|
2020-03-01 11:18:10 +00:00
|
|
|
uint32 script_data_size = SCRIPT_DATA_SIZE;
|
|
|
|
WriteSaveBuf(buf, script_data_size);
|
|
|
|
WriteSaveBuf(buf, OnAMissionFlag);
|
|
|
|
for (uint32 i = 0; i < MAX_NUM_CONTACTS; i++) {
|
|
|
|
WriteSaveBuf(buf, OnAMissionForContactFlag[i]);
|
|
|
|
WriteSaveBuf(buf, BaseBriefIdForContact[i]);
|
|
|
|
}
|
|
|
|
for (uint32 i = 0; i < MAX_NUM_COLLECTIVES; i++)
|
|
|
|
WriteSaveBuf(buf, CollectiveArray[i]);
|
|
|
|
WriteSaveBuf(buf, NextFreeCollectiveIndex);
|
|
|
|
for (uint32 i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) {
|
|
|
|
CBuilding* pBuilding = BuildingSwapArray[i].m_pBuilding;
|
|
|
|
uint32 type, handle;
|
|
|
|
if (!pBuilding) {
|
|
|
|
type = 0;
|
|
|
|
handle = 0;
|
|
|
|
} else if (pBuilding->GetIsATreadable()) {
|
|
|
|
type = 1;
|
|
|
|
handle = CPools::GetTreadablePool()->GetJustIndex((CTreadable*)pBuilding) + 1;
|
|
|
|
} else {
|
|
|
|
type = 2;
|
|
|
|
handle = CPools::GetBuildingPool()->GetJustIndex(pBuilding) + 1;
|
|
|
|
}
|
|
|
|
WriteSaveBuf(buf, type);
|
|
|
|
WriteSaveBuf(buf, handle);
|
|
|
|
WriteSaveBuf(buf, BuildingSwapArray[i].m_nNewModel);
|
|
|
|
WriteSaveBuf(buf, BuildingSwapArray[i].m_nOldModel);
|
|
|
|
}
|
|
|
|
for (uint32 i = 0; i < MAX_NUM_INVISIBILITY_SETTINGS; i++) {
|
|
|
|
CEntity* pEntity = InvisibilitySettingArray[i];
|
|
|
|
uint32 type, handle;
|
|
|
|
if (!pEntity) {
|
|
|
|
type = 0;
|
|
|
|
handle = 0;
|
|
|
|
} else {
|
2020-04-30 13:45:45 +00:00
|
|
|
switch (pEntity->GetType()) {
|
2020-03-01 11:18:10 +00:00
|
|
|
case ENTITY_TYPE_BUILDING:
|
|
|
|
if (((CBuilding*)pEntity)->GetIsATreadable()) {
|
|
|
|
type = 1;
|
|
|
|
handle = CPools::GetTreadablePool()->GetJustIndex((CTreadable*)pEntity) + 1;
|
|
|
|
} else {
|
|
|
|
type = 2;
|
|
|
|
handle = CPools::GetBuildingPool()->GetJustIndex((CBuilding*)pEntity) + 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ENTITY_TYPE_OBJECT:
|
|
|
|
type = 3;
|
|
|
|
handle = CPools::GetObjectPool()->GetJustIndex((CObject*)pEntity) + 1;
|
|
|
|
break;
|
|
|
|
case ENTITY_TYPE_DUMMY:
|
|
|
|
type = 4;
|
|
|
|
handle = CPools::GetDummyPool()->GetJustIndex((CDummy*)pEntity) + 1;
|
2020-05-11 23:24:57 +00:00
|
|
|
default: break;
|
2020-03-01 11:18:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
WriteSaveBuf(buf, type);
|
|
|
|
WriteSaveBuf(buf, handle);
|
|
|
|
}
|
|
|
|
WriteSaveBuf(buf, bUsingAMultiScriptFile);
|
|
|
|
WriteSaveBuf(buf, (uint8)0);
|
|
|
|
WriteSaveBuf(buf, (uint16)0);
|
|
|
|
WriteSaveBuf(buf, MainScriptSize);
|
|
|
|
WriteSaveBuf(buf, LargestMissionScriptSize);
|
|
|
|
WriteSaveBuf(buf, NumberOfMissionScripts);
|
|
|
|
WriteSaveBuf(buf, (uint16)0);
|
2020-03-02 19:54:13 +00:00
|
|
|
WriteSaveBuf(buf, runningScripts);
|
2020-03-01 11:18:10 +00:00
|
|
|
for (CRunningScript* pScript = pActiveScripts; pScript; pScript = pScript->GetNext())
|
2020-05-02 22:42:46 +00:00
|
|
|
pScript->Save(buf);
|
2020-03-01 11:18:10 +00:00
|
|
|
VALIDATESAVEBUF(*size)
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::LoadAllScripts(uint8* buf, uint32 size)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
INITSAVEBUF
|
|
|
|
CheckSaveHeader(buf, 'S', 'C', 'R', '\0', size - SAVE_HEADER_SIZE);
|
2020-03-02 19:54:13 +00:00
|
|
|
uint32 varSpace = ReadSaveBuf<uint32>(buf);
|
|
|
|
for (uint32 i = 0; i < varSpace; i++)
|
2020-03-01 11:18:10 +00:00
|
|
|
ScriptSpace[i] = ReadSaveBuf<uint8>(buf);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ReadSaveBuf<uint32>(buf) == SCRIPT_DATA_SIZE);
|
2020-03-01 11:18:10 +00:00
|
|
|
OnAMissionFlag = ReadSaveBuf<uint32>(buf);
|
|
|
|
for (uint32 i = 0; i < MAX_NUM_CONTACTS; i++) {
|
|
|
|
OnAMissionForContactFlag[i] = ReadSaveBuf<uint32>(buf);
|
|
|
|
BaseBriefIdForContact[i] = ReadSaveBuf<uint32>(buf);
|
|
|
|
}
|
|
|
|
for (uint32 i = 0; i < MAX_NUM_COLLECTIVES; i++)
|
|
|
|
CollectiveArray[i] = ReadSaveBuf<tCollectiveData>(buf);
|
|
|
|
NextFreeCollectiveIndex = ReadSaveBuf<uint32>(buf);
|
|
|
|
for (uint32 i = 0; i < MAX_NUM_BUILDING_SWAPS; i++) {
|
|
|
|
uint32 type = ReadSaveBuf<uint32>(buf);
|
|
|
|
uint32 handle = ReadSaveBuf<uint32>(buf);
|
|
|
|
switch (type) {
|
|
|
|
case 0:
|
|
|
|
BuildingSwapArray[i].m_pBuilding = nil;
|
|
|
|
break;
|
|
|
|
case 1:
|
2020-03-02 19:54:13 +00:00
|
|
|
BuildingSwapArray[i].m_pBuilding = CPools::GetTreadablePool()->GetSlot(handle - 1);
|
2020-03-01 11:18:10 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2020-03-02 19:54:13 +00:00
|
|
|
BuildingSwapArray[i].m_pBuilding = CPools::GetBuildingPool()->GetSlot(handle - 1);
|
2020-03-01 11:18:10 +00:00
|
|
|
break;
|
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-03-01 11:18:10 +00:00
|
|
|
}
|
|
|
|
BuildingSwapArray[i].m_nNewModel = ReadSaveBuf<uint32>(buf);
|
|
|
|
BuildingSwapArray[i].m_nOldModel = ReadSaveBuf<uint32>(buf);
|
|
|
|
if (BuildingSwapArray[i].m_pBuilding)
|
|
|
|
BuildingSwapArray[i].m_pBuilding->ReplaceWithNewModel(BuildingSwapArray[i].m_nNewModel);
|
|
|
|
}
|
|
|
|
for (uint32 i = 0; i < MAX_NUM_INVISIBILITY_SETTINGS; i++) {
|
|
|
|
uint32 type = ReadSaveBuf<uint32>(buf);
|
|
|
|
uint32 handle = ReadSaveBuf<uint32>(buf);
|
|
|
|
switch (type) {
|
|
|
|
case 0:
|
|
|
|
InvisibilitySettingArray[i] = nil;
|
|
|
|
break;
|
|
|
|
case 1:
|
2020-03-02 19:54:13 +00:00
|
|
|
InvisibilitySettingArray[i] = CPools::GetTreadablePool()->GetSlot(handle - 1);
|
2020-03-01 11:18:10 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2020-03-02 19:54:13 +00:00
|
|
|
InvisibilitySettingArray[i] = CPools::GetBuildingPool()->GetSlot(handle - 1);
|
2020-03-01 11:18:10 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
InvisibilitySettingArray[i] = CPools::GetObjectPool()->GetSlot(handle - 1);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
InvisibilitySettingArray[i] = CPools::GetDummyPool()->GetSlot(handle - 1);
|
2020-04-05 23:01:03 +00:00
|
|
|
break;
|
2020-03-01 11:18:10 +00:00
|
|
|
default:
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(false);
|
2020-03-01 11:18:10 +00:00
|
|
|
}
|
|
|
|
if (InvisibilitySettingArray[i])
|
|
|
|
InvisibilitySettingArray[i]->bIsVisible = false;
|
|
|
|
}
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ReadSaveBuf<bool>(buf) == bUsingAMultiScriptFile);
|
2020-03-02 19:54:13 +00:00
|
|
|
ReadSaveBuf<uint8>(buf);
|
|
|
|
ReadSaveBuf<uint16>(buf);
|
2020-06-28 08:59:20 +00:00
|
|
|
script_assert(ReadSaveBuf<uint32>(buf) == MainScriptSize);
|
|
|
|
script_assert(ReadSaveBuf<uint32>(buf) == LargestMissionScriptSize);
|
|
|
|
script_assert(ReadSaveBuf<uint16>(buf) == NumberOfMissionScripts);
|
2020-03-02 19:54:13 +00:00
|
|
|
ReadSaveBuf<uint16>(buf);
|
|
|
|
uint32 runningScripts = ReadSaveBuf<uint32>(buf);
|
|
|
|
for (uint32 i = 0; i < runningScripts; i++)
|
2020-05-02 22:42:46 +00:00
|
|
|
StartNewScript(0)->Load(buf);
|
2020-03-01 11:18:10 +00:00
|
|
|
VALIDATESAVEBUF(size)
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef SCRIPT_DATA_SIZE
|
|
|
|
|
2020-03-02 19:54:13 +00:00
|
|
|
void CTheScripts::ClearSpaceForMissionEntity(const CVector& pos, CEntity* pEntity)
|
|
|
|
{
|
2020-04-15 16:19:45 +00:00
|
|
|
static CColPoint aTempColPoints[MAX_COLLISION_POINTS];
|
2020-03-02 19:54:13 +00:00
|
|
|
int16 entities = 0;
|
|
|
|
CEntity* aEntities[16];
|
|
|
|
CWorld::FindObjectsKindaColliding(pos, pEntity->GetBoundRadius(), false, &entities, 16, aEntities, false, true, true, false, false);
|
|
|
|
if (entities <= 0)
|
|
|
|
return;
|
|
|
|
for (uint16 i = 0; i < entities; i++) {
|
|
|
|
if (aEntities[i] != pEntity && aEntities[i]->IsPed() && ((CPed*)aEntities[i])->bInVehicle)
|
|
|
|
aEntities[i] = nil;
|
|
|
|
}
|
|
|
|
for (uint16 i = 0; i < entities; i++) {
|
|
|
|
if (aEntities[i] == pEntity || !aEntities[i])
|
|
|
|
continue;
|
|
|
|
CEntity* pFound = aEntities[i];
|
|
|
|
int cols;
|
2020-04-10 09:03:22 +00:00
|
|
|
if (pEntity->GetColModel()->numLines <= 0)
|
|
|
|
cols = CCollision::ProcessColModels(pEntity->GetMatrix(), *pEntity->GetColModel(),
|
|
|
|
pFound->GetMatrix(), *pFound->GetColModel(), aTempColPoints, nil, nil);
|
2020-03-02 19:54:13 +00:00
|
|
|
else {
|
|
|
|
float lines[4];
|
|
|
|
lines[0] = lines[1] = lines[2] = lines[3] = 1.0f;
|
2020-04-10 09:03:22 +00:00
|
|
|
CColPoint tmp[4];
|
|
|
|
cols = CCollision::ProcessColModels(pEntity->GetMatrix(), *pEntity->GetColModel(),
|
|
|
|
pFound->GetMatrix(), *pFound->GetColModel(), aTempColPoints,tmp, lines);
|
2020-03-02 19:54:13 +00:00
|
|
|
}
|
|
|
|
if (cols <= 0)
|
|
|
|
continue;
|
2020-04-30 13:45:45 +00:00
|
|
|
switch (pFound->GetType()) {
|
2020-03-02 19:54:13 +00:00
|
|
|
case ENTITY_TYPE_VEHICLE:
|
|
|
|
{
|
|
|
|
printf("Will try to delete a vehicle where a mission entity should be\n");
|
|
|
|
CVehicle* pVehicle = (CVehicle*)pFound;
|
|
|
|
if (pVehicle->bIsLocked || !pVehicle->CanBeDeleted())
|
|
|
|
break;
|
|
|
|
if (pVehicle->pDriver) {
|
|
|
|
CPopulation::RemovePed(pVehicle->pDriver);
|
|
|
|
pVehicle->pDriver = nil;
|
|
|
|
}
|
|
|
|
for (int i = 0; i < pVehicle->m_nNumMaxPassengers; i++) {
|
|
|
|
if (pVehicle->pPassengers[i]) {
|
|
|
|
CPopulation::RemovePed(pVehicle->pPassengers[i]);
|
|
|
|
pVehicle->pPassengers[i] = 0;
|
|
|
|
pVehicle->m_nNumPassengers--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CCarCtrl::RemoveFromInterestingVehicleList(pVehicle);
|
|
|
|
CWorld::Remove(pVehicle);
|
|
|
|
delete pVehicle;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case ENTITY_TYPE_PED:
|
|
|
|
{
|
|
|
|
CPed* pPed = (CPed*)pFound;
|
|
|
|
if (pPed->IsPlayer() || !pPed->CanBeDeleted())
|
|
|
|
break;
|
|
|
|
CPopulation::RemovePed(pPed);
|
|
|
|
printf("Deleted a ped where a mission entity should be\n");
|
|
|
|
break;
|
|
|
|
}
|
2020-05-11 23:24:57 +00:00
|
|
|
default: break;
|
2020-03-02 19:54:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-04 20:12:16 +00:00
|
|
|
void CTheScripts::HighlightImportantArea(uint32 id, float x1, float y1, float x2, float y2, float z)
|
2020-03-02 19:54:13 +00:00
|
|
|
{
|
|
|
|
float infX, infY, supX, supY;
|
2020-03-04 20:12:16 +00:00
|
|
|
if (x1 < x2) {
|
|
|
|
infX = x1;
|
|
|
|
supX = x2;
|
2020-03-02 19:54:13 +00:00
|
|
|
} else {
|
2020-03-04 20:12:16 +00:00
|
|
|
infX = x2;
|
|
|
|
supX = x1;
|
2020-03-02 19:54:13 +00:00
|
|
|
}
|
2020-03-04 20:12:16 +00:00
|
|
|
if (y1 < y2) {
|
|
|
|
infY = y1;
|
|
|
|
supY = y2;
|
2020-03-02 19:54:13 +00:00
|
|
|
}
|
|
|
|
else {
|
2020-03-04 20:12:16 +00:00
|
|
|
infY = y2;
|
|
|
|
supY = y1;
|
2020-03-02 19:54:13 +00:00
|
|
|
}
|
|
|
|
CVector center;
|
|
|
|
center.x = (infX + supX) / 2;
|
|
|
|
center.y = (infY + supY) / 2;
|
2020-03-04 22:10:09 +00:00
|
|
|
center.z = (z <= MAP_Z_LOW_LIMIT) ? CWorld::FindGroundZForCoord(center.x, center.y) : z;
|
2020-03-02 19:54:13 +00:00
|
|
|
CShadows::RenderIndicatorShadow(id, 2, gpGoalTex, ¢er, supX - center.x, 0.0f, 0.0f, center.y - supY, 0);
|
|
|
|
}
|
|
|
|
|
2020-03-04 20:12:16 +00:00
|
|
|
void CTheScripts::HighlightImportantAngledArea(uint32 id, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float z)
|
2020-03-02 19:54:13 +00:00
|
|
|
{
|
2020-03-04 20:12:16 +00:00
|
|
|
float infX, infY, supX, supY, X, Y;
|
|
|
|
X = (x1 + x2) / 2;
|
|
|
|
Y = (y1 + y2) / 2;
|
|
|
|
supX = infX = X;
|
|
|
|
supY = infY = Y;
|
|
|
|
X = (x2 + x3) / 2;
|
|
|
|
Y = (y2 + y3) / 2;
|
2020-04-19 16:34:08 +00:00
|
|
|
infX = Min(infX, X);
|
|
|
|
supX = Max(supX, X);
|
|
|
|
infY = Min(infY, Y);
|
|
|
|
supY = Max(supY, Y);
|
2020-03-04 20:12:16 +00:00
|
|
|
X = (x3 + x4) / 2;
|
|
|
|
Y = (y3 + y4) / 2;
|
2020-04-19 16:34:08 +00:00
|
|
|
infX = Min(infX, X);
|
|
|
|
supX = Max(supX, X);
|
|
|
|
infY = Min(infY, Y);
|
|
|
|
supY = Max(supY, Y);
|
2020-03-04 20:12:16 +00:00
|
|
|
X = (x4 + x1) / 2;
|
|
|
|
Y = (y4 + y1) / 2;
|
2020-04-19 16:34:08 +00:00
|
|
|
infX = Min(infX, X);
|
|
|
|
supX = Max(supX, X);
|
|
|
|
infY = Min(infY, Y);
|
|
|
|
supY = Max(supY, Y);
|
2020-03-04 20:12:16 +00:00
|
|
|
CVector center;
|
|
|
|
center.x = (infX + supX) / 2;
|
|
|
|
center.y = (infY + supY) / 2;
|
2020-03-04 22:10:09 +00:00
|
|
|
center.z = (z <= MAP_Z_LOW_LIMIT) ? CWorld::FindGroundZForCoord(center.x, center.y) : z;
|
2020-03-04 20:12:16 +00:00
|
|
|
CShadows::RenderIndicatorShadow(id, 2, gpGoalTex, ¢er, supX - center.x, 0.0f, 0.0f, center.y - supY, 0);
|
2020-03-02 19:54:13 +00:00
|
|
|
}
|
|
|
|
|
2020-03-04 20:12:16 +00:00
|
|
|
bool CTheScripts::IsPedStopped(CPed* pPed)
|
|
|
|
{
|
|
|
|
if (pPed->bInVehicle)
|
|
|
|
return IsVehicleStopped(pPed->m_pMyVehicle);
|
|
|
|
return pPed->m_nMoveState == eMoveState::PEDMOVE_NONE || pPed->m_nMoveState == eMoveState::PEDMOVE_STILL;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CTheScripts::IsPlayerStopped(CPlayerInfo* pPlayer)
|
|
|
|
{
|
|
|
|
CPed* pPed = pPlayer->m_pPed;
|
|
|
|
if (pPed->bInVehicle)
|
|
|
|
return IsVehicleStopped(pPed->m_pMyVehicle);
|
|
|
|
if (RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP) ||
|
|
|
|
RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_RUN_STOP_R) ||
|
|
|
|
RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_LAUNCH) ||
|
|
|
|
RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_GLIDE))
|
|
|
|
return false;
|
|
|
|
return pPed->m_nMoveState == eMoveState::PEDMOVE_NONE || pPed->m_nMoveState == eMoveState::PEDMOVE_STILL;
|
|
|
|
}
|
2020-02-22 23:29:38 +00:00
|
|
|
|
|
|
|
bool CTheScripts::IsVehicleStopped(CVehicle* pVehicle)
|
|
|
|
{
|
|
|
|
return 0.01f * CTimer::GetTimeStep() >= pVehicle->m_fDistanceTravelled;
|
|
|
|
}
|
|
|
|
|
2020-03-04 20:12:16 +00:00
|
|
|
void CTheScripts::CleanUpThisPed(CPed* pPed)
|
|
|
|
{
|
|
|
|
if (!pPed)
|
|
|
|
return;
|
|
|
|
if (pPed->CharCreatedBy != MISSION_CHAR)
|
|
|
|
return;
|
|
|
|
pPed->CharCreatedBy = RANDOM_CHAR;
|
|
|
|
if (pPed->m_nPedType == PEDTYPE_PROSTITUTE)
|
|
|
|
pPed->m_objectiveTimer = CTimer::GetTimeInMilliseconds() + 30000;
|
|
|
|
if (pPed->bInVehicle) {
|
|
|
|
if (pPed->m_pMyVehicle->pDriver == pPed) {
|
|
|
|
if (pPed->m_pMyVehicle->m_vehType == VEHICLE_TYPE_CAR) {
|
|
|
|
CCarCtrl::JoinCarWithRoadSystem(pPed->m_pMyVehicle);
|
|
|
|
pPed->m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (pPed->m_pMyVehicle->m_vehType == VEHICLE_TYPE_CAR) {
|
|
|
|
pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pPed->m_pMyVehicle);
|
|
|
|
pPed->bWanderPathAfterExitingCar = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool flees = false;
|
|
|
|
PedState state;
|
|
|
|
eMoveState ms;
|
|
|
|
if (pPed->m_nPedState == PED_FLEE_ENTITY || pPed->m_nPedState == PED_FLEE_POS) {
|
|
|
|
ms = pPed->m_nMoveState;
|
|
|
|
state = pPed->m_nPedState;
|
|
|
|
flees = true;
|
|
|
|
}
|
|
|
|
pPed->ClearObjective();
|
|
|
|
pPed->bRespondsToThreats = true;
|
|
|
|
pPed->bScriptObjectiveCompleted = false;
|
|
|
|
pPed->ClearLeader();
|
|
|
|
if (pPed->IsPedInControl())
|
|
|
|
pPed->SetWanderPath(CGeneral::GetRandomNumber() & 7);
|
|
|
|
if (flees) {
|
|
|
|
pPed->m_nPedState = state;
|
|
|
|
pPed->SetMoveState(ms);
|
|
|
|
}
|
|
|
|
--CPopulation::ms_nTotalMissionPeds;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::CleanUpThisVehicle(CVehicle* pVehicle)
|
|
|
|
{
|
|
|
|
if (!pVehicle)
|
|
|
|
return;
|
|
|
|
if (pVehicle->VehicleCreatedBy != MISSION_VEHICLE)
|
|
|
|
return;
|
|
|
|
pVehicle->bIsLocked = false;
|
|
|
|
CCarCtrl::RemoveFromInterestingVehicleList(pVehicle);
|
|
|
|
pVehicle->VehicleCreatedBy = RANDOM_VEHICLE;
|
|
|
|
++CCarCtrl::NumRandomCars;
|
|
|
|
--CCarCtrl::NumMissionCars;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::CleanUpThisObject(CObject* pObject)
|
|
|
|
{
|
|
|
|
if (!pObject)
|
|
|
|
return;
|
|
|
|
if (pObject->ObjectCreatedBy != MISSION_OBJECT)
|
|
|
|
return;
|
|
|
|
pObject->ObjectCreatedBy = TEMP_OBJECT;
|
|
|
|
pObject->m_nEndOfLifeTime = CTimer::GetTimeInMilliseconds() + 20000;
|
|
|
|
pObject->m_nRefModelIndex = -1;
|
|
|
|
pObject->bUseVehicleColours = false;
|
|
|
|
++CObject::nNoTempObjects;
|
|
|
|
}
|
|
|
|
|
2020-03-04 22:10:09 +00:00
|
|
|
void CTheScripts::ReadObjectNamesFromScript()
|
|
|
|
{
|
|
|
|
int32 varSpace = GetSizeOfVariableSpace();
|
|
|
|
uint32 ip = varSpace + 8;
|
|
|
|
NumberOfUsedObjects = Read2BytesFromScript(&ip);
|
|
|
|
ip += 2;
|
|
|
|
for (uint16 i = 0; i < NumberOfUsedObjects; i++) {
|
|
|
|
for (int j = 0; j < USED_OBJECT_NAME_LENGTH; j++)
|
|
|
|
UsedObjectArray[i].name[j] = ScriptSpace[ip++];
|
|
|
|
UsedObjectArray[i].index = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::UpdateObjectIndices()
|
|
|
|
{
|
|
|
|
char name[USED_OBJECT_NAME_LENGTH];
|
|
|
|
char error[112];
|
|
|
|
for (int i = 1; i < NumberOfUsedObjects; i++) {
|
|
|
|
bool found = false;
|
|
|
|
for (int j = 0; j < MODELINFOSIZE && !found; j++) {
|
|
|
|
CBaseModelInfo* pModel = CModelInfo::GetModelInfo(j);
|
|
|
|
if (!pModel)
|
|
|
|
continue;
|
|
|
|
strcpy(name, pModel->GetName());
|
2020-06-06 10:31:09 +00:00
|
|
|
#ifdef FIX_BUGS
|
|
|
|
for (int k = 0; k < USED_OBJECT_NAME_LENGTH && name[k]; k++)
|
|
|
|
#else
|
2020-03-04 22:10:09 +00:00
|
|
|
for (int k = 0; k < USED_OBJECT_NAME_LENGTH; k++)
|
2020-06-06 10:31:09 +00:00
|
|
|
#endif
|
2020-03-04 22:10:09 +00:00
|
|
|
name[k] = toupper(name[k]);
|
|
|
|
if (strcmp(name, UsedObjectArray[i].name) == 0) {
|
|
|
|
found = true;
|
|
|
|
UsedObjectArray[i].index = j;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!found) {
|
|
|
|
sprintf(error, "CTheScripts::UpdateObjectIndices - Couldn't find %s", UsedObjectArray[i].name);
|
|
|
|
debug("%s\n", error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTheScripts::ReadMultiScriptFileOffsetsFromScript()
|
|
|
|
{
|
|
|
|
int32 varSpace = GetSizeOfVariableSpace();
|
|
|
|
uint32 ip = varSpace + 3;
|
|
|
|
int32 objectSize = Read4BytesFromScript(&ip);
|
|
|
|
ip = objectSize + 8;
|
|
|
|
MainScriptSize = Read4BytesFromScript(&ip);
|
|
|
|
LargestMissionScriptSize = Read4BytesFromScript(&ip);
|
|
|
|
NumberOfMissionScripts = Read2BytesFromScript(&ip);
|
|
|
|
ip += 2;
|
|
|
|
for (int i = 0; i < NumberOfMissionScripts; i++) {
|
|
|
|
MultiScriptArray[i] = Read4BytesFromScript(&ip);
|
|
|
|
}
|
|
|
|
}
|
2020-05-02 22:42:46 +00:00
|
|
|
|
|
|
|
void CRunningScript::Save(uint8*& buf)
|
|
|
|
{
|
|
|
|
#ifdef COMPATIBLE_SAVES
|
|
|
|
SkipSaveBuf(buf, 8);
|
|
|
|
for (int i = 0; i < 8; i++)
|
|
|
|
WriteSaveBuf<char>(buf, m_abScriptName[i]);
|
|
|
|
WriteSaveBuf<uint32>(buf, m_nIp);
|
2020-05-10 15:49:33 +00:00
|
|
|
#ifdef CHECK_STRUCT_SIZES
|
2020-05-02 22:42:46 +00:00
|
|
|
static_assert(MAX_STACK_DEPTH == 6, "Compatibility loss: MAX_STACK_DEPTH != 6");
|
2020-05-10 15:49:33 +00:00
|
|
|
#endif
|
2020-05-02 22:42:46 +00:00
|
|
|
for (int i = 0; i < MAX_STACK_DEPTH; i++)
|
|
|
|
WriteSaveBuf<uint32>(buf, m_anStack[i]);
|
|
|
|
WriteSaveBuf<uint16>(buf, m_nStackPointer);
|
|
|
|
SkipSaveBuf(buf, 2);
|
2020-05-10 15:49:33 +00:00
|
|
|
#ifdef CHECK_STRUCT_SIZES
|
2020-05-02 22:42:46 +00:00
|
|
|
static_assert(NUM_LOCAL_VARS + NUM_TIMERS == 18, "Compatibility loss: NUM_LOCAL_VARS + NUM_TIMERS != 18");
|
2020-05-10 15:49:33 +00:00
|
|
|
#endif
|
2020-05-02 22:42:46 +00:00
|
|
|
for (int i = 0; i < NUM_LOCAL_VARS + NUM_TIMERS; i++)
|
|
|
|
WriteSaveBuf<int32>(buf, m_anLocalVariables[i]);
|
|
|
|
WriteSaveBuf<bool>(buf, m_bCondResult);
|
|
|
|
WriteSaveBuf<bool>(buf, m_bIsMissionScript);
|
|
|
|
WriteSaveBuf<bool>(buf, m_bSkipWakeTime);
|
|
|
|
SkipSaveBuf(buf, 1);
|
|
|
|
WriteSaveBuf<uint32>(buf, m_nWakeTime);
|
|
|
|
WriteSaveBuf<uint16>(buf, m_nAndOrState);
|
|
|
|
WriteSaveBuf<bool>(buf, m_bNotFlag);
|
|
|
|
WriteSaveBuf<bool>(buf, m_bDeatharrestEnabled);
|
|
|
|
WriteSaveBuf<bool>(buf, m_bDeatharrestExecuted);
|
|
|
|
WriteSaveBuf<bool>(buf, m_bMissionFlag);
|
|
|
|
SkipSaveBuf(buf, 2);
|
|
|
|
#else
|
|
|
|
WriteSaveBuf(buf, *this);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void CRunningScript::Load(uint8*& buf)
|
|
|
|
{
|
|
|
|
#ifdef COMPATIBLE_SAVES
|
|
|
|
SkipSaveBuf(buf, 8);
|
|
|
|
for (int i = 0; i < 8; i++)
|
|
|
|
m_abScriptName[i] = ReadSaveBuf<char>(buf);
|
|
|
|
m_nIp = ReadSaveBuf<uint32>(buf);
|
2020-05-10 15:49:33 +00:00
|
|
|
#ifdef CHECK_STRUCT_SIZES
|
2020-05-02 22:42:46 +00:00
|
|
|
static_assert(MAX_STACK_DEPTH == 6, "Compatibility loss: MAX_STACK_DEPTH != 6");
|
2020-05-10 15:49:33 +00:00
|
|
|
#endif
|
2020-05-02 22:42:46 +00:00
|
|
|
for (int i = 0; i < MAX_STACK_DEPTH; i++)
|
|
|
|
m_anStack[i] = ReadSaveBuf<uint32>(buf);
|
|
|
|
m_nStackPointer = ReadSaveBuf<uint16>(buf);
|
|
|
|
SkipSaveBuf(buf, 2);
|
2020-05-10 15:49:33 +00:00
|
|
|
#ifdef CHECK_STRUCT_SIZES
|
2020-05-02 22:42:46 +00:00
|
|
|
static_assert(NUM_LOCAL_VARS + NUM_TIMERS == 18, "Compatibility loss: NUM_LOCAL_VARS + NUM_TIMERS != 18");
|
2020-05-10 15:49:33 +00:00
|
|
|
#endif
|
2020-05-02 22:42:46 +00:00
|
|
|
for (int i = 0; i < NUM_LOCAL_VARS + NUM_TIMERS; i++)
|
|
|
|
m_anLocalVariables[i] = ReadSaveBuf<int32>(buf);
|
|
|
|
m_bCondResult = ReadSaveBuf<bool>(buf);
|
|
|
|
m_bIsMissionScript = ReadSaveBuf<bool>(buf);
|
|
|
|
m_bSkipWakeTime = ReadSaveBuf<bool>(buf);
|
|
|
|
SkipSaveBuf(buf, 1);
|
|
|
|
m_nWakeTime = ReadSaveBuf<uint32>(buf);
|
|
|
|
m_nAndOrState = ReadSaveBuf<uint16>(buf);
|
|
|
|
m_bNotFlag = ReadSaveBuf<bool>(buf);
|
|
|
|
m_bDeatharrestEnabled = ReadSaveBuf<bool>(buf);
|
|
|
|
m_bDeatharrestExecuted = ReadSaveBuf<bool>(buf);
|
|
|
|
m_bMissionFlag = ReadSaveBuf<bool>(buf);
|
|
|
|
SkipSaveBuf(buf, 2);
|
|
|
|
#else
|
|
|
|
CRunningScript* n = next;
|
|
|
|
CRunningScript* p = prev;
|
|
|
|
*this = ReadSaveBuf<CRunningScript>(buf);
|
|
|
|
next = n;
|
|
|
|
prev = p;
|
|
|
|
#endif
|
|
|
|
}
|
2020-05-26 21:25:12 +00:00
|
|
|
|
|
|
|
#ifdef MISSION_REPLAY
|
|
|
|
|
|
|
|
bool CRunningScript::CanAllowMissionReplay()
|
|
|
|
{
|
|
|
|
if (AllowMissionReplay)
|
|
|
|
return false;
|
|
|
|
if (CStats::LastMissionPassedName[0] == '\0')
|
|
|
|
return false;
|
|
|
|
for (int i = 0; i < ARRAY_SIZE(nonMissionScripts); i++) {
|
|
|
|
if (strcmp(m_abScriptName, nonMissionScripts[i]) == 0)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32 AddExtraDeathDelay()
|
|
|
|
{
|
|
|
|
if (missionRetryScriptIndex == 63)
|
|
|
|
return 7000;
|
|
|
|
if (missionRetryScriptIndex == 64)
|
|
|
|
return 4000;
|
|
|
|
return 1000;
|
|
|
|
}
|
|
|
|
|
|
|
|
void RetryMission(int type, int unk)
|
|
|
|
{
|
|
|
|
if (type == 0) {
|
|
|
|
doingMissionRetry = true;
|
|
|
|
FrontEndMenuManager.m_nCurrScreen = MENUPAGE_MISSION_RETRY;
|
|
|
|
FrontEndMenuManager.RequestFrontEndStartUp();
|
|
|
|
}
|
|
|
|
else if (type == 2) {
|
|
|
|
doingMissionRetry = false;
|
|
|
|
AllowMissionReplay = 6;
|
|
|
|
CTheScripts::MissionCleanup.Process();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|