Jump to content

How to use Aru's C++ ScriptHook SDK


Recommended Posts

Hi modders,

after some requests I decided to post here my small instruction how to use Aru's C++ ScriptHook SDK. I wrote this "HOW TO" some time ago for friends smile.gif

Let's go! Simply follow the instructions biggrin.gif

  • First install Visual C++ 2010 Express and Aru's C++ Script Hook SDK 0.4.0!
  • Then run ScriptHook.sln (C++ ScriptHook SDK)... alter loading double click on SampleCustomFiber (left menu) >> Source Files >> CustomFiberThread.cpp
  • Edit the script like YOU want smile.gif(You can find examples in SDK!)
  • Right click on SampleCustomFiber (left menu) and choose "Set as StartUp Project"!
  • At the top of the window you can see a green PLAYbutton! Besides ("DEBUG") choose "RELEASE" and press PLAY!
  • You get a message like an error >> ignore this and press OK.
  • Go to ScriptHook SDK main folder and you will see a folder called Release. There you can find this file: SampleCustomFiber.dll
    Rename it to "myTestMod.asi" (NOT myTestMod.asi.dll !!!!) and copy it to your GTA game dir (root dir)!
  • Congratulations! Your first mod is ready now!
  • Start the game to test it... Have fun smile.gif

Here is a list with about 250 450 natives that I have edited! You must edit your "ScriptingNatives.h" too, so download both HERE!

 

 

 

// ##########################################// ######## Natives edited by Skorpro #######// ##########################################// Vehicle, Car...static void TurnOffVehicleExtra(Vehicle vehicle, int extraID, b8 extraOnOff)==>>TURN_OFF_VEHICLE_EXTRAstatic void SetCanBurstCarTyres(Vehicle vehicle, b8 value)==>>SET_CAN_BURST_CAR_TYRESstatic void SetCarCollision(Vehicle vehicle, b8 collOnOff)==>>SET_CAR_COLLISIONstatic void AttachCarToCar(Vehicle newVeh, Vehicle myCurrentVeh, int zero, f32 x, f32 y, f32 z, f32 rotax, f32 rotay, f32 rotaz)==>>ATTACH_CAR_TO_CARstatic void TaskCarDriveToCoord(Ped ped, Vehicle car, float x, float y, float z, float speed, unsigned int p1f_2b, unsigned int p2, unsigned int p3, unsigned int px2, unsigned int p45000)==>>TASK_CAR_DRIVE_TO_COORDstatic void SetVehHasStrongAxles(Vehicle vehicle, b8 axlesOnOff)==>>SET_VEH_HAS_STRONG_AXLESstatic void SetCarEngineOn(Vehicle vehicle, int var0, int var1)==>>SET_CAR_ENGINE_ONstatic void SetCarAsMissionCar(Vehicle vehicle)==>>SET_CAR_AS_MISSION_CARstatic void SetCarCoordinatesNoOffset(Vehicle vehicle, f32 x, f32 y, f32 z)==>>SET_CAR_COORDINATES_NO_OFFSETstatic void AddStuckCarCheckWithWarp(Vehicle vehicle, f32 stuckdif, int time, bool flag1, bool flag2, bool flag3, bool flag4)==>>ADD_STUCK_CAR_CHECK_WITH_WARPstatic b8 IsVehStuck(Vehicle vehicle, int time, bool flag1, bool flag2, bool flag3)==>>IS_VEH_STUCKstatic void SetCarLivery(Vehicle vehicle, int liveryID)==>>SET_CAR_LIVERYstatic void TakeCarOutOfParkedCarsBudget(Vehicle vehicle, b8 onOff)==>>TAKE_CAR_OUT_OF_PARKED_CARS_BUDGETstatic void SuppressCarModel(eModel model)==>>SUPPRESS_CAR_MODELstatic void SetVehIndicatorlights(Vehicle vehicle, b8 set)==>>SET_VEH_INDICATORLIGHTSstatic void SetPetrolTankWeakpoint(Vehicle vehicle, b8 set)==>>SET_PETROL_TANK_WEAKPOINTstatic void AttachObjectToCarPhysically(Object obj, Vehicle v, u32 carParts, u32 carParts2, f32 pX, f32 pY, f32 pZ, f32 unkX, f32 unkY, f32 unkZ, f32 rX, f32 rY, f32 rZ, f32 unkHealth, b8 unkTrue)==>>ATTACH_OBJECT_TO_CAR_PHYSICALLYstatic void TriggerPtfxOnVeh(const ch *fxName, Vehicle veh, f32 x, f32 y, f32 z, f32 xspeed, f32 yspeed, f32 zspeed, f32 radius)==>>TRIGGER_PTFX_ON_VEHstatic b8 GetVehicleComponentInfo(Vehicle veh, int component_id_41, Vector3 *pPosition1, Vector3 *pPosition2, int *pMinus1, bool flag)==>>GET_VEHICLE_COMPONENT_INFOstatic void GetCarForwardVector(Vehicle veh, Vector3 *pVeh)==>>GET_CAR_FORWARD_VECTORstatic void GetVehicleQuaternion(Vehicle vehicle, f32 *px, f32 *py, f32 *pz, f32 *pa)==>>GET_VEHICLE_QUATERNIONstatic int ShiftLeft(int val)==>>SHIFT_LEFTstatic int ShiftRight(int val)==>>SHIFT_RIGHTstatic void SetCarLaneShift(Vehicle vehicle, f32 shift)==>>SET_CAR_LANE_SHIFTstatic void AttachCarToObject(Vehicle car, Object obj, u32 unknown0_0, f32 pX, f32 pY, f32 pZ, f32 rX, f32 rY, f32 rZ)==>>ATTACH_CAR_TO_OBJECTstatic void GetCarLivery(Vehicle vehicle, int *liveryID)==>>GET_CAR_LIVERYstatic b8 LocateCar3D(Vehicle veh, f32 x, f32 y, f32 z, f32 radx, f32 rady, f32 radz, b8 flag)==>>LOCATE_CAR_3Dstatic b8 LocateCharInCar3D(Ped ped, f32 x, f32 y, f32 z, f32 radx, f32 rady, f32 radz, b8 flag)==>>LOCATE_CHAR_IN_CAR_3Dstatic b8 IsCarStuck(Vehicle vehicle)==>>IS_CAR_STUCKstatic void CreateCarGenerator(f32 x, f32 y, f32 z, f32 angle, f32 unk0, f32 unk1, eModel model, int unk2, int unk3, int unk4, int unk5, int unk6, int alarm, int doorlock,int *carGen)==>>CREATE_CAR_GENERATORstatic void DeleteCarGenerator(int carGen)==>>DELETE_CAR_GENERATORstatic void SwitchCarGenerator(int carGen, int type_0_101_1000)==>>SWITCH_CAR_GENERATORstatic void DisableCarGenerators(b8 flag0, b8 flag1)==>>DISABLE_CAR_GENERATORSstatic void SetHasBeenOwnedForCarGenerator(int carGen, b8 set)==>>SET_HAS_BEEN_OWNED_FOR_CAR_GENERATORstatic void SetAllCarGeneratorsBackToActive()==>>SET_ALL_CAR_GENERATORS_BACK_TO_ACTIVEstatic void DisableCarGeneratorsWithHeli(bool trueFalse)==>>DISABLE_CAR_GENERATORS_WITH_HELIstatic void SetCarGeneratorsActiveInArea(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, bool set)==>>SET_CAR_GENERATORS_ACTIVE_IN_AREAstatic void GetVehiclePlayerWouldEnter(Player playerIndex, Vehicle *veh)==>>GET_VEHICLE_PLAYER_WOULD_ENTERstatic void GetRandomCarInSphereNoSave(f32 x, f32 y, f32 z, f32 radius, eModel model, b8 flag, Vehicle *car)==>>GET_RANDOM_CAR_IN_SPHERE_NO_SAVEstatic void GetRandomCarModelInMemory(b8 unknownTrue, u32 *pHash, int *p0/*"-1" = error // "> -1" = ok!*/)==>>GET_RANDOM_CAR_MODEL_IN_MEMORYstatic void SetVehInteriorlight(Vehicle vehicle, int value)==>>SET_VEH_INTERIORLIGHTstatic void SetCarLightMultiplier(Vehicle vehicle, float multiplier)==>>SET_CAR_LIGHT_MULTIPLIERstatic void SetVehicleSteerBias(Vehicle vehicle, f32 val)==>>SET_VEHICLE_STEER_BIASstatic int GetCurrentPlaybackNumberForCar(Vehicle veh)==>>GET_CURRENT_PLAYBACK_NUMBER_FOR_CARstatic void SetVehicleAlpha(Vehicle vehicle, int alpha)==>>SET_VEHICLE_ALPHAstatic void SetFollowVehiclePitchLimitUp(f32 uplimit)==>>SET_FOLLOW_VEHICLE_PITCH_LIMIT_UPstatic void GetNumCarLiveries(Vehicle vehicle, int *num)==>>GET_NUM_CAR_LIVERIESstatic void TaskCarDriveToCoordNotAgainstTraffic(Ped ped, Vehicle car, f32 x, f32 y, f32 z, f32 speed, u32 front1_back2, u32 model, u32 drivingstyle, f32 px2, u32 pathIgnoreValue)==>>TASK_CAR_DRIVE_TO_COORD_NOT_AGAINST_TRAFFICstatic int GetVehicleTypeOfModel(eModel model)==>>GET_VEHICLE_TYPE_OF_MODELstatic int GetVehicleModelFromIndex(int index)==>>GET_VEHICLE_MODEL_FROM_INDEXstatic void SetReduceVehicleModelBudget(b8 set)==>>SET_REDUCE_VEHICLE_MODEL_BUDGETstatic void GetCarModelValue(Vehicle car, int *value)==>>GET_CAR_MODEL_VALUE  // Player, Peds (Char)...static void SetCharCollision(Ped ped, b8 collOnOff)==>>SET_CHAR_COLLISIONstatic void SetCharCoordinatesNoOffset(Ped ped, f32 x, f32 y, f32 z)==>>SET_CHAR_COORDINATES_NO_OFFSETstatic void SetUseLegIK(Player playerIndex, bool trueFalse)==>>SET_USE_LEG_IKstatic void TaskShuffleToNextCarSeat(Ped ped, Vehicle vehicle)==>>TASK_SHUFFLE_TO_NEXT_CAR_SEATstatic void SetCharWillLeaveCarInCombat(Ped ped, bool trueFalse)==>>SET_CHAR_WILL_LEAVE_CAR_IN_COMBATstatic void AllowTargetWhenInjured(Ped ped, bool trueFalse)==>>ALLOW_TARGET_WHEN_INJUREDstatic void SetCharMeleeActionFlag0(Ped ped, bool trueFalse)==>>SET_CHAR_MELEE_ACTION_FLAG0static void SetCharMeleeActionFlag1(Ped ped, bool trueFalse)==>>SET_CHAR_MELEE_ACTION_FLAG1static void SetCharMeleeActionFlag2(Ped ped, bool trueFalse)==>>SET_CHAR_MELEE_ACTION_FLAG2static void SetCharStayInCarWhenJacked(Ped ped, bool trueFalse)==>>SET_CHAR_STAY_IN_CAR_WHEN_JACKEDstatic void ResetVisiblePedDamage(Ped ped)==>>RESET_VISIBLE_PED_DAMAGEstatic void SetPlayerKeepsWeaponsWhenRespawned(Player playerIndex)==>>SET_PLAYER_KEEPS_WEAPONS_WHEN_RESPAWNEDstatic void SuppressPedModel(eModel model)==>>SUPPRESS_PED_MODELstatic void RegisterTarget(Ped ped, Ped targetped)==>>REGISTER_TARGETstatic void TaskShootAtChar(Ped shooter, Ped victim, int time, int shootmode)==>>TASK_SHOOT_AT_CHARstatic b8 LocateCharAnyMeansChar3D(Ped anyPed, Ped playerPed, f32 x, f32 y, f32 z, b8 flag)==>>LOCATE_CHAR_ANY_MEANS_CHAR_3Dstatic void BlockCharAmbientAnims(Ped ped, bool onOff)==>>BLOCK_CHAR_AMBIENT_ANIMSstatic void SetCharAngledDefensiveArea(Ped ped, f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz, f32 angle)==>>SET_CHAR_ANGLED_DEFENSIVE_AREAstatic void AttachPedToObject(Ped ped, Object obj, ePedBone bone, f32 X, f32 Y, f32 Z, f32 A, f32 unk0, b8 unk1, b8 unk2)==>>ATTACH_PED_TO_OBJECTstatic b8 LocateCharOnFoot3D(Ped ped, f32 x, f32 y, f32 z, f32 radx, f32 rady, f32 radz, b8 flag)==>>LOCATE_CHAR_ON_FOOT_3Dstatic void SetDrawPlayerComponent(ePedComponent component, b8 set)==>>SET_DRAW_PLAYER_COMPONENTstatic void TaskClimbLadder(Ped ped, bool trueFalse)==>>TASK_CLIMB_LADDERstatic void PanicScream(Ped ped)==>>PANIC_SCREAMstatic void SetCharDiesInstantlyInWater(Ped ped, b8 allow)==>>SET_CHAR_DIES_INSTANTLY_IN_WATERstatic void SetPedForceVisualiseHeadDamageFromBullets(Ped ped, b8 set)==>>SET_PED_FORCE_VISUALISE_HEAD_DAMAGE_FROM_BULLETSstatic void SetPedGeneratesDeadBodyEvents(Ped ped, b8 set)==>>SET_PED_GENERATES_DEAD_BODY_EVENTSstatic void SetPedDontDoEvasiveDives(Ped ped, b8 set)==>>SET_PED_DONT_DO_EVASIVE_DIVESstatic void SetCharMoveAnimSpeedMultiplier(Ped ped, f32 multiplier)==>>SET_CHAR_MOVE_ANIM_SPEED_MULTIPLIERstatic void SetAmbientVoiceName(Ped ped, char *name)==>>SET_AMBIENT_VOICE_NAMEstatic void GetScriptTaskStatus(Ped ped, int task, int *status)==>>GET_SCRIPT_TASK_STATUSstatic void GetCharHighestPriorityEvent(Ped ped, int *eventid)==>>GET_CHAR_HIGHEST_PRIORITY_EVENTstatic b8 GetCharAnimIsEvent(Ped ped, char *AnimName0, char *AnimName1, b8 flag)==>>GET_CHAR_ANIM_IS_EVENTstatic b8 IsCharRespondingToAnyEvent(Ped ped)==>>IS_CHAR_RESPONDING_TO_ANY_EVENTstatic b8 IsCharRespondingToEvent(Ped ped, int eventid)==>>IS_CHAR_RESPONDING_TO_EVENTstatic void SetAllRandomPedsFlee(Player playerIndex, b8 set)==>>SET_ALL_RANDOM_PEDS_FLEEstatic void SetPedWillUseCover(Ped ped, b8 set)==>>SET_CHAR_WILL_USE_COVERstatic void GetPedType(Ped ped, u32 *u32Type)==>>GET_PED_TYPE// Objects & Doorsstatic void SetObjectAlpha(Object obj, int alpha)==>>SET_OBJECT_ALPHAstatic void SetObjectHealth(Object obj, f32 health)==>>SET_OBJECT_HEALTHstatic void SetObjectRotation(Object obj, f32 rotax, f32 rotay, f32 rotaz)==>>SET_OBJECT_ROTATIONstatic void SetObjectOnlyDamagedByPlayer(Object obj, b8 damOnOff)==>>SET_OBJECT_ONLY_DAMAGED_BY_PLAYERstatic void SlideObject(Object obj, f32 x, f32 y, f32 z, f32 xspeed, f32 yspeed, f32 zspeed, int one)==>>SLIDE_OBJECTstatic void StartPtfxOnObj(const ch *fxName, Object obj, f32 x, f32 y, f32 z, f32 xspeed, f32 yspeed, f32 zspeed, f32 radius)==>>START_PTFX_ON_OBJstatic void TriggerPtfxOnObj(const ch *fxName, Object obj, f32 x, f32 y, f32 z, f32 xspeed, f32 yspeed, f32 zspeed, f32 radius)==>>TRIGGER_PTFX_ON_OBJstatic void SetObjectProofs(Object object, b8 bulletProof, b8 fireProof, b8 explosionProof, b8 collisionProof, b8 meleeProof)==>>SET_OBJECT_PROOFSstatic void RotateObject(Object obj, float angle, float rotSpeed, int nullEins)==>>ROTATE_OBJECTstatic void GetClosestStealableObject(f32 x, f32 y, f32 z, f32 radius, Object *obj)==>>GET_CLOSEST_STEALABLE_OBJECTstatic void SetObjectScale(Object obj, f32 scale)==>>SET_OBJECT_SCALEstatic void GetStateOfClosestDoorOfType(u32 model, f32 x, f32 y, f32 z, b8 *lock, f32 *doorswing)==>>GET_STATE_OF_CLOSEST_DOOR_OF_TYPEstatic void SetStateOfClosestDoorOfType(u32 model, f32 x, f32 y, f32 z, b8 lock, f32 doorswing)==>>SET_STATE_OF_CLOSEST_DOOR_OF_TYPEstatic void FindNearestCollectableBinBags(f32 x, f32 y, f32 z)==>>FIND_NEAREST_COLLECTABLE_BIN_BAGSstatic void FindNearestEntitiesWithSpecialAttribute(f32 x, f32 y, f32 z)==>>FIND_NEAREST_ENTITIES_WITH_SPECIAL_ATTRIBUTEstatic b8 LookAtNearbyEntityWithSpecialAttribute(i32 unkZero, Vector3 *pCoord, f32 *unkFloat, i32 *unkFlag, u32 *pModelHash, f32 *pRotation)==>>LOOK_AT_NEARBY_ENTITY_WITH_SPECIAL_ATTRIBUTEstatic void GrabNearbyObjectWithSpecialAttribute(i32 unkZero, Object *pObj)==>>GRAB_NEARBY_OBJECT_WITH_SPECIAL_ATTRIBUTEstatic void SetObjectQuaternion(Object obj, f32 x, f32 y, f32 z, f32 a)==>>SET_OBJECT_QUATERNIONstatic b8 HasCollisionForModelLoaded(eModel model)==>>HAS_COLLISION_FOR_MODEL_LOADEDstatic void RequestCollisionForModel(eModel model)==>>REQUEST_COLLISION_FOR_MODELstatic void SetLoadCollisionForObjectFlag(Object obj, b8 set)==>>SET_LOAD_COLLISION_FOR_OBJECT_FLAGstatic void SetVisibilityOfClosestObjectOfType(f32 x, f32 y, f32 z, f32 radius, eModel typeOfModel, b8 set)==>>SET_VISIBILITY_OF_CLOSEST_OBJECT_OF_TYPEstatic void EnableDisabledAttractorsOnObject(Object obj, b8 enable)==>>ENABLE_DISABLED_ATTRACTORS_ON_OBJECTstatic void GetObjectQuaternion(Object obj, f32 *x, f32 *y, f32 *z, f32 *a)==>>GET_OBJECT_QUATERNIONstatic void SetObjectDynamic(Object obj, b8 set)==>>SET_OBJECT_DYNAMICstatic void AttachObjectToObject(Object obj, Object obj_attach_to, int side, f32 x0, f32 y0, f32 z0, f32 x1, f32 y1, f32 z1)==>>ATTACH_OBJECT_TO_OBJECTstatic void RemoveProjtexFromObject(Object obj)==>>REMOVE_PROJTEX_FROM_OBJECTstatic void GivePedAmbientObject(Ped ped, eModel model)==>>GIVE_PED_AMBIENT_OBJECTstatic void AnchorObject(Object obj, b8 anchor, u32 flags)==>>ANCHOR_OBJECTstatic b8 DoesObjectHaveThisModel(Object obj, eModel model)==>>DOES_OBJECT_HAVE_THIS_MODEL// Effects (Light, PTFX)...static void DrawLightWithRange(f32 x, f32 y, f32 z, int r, int g, int b, f32 radius, f32 intensity)==>>DRAW_LIGHT_WITH_RANGEstatic b8 TriggerPtfxOnPedBone(const ch *fxName, Ped ped, f32 x, f32 y, f32 z, f32 xspeed, f32 yspeed, f32 zspeed, ePedBone bone, u32 flags)==>>TRIGGER_PTFX_ON_PED_BONEstatic void TriggerPtfxOnPed(const ch *fxName, Ped ped, f32 x, f32 y, f32 z, f32 xspeed, f32 yspeed, f32 zspeed, f32 radius)==>>TRIGGER_PTFX_ON_PEDstatic void RemovePtfxFromPed(Player playerIndex)==>>REMOVE_PTFX_FROM_PEDstatic void StartPtfx(const ch *fxName, f32 x, f32 y, f32 z, f32 xspeed, f32 yspeed, f32 zspeed, f32 radius)==>>START_PTFXstatic void TriggerPtfx(const ch *fxName, f32 x, f32 y, f32 z, f32 xspeed, f32 yspeed, f32 zspeed, f32 radius)==>>TRIGGER_PTFXstatic int StartPtfxOnPedBone(const ch *fxName, Ped ped, f32 x, f32 y, f32 z, f32 xspeed, f32 yspeed, f32 zspeed, ePedBone bone, u32 flags)==>>START_PTFX_ON_PED_BONEstatic void SetObjectLights(Object obj, b8 lights)==>>SET_OBJECT_LIGHTSstatic void SetTaxiLights(Vehicle vehicle, b8 set)==>>SET_TAXI_LIGHTSstatic void EnableDeferredLighting(b8 enable)==>>ENABLE_DEFERRED_LIGHTINGstatic void RemovePtfx(const ch *fxName)==>>REMOVE_PTFXstatic void RemovePtfxFromObject(Object obj)==>>REMOVE_PTFX_FROM_OBJECTstatic void RemovePtfxFromVehicle(Vehicle veh)==>>REMOVE_PTFX_FROM_VEHICLEstatic void StopPtfx(const ch *fxName)==>>STOP_PTFXstatic void UpdatePtfxOffsets(const ch *fxName, f32 x, f32 y, f32 z, f32 xspeed, f32 yspeed, f32 zspeed)==>>UPDATE_PTFX_OFFSETSstatic void UpdatePtfxTint(const ch *fxName, f32 red, f32 green, f32 blue, f32 alpha)==>>UPDATE_PTFX_TINTstatic void EvolvePtfx(const ch *fxName, char *evolvetype, f32 val)==>>EVOLVE_PTFXstatic void SetTimeCycleModifier(char *name)==>>SET_TIMECYCLE_MODIFIER// Blip, Sphere, Pickups, Checkpoint, Texture, Draw, Spritestatic void AddSphere(f32 x, f32 y, f32 z, f32 radius, int unknow)==>>ADD_SPHEREstatic int AddNEWSphere(f32 x, f32 y, f32 z, f32 radius, u32 unknow)==>>ADD_SPHEREstatic void RemoveNEWSphere(u32 sphere)==>>REMOVE_SPHEREstatic void RemoveSphere(const ch *sphere)==>>REMOVE_SPHEREstatic void DrawColouredCylinder(f32 x, f32 y, f32 z, f32 hoch, f32 breit, int col_red, int col_green, int col_blue, int alpha)==>>DRAW_COLOURED_CYLINDERstatic void CreatePickupRot(eModel model, u32 pickupType, u32 unknown, f32 x, f32 y, f32 z, f32 rX, f32 rY, f32 rZ, Pickup *pPickup)==>>CREATE_PICKUP_ROTATEstatic void SetPoliceRadarBlips(b8 onOff)==>>SET_POLICE_RADAR_BLIPSstatic void AddPickupToInteriorRoomByKey(Pickup pickup, eInteriorRoomKey roomKey)==>>ADD_PICKUP_TO_INTERIOR_ROOM_BY_KEYstatic u32 CreateCheckpoint(int type, f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 one)==>>CREATE_CHECKPOINTstatic void DeleteCheckpoint(u32 checkpoint)==>>DELETE_CHECKPOINTstatic void DrawCheckpoint(f32 x, f32 y, f32 z, f32 radius, int red, int green, int blue)==>>DRAW_CHECKPOINTstatic void DrawCheckpointWithAlpha(f32 x, f32 y, f32 z, f32 radius, int red, int green, int blue, int alpha)==>>DRAW_CHECKPOINT_WITH_ALPHAstatic void DrawSphere(f32 x, f32 y, f32 z, f32 radius)==>>DRAW_SPHEREstatic void DrawToplevelSprite(Texture texture, f32 u1, f32 u2, f32 u3, f32 u4, f32 angle, int red, int green, int blue, int alpha)==>>DRAW_TOPLEVEL_SPRITEstatic void DrawSpriteWithUV(Texture texture, f32 u1, f32 u2, f32 u3, f32 u4, f32 angle, int red, int green, int blue, int alpha)==>>DRAW_SPRITE_WITH_UVstatic void DrawSpriteFrontBuff(f32 x0, f32 y0, f32 x1, f32 y1, f32 rotation, int red, int green, int blue, int alpha)==>>DRAW_SPRITE_FRONT_BUFFstatic void DrawSpritePhoto(f32 x0, f32 y0, f32 x1, f32 y1, f32 rotation, int red, int green, int blue, int alpha)==>>DRAW_SPRITE_PHOTOstatic void GetTextureResolution(Texture texture, f32 *x, f32 *y)==>>GET_TEXTURE_RESOLUTIONstatic void SetPedHelmetTextureIndex(Ped ped, int index)==>>SET_PED_HELMET_TEXTURE_INDEXstatic void SetBlipMarkerLongDistance(Blip blip, b8 set)==>>SET_BLIP_MARKER_LONG_DISTANCEstatic void DrawSpriteWithUVCoords(Texture texture, f32 u1, f32 u2, f32 u3, f32 u4, f32 ux, f32 uy, f32 uz, f32 angle, int red, int green, int blue, int alpha)==>>DRAW_SPRITE_WITH_UV_COORDSstatic void DrawSpriteWithFixedRotation(Texture texture, f32 u1, f32 u2, f32 u3, f32 u4, f32 angle, int red, int green, int blue, int alpha)==>>DRAW_SPRITE_WITH_FIXED_ROTATIONstatic void ToggleToplevelSprite(b8 toggle)==>>TOGGLE_TOPLEVEL_SPRITEstatic void SetSpritesDrawBeforeFade(b8 set)==>>SET_SPRITES_DRAW_BEFORE_FADE// Diverse, World, Script, Room, Water...static b8 IsControlPressed(int nullZwei, int sysKey)==>>IS_CONTROL_PRESSEDstatic b8 DoesScriptExist(const ch *scriptName)==>>DOES_SCRIPT_EXISTstatic void RequestScript(const ch *scriptName)==>>REQUEST_SCRIPTstatic void SetThisScriptCanRemoveBlipsCreatedByAnyScript(b8 reBlip)==>>SET_THIS_SCRIPT_CAN_REMOVE_BLIPS_CREATED_BY_ANY_SCRIPTstatic void TerminateAllScriptsWithThisName(const ch *scriptName)==>>TERMINATE_ALL_SCRIPTS_WITH_THIS_NAMEstatic void GetWaterHeight(f32 x, f32 y, f32 z, f32 *height)==>>GET_WATER_HEIGHTstatic void LoadPathNodesInArea(f32 x1, f32 y1, f32 x2, f32 y2)==>>LOAD_PATH_NODES_IN_AREAstatic void ReleasePathNodes()==>>RELEASE_PATH_NODESstatic void UpdateLoadScene()==>>UPDATE_LOAD_SCENEstatic void TurnOffRadioHUDInLobby()==>>TURN_OFF_RADIOHUD_IN_LOBBYstatic void SetPedNonCreationArea(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2)==>>SET_PED_NON_CREATION_AREAstatic void LoadSceneForRoomByKey(Interior interior, eInteriorRoomKey roomKey)==>>LOAD_SCENE_FOR_ROOM_BY_KEYstatic void SetRoomForCarByKey(Vehicle car, eInteriorRoomKey key)==>>SET_ROOM_FOR_CAR_BY_KEYstatic void SetRoomForViewportByKey(int viewportid, eInteriorRoomKey key)==>>SET_ROOM_FOR_VIEWPORT_BY_KEYstatic void SetMinigameInProgress(b8 onOff)==>>SET_MINIGAME_IN_PROGRESSstatic u32 StartNewScript(const ch *scriptName, u32 stacksize)==>>START_NEW_SCRIPTstatic void AllocateScriptToObject(const ch *scriptName, u32 model, int unk, float radius, int UnkTime)==>>ALLOCATE_SCRIPT_TO_OBJECTstatic b8 IsModelInCDImage(eModel model)==>>IS_MODEL_IN_CDIMAGEstatic void SwapNearestBuildingModel(f32 x, f32 y, f32 z, f32 radius, eModel fromModel, eModel toModel)==>>SWAP_NEAREST_BUILDING_MODELstatic void RegisterWorldPointScriptBrain(char *scriptName, f32 radius)==>>REGISTER_WORLD_POINT_SCRIPT_BRAINstatic void SwitchRoadsOff(f32 x0, f32 y0, f32 z0, f32 x1, f32 y1, f32 z1)==>>SWITCH_ROADS_OFFstatic void SwitchRoadsOn(f32 x0, f32 y0, f32 z0, f32 x1, f32 y1, f32 z1)==>>SWITCH_ROADS_ONstatic void SetNextDesiredMoveState(int state)==>>SET_NEXT_DESIRED_MOVE_STATEstatic f32 CalculateTravelDistanceBetweenNodes(f32 x0, f32 y0, f32 z0, f32 x1, f32 y1, f32 z1)==>>CALCULATE_TRAVEL_DISTANCE_BETWEEN_NODESstatic f32 Vdist(f32 x0, f32 y0, f32 z0, f32 x1, f32 y1, f32 z1)==>>VDISTstatic f32 Vdist2(f32 x0, f32 y0, f32 z0, f32 x1, f32 y1, f32 z1)==>>VDIST2static void SetCarDistanceAheadMultiplier(Vehicle veh, f32 multiplier)==>>SET_CAR_DISTANCE_AHEAD_MULTIPLIERstatic void SetHintMoveInDist(f32 dist)==>>SET_HINT_MOVE_IN_DISTstatic void SetHintMoveInDistDefault()==>>SET_HINT_MOVE_IN_DIST_DEFAULTstatic b8 SynchRecordingWithWater()==>>SYNCH_RECORDING_WITH_WATERstatic b8 GetWaterHeightNoWaves(f32 x, f32 y, f32 z, f32 *height)==>>GET_WATER_HEIGHT_NO_WAVESstatic b8 GetCharWillTryToLeaveWater(Ped ped)==>>GET_CHAR_WILL_TRY_TO_LEAVE_WATERstatic void SetCharWillTryToLeaveWater(Ped ped, b8 set)==>>SET_CHAR_WILL_TRY_TO_LEAVE_WATERstatic void SetCharDrownsInWater(Ped ped, b8 set)==>>SET_CHAR_DROWNS_IN_WATERstatic void SetCharMaxTimeUnderwater(Ped ped, f32 time)==>>SET_CHAR_MAX_TIME_UNDERWATERstatic void SetCharMaxTimeInWater(Ped ped, f32 time)==>>SET_CHAR_MAX_TIME_IN_WATERstatic void EnableFancyWater(b8 enable)==>>ENABLE_FANCY_WATERstatic void SetCarWatertight(Vehicle car, b8 set)==>>SET_CAR_WATERTIGHTstatic void SetSyncWeatherAndGameTime(b8 set)==>>SET_SYNC_WEATHER_AND_GAME_TIMEstatic int Round(f32 value)==>>ROUND// Conversationstatic void PauseScriptedConversation(b8 pause)==>>PAUSE_SCRIPTED_CONVERSATIONstatic b8 IsScriptedConversationOngoing()==>>IS_SCRIPTED_CONVERSATION_ONGOINGstatic int AbortScriptedConversation(b8 abort)==>>ABORT_SCRIPTED_CONVERSATIONstatic int GetCurrentScriptedConversationLine()==>>GET_CURRENT_SCRIPTED_CONVERSATION_LINEstatic void AddLineToScriptedConversation(u32 conversation, int unk1, int unk2)==>>ADD_LINE_TO_SCRIPTED_CONVERSATIONstatic void PlayScriptedConversationFrontend(b8 play)==>>PLAY_SCRIPTED_CONVERSATION_FRONTENDstatic void DontAbortCarConversations(b8 flag0, b8 flag1)==>>DONT_ABORT_CAR_CONVERSATIONSstatic void AddNewFrontendConversationSpeaker(int unk1, int unk2)==>>ADD_NEW_FRONTEND_CONVERSATION_SPEAKERstatic void AddNewConversationSpeaker(int id, int unk, int *pUnk)==>>ADD_NEW_CONVERSATION_SPEAKERstatic void NewScriptedConversation()==>>NEW_SCRIPTED_CONVERSATIONstatic void StartScriptConversation(b8 flag0, b8 flag1)==>>START_SCRIPT_CONVERSATIONstatic void AllowAutoConversationLookats(Ped ped, b8 allow)==>>ALLOW_AUTO_CONVERSATION_LOOKATSstatic void TaskMobileConversation(Ped ped, int unk_null)==>>TASK_MOBILE_CONVERSATIONstatic void RestartScriptedConversation()==>>RESTART_SCRIPTED_CONVERSATIONstatic void SkipToNextScriptedConversationLine()==>>SKIP_TO_NEXT_SCRIPTED_CONVERSATION_LINE// Traffic Control & SpeedUpstatic void SetCarDensityMultiplier(f32 CarDensity)==>>SET_CAR_DENSITY_MULTIPLIERstatic void SetPedDensityMultiplier(f32 PedDensity)==>>SET_PED_DENSITY_MULTIPLIERstatic void SetRandomCarDensityMultiplier(f32 RandomCarDensity)==>>SET_RANDOM_CAR_DENSITY_MULTIPLIERstatic void SetParkedCarDensityMultiplier(f32 CarDensity)==>>SET_PARKED_CAR_DENSITY_MULTIPLIERstatic void DontSuppressCarModel(eModel carmodel)==>>DONT_SUPPRESS_CAR_MODELstatic void DontSuppressAnyCarModel()==>>DONT_SUPPRESS_CAR_MODELstatic void ForceRandomCarModel(eModel carmodel)==>>FORCE_RANDOM_CAR_MODELstatic void DontSuppressPedModel(eModel pedmodel)==>>DONT_SUPPRESS_PED_MODELstatic void DontSuppressAnyPedModels()==>>DONT_SUPPRESS_ANY_PED_MODELSstatic void AddAdditionalPopulationModel(eModel popmodel)==>>ADD_ADDITIONAL_POPULATION_MODELstatic void RemoveAdditionalPopulationModel(eModel popmodel)==>>REMOVE_ADDITIONAL_POPULATION_MODEL// Emergency, Police & Undercoverstatic void PlaySoundFromVehicle(eSound sound, ch *soundName, Vehicle vehicle)==>>PLAY_SOUND_FROM_VEHICLEstatic void SwitchCarSiren(Vehicle vehicle, b8 sirenOnOff)==>>SWITCH_CAR_SIRENstatic void SetSirenWithNoDriver(Vehicle vehicle, b8 sirenOnOff)==>>SET_SIREN_WITH_NO_DRIVERstatic b8 CreateEmergencyServicesCarReturnDriver(eModel modelPolCar, f32 x, f32 y, f32 z, Vehicle *vehiclePolCar, Ped *char1, Ped *char2)==>>CREATE_EMERGENCY_SERVICES_CAR_RETURN_DRIVERstatic void CreateEmergencyServicesCarThenWalk(eModel modelPolCar, f32 x, f32 y, f32 z)==>>CREATE_EMERGENCY_SERVICES_CAR_THEN_WALKstatic void SetMaxWantedLevel(int wantedLevel)==>>SET_MAX_WANTED_LEVELstatic void SetZoneNoCops(const ch *name, b8 set)==>>SET_ZONE_NO_COPSstatic void SetPlayerAsCop(Player player, b8 set)==>>SET_PLAYER_AS_COPstatic void SetCreateRandomCops(b8 set)==>>SET_CREATE_RANDOM_COPSstatic b8 IsCopVehicleInArea3DNoSave(f32 x0, f32 y0, f32 z0, f32 x1, f32 y1, f32 z1)==>>IS_COP_VEHICLE_IN_AREA_3D_NO_SAVEstatic b8 IsCopPedInArea3DNoSave(f32 x0, f32 y0, f32 z0, f32 x1, f32 y1, f32 z1)==>>IS_COP_PED_IN_AREA_3D_NO_SAVEstatic void SwitchPoliceHelis(b8 set)==>>SWITCH_POLICE_HELIS// Camerastatic void ActivateScriptedCams(int highDOF, int highDOF2)==>>ACTIVATE_SCRIPTED_CAMSstatic void AttachCamToPed(Camera camera, Ped ped)==>>ATTACH_CAM_TO_PEDstatic void SetCamAttachOffset(Camera camera, f32 xoff, f32 yoff, f32 zoff)==>>SET_CAM_ATTACH_OFFSETstatic void SetCamAttachOffsetIsRelative(Camera camera, bool onOff)==>>SET_CAM_ATTACH_OFFSET_IS_RELATIVEstatic void PointCamAtPed(Camera camera, Ped ped)==>>POINT_CAM_AT_PEDstatic void SetCamPointOffset(Camera camera, f32 xoff, f32 yoff, f32 zoff)==>>SET_CAM_POINT_OFFSETstatic void SetCamPointOffsetIsRelative(Camera camera, bool onOff)==>>SET_CAM_POINT_OFFSET_IS_RELATIVEstatic void AttachCamToObject(Camera camera, Object obj)==>>ATTACH_CAM_TO_OBJECTstatic void PointCamAtObject(Camera camera, Object obj)==>>POINT_CAM_AT_PEDstatic void SetDrunkCam(Camera camera, f32 effect, u32 time)==>>SET_DRUNK_CAMstatic void ForceGameTelescopeCam(b8 force)==>>FORCE_GAME_TELESCOPE_CAMstatic void SetCamSplineSpeedGraph(Camera camera, int graph)==>>SET_CAM_SPLINE_SPEED_GRAPHstatic void SetCamSplineCustomSpeedGraph(f32 speed)==>>SET_CAM_SPLINE_CUSTOM_SPEED_GRAPHstatic void ResetCamSplineCustomSpeedGraph()==>>RESET_CAM_SPLINE_CUSTOM_SPEED_GRAPHstatic void SetCamInterpCustomSpeedGraph(f32 speed)==>>SET_CAM_INTERP_CUSTOM_SPEED_GRAPHstatic void ResetCamInterpCustomSpeedGraph()==>>RESET_CAM_INTERP_CUSTOM_SPEED_GRAPHstatic void CamSequenceOpen(int sequence)==>>CAM_SEQUENCE_OPENstatic void CamSequenceStart(int sequence)==>>CAM_SEQUENCE_STARTstatic void CamSequenceWait(int sequence, u32 time)==>>CAM_SEQUENCE_WAITstatic b8 IsCamSequenceComplete(int sequence)==>>IS_CAM_SEQUENCE_COMPLETEstatic void CamSequenceRemove(int sequence)==>>CAM_SEQUENCE_REMOVEstatic void CamSequenceStop(int sequence)==>>CAM_SEQUENCE_STOPstatic void CamSequenceClose()==>>CAM_SEQUENCE_CLOSEstatic void SetCamRoll(Camera camera, f32 roll)==>>SET_CAM_ROLLstatic void BeginCamCommands(int *num)==>>BEGIN_CAM_COMMANDSstatic void EndCamCommands(int *num)==>>END_CAM_COMMANDSstatic void CamSetCinematic(Vehicle veh, b8 set)==>>CAM_SET_CINEMATICstatic void GetCinematicCam(Camera *camera)==>>GET_CINEMATIC_CAMstatic void ForceNoCamPause(b8 force)==>>FORCE_NO_CAM_PAUSEstatic void GetFreeCam(Camera *camera)==>>GET_FREE_CAMstatic void UnattachCam(Camera camera)==>>UNATTACH_CAMstatic void SetCamMotionBlur(Camera camera, f32 blur)==>>SET_CAM_MOTION_BLURstatic void GetCamMotionBlur(Camera camera, int *blur)==>>GET_CAM_MOTION_BLURstatic void SetViewportShape(Camera camera, int shape)==>>SET_VIEWPORT_SHAPEstatic void DestroyAllCams()==>>DESTROY_ALL_CAMSstatic void EnableCamCollision(Camera camera, b8 onOff)==>>ENABLE_CAM_COLLISIONstatic void SetGameCameraControlsActive(b8 onOff)==>>SET_GAME_CAMERA_CONTROLS_ACTIVEstatic void GetRootCam(Camera *camera)==>>GET_ROOT_CAM// Text & GXTstatic void ClearHelp()==>>CLEAR_HELPstatic b8 IsThisHelpMessageBeingDisplayed(const ch *gxtName)==>>IS_THIS_HELP_MESSAGE_BEING_DISPLAYEDstatic void DrawCurvedWindow(f32 x, f32 y, f32 width, f32 height, u32 alpha)==>>DRAW_CURVED_WINDOWstatic void DrawCurvedWindowText(f32 x, f32 y, f32 unk, int unk1, int unk2, const ch *gxtName, const ch *text, int unk3)==>>DRAW_CURVED_WINDOW_TEXTstatic void DrawCurvedWindowNotext(f32 x, f32 y, f32 width, f32 height, u32 alpha)==>>DRAW_CURVED_WINDOW_NOTEXTstatic void DrawWindowText(f32 x, f32 y, f32 unk, int unk1, const ch *text, int unk2)==>>DRAW_WINDOW_TEXTstatic void PrintStringWithTwoLiteralStringsNow(const ch *gxtName, const char *text1, const char *text2, u32 timeMS, int flag)==>>PRINT_STRING_WITH_TWO_LITERAL_STRINGS_NOWstatic void PrintWith3NumbersNow(const ch *gxtName, int num1, int num2, int num3, u32 timeMS, int flag)==>>PRINT_WITH_3_NUMBERS_NOWstatic void PrintWith4NumbersNow(const ch *gxtName, int num1, int num2, int num3, int num4, u32 timeMS, int flag)==>>PRINT_WITH_4_NUMBERS_NOWstatic void PrintWith5NumbersNow(const ch *gxtName, int num1, int num2, int num3, int num4, int num5, u32 timeMS, int flag)==>>PRINT_WITH_5_NUMBERS_NOWstatic void PrintWith6NumbersNow(const ch *gxtName, int num1, int num2, int num3, int num4, int num5, int num6, u32 timeMS, int flag)==>>PRINT_WITH_6_NUMBERS_NOWstatic void DrawFrontendHelperText(const ch *tName, const ch *text, b8 set)==>>DRAW_FRONTEND_HELPER_TEXTstatic void DisplayTextWithSubstringGivenHashKey(f32 x, f32 y, const ch *gtxName, u32 gtxhash)==>>DISPLAY_TEXT_WITH_SUBSTRING_GIVEN_HASH_KEYstatic void SetNmMessageInstanceIndex(u32 valueid, u32 ped, u32 car, u32 obj)==>>SET_NM_MESSAGE_INSTANCE_INDEXstatic void ClearPrints()==>>CLEAR_PRINTS// NETWORK, Multiplayer...static b8 IsNetworkPlayerActive(u32 playerId)==>>IS_NETWORK_PLAYER_ACTIVEstatic void NetworkKickPlayer(u32 playerId)==>>NETWORK_KICK_PLAYERstatic void NetworkKickPlayer2(u32 playerId, b8 yesNo)==>>NETWORK_KICK_PLAYERstatic void GivePedFakeNetworkName(Ped ped, char *name, u32 red, u32 green, u32 blue, u32 alpha)==>>GIVE_PED_FAKE_NETWORK_NAMEstatic void UsePlayerColourInsteadOfTeamColour(b8 yesNo)==>>USE_PLAYER_COLOUR_INSTEAD_OF_TEAM_COLOURstatic void SetPlayerIconColour(int color)==>>SET_PLAYER_ICON_COLOURstatic void ThisScriptIsSafeForNetworkGame()==>>THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAMEstatic b8 IsNetworkSession()==>>IS_NETWORK_SESSION// Weaponsstatic void GiveDelayedWeaponToChar(Ped ped, eWeapon weapon, int delay, bool flag)==>>GIVE_DELAYED_WEAPON_TO_CHARstatic void SetCharCurrentWeaponVisible(Ped ped, b8 visible)==>>SET_CHAR_CURRENT_WEAPON_VISIBLEstatic void GetWeapontypeModel(eWeapon weapon, eModel *model)==>>GET_WEAPONTYPE_MODEL// Anims & Screenstatic b8 HasCharAnimFinished(Ped ped, ch *animSet, ch *animName)==>>HAS_CHAR_ANIM_FINISHEDstatic void SetWidescreenBorders(b8 onOff)==>>SET_WIDESCREEN_BORDERSstatic void SetInstantWidescreenBorders(b8 onOff)==>>SET_INSTANT_WIDESCREEN_BORDERSstatic b8 IsSittingObjectNear(f32 x, f32 y, f32 z, int model_or_null)==>>IS_SITTING_OBJECT_NEARstatic void TaskSitDownOnSeat(Ped ped, int u1, int u2, f32 x, f32 y, f32 z, f32 a, int minus2)==>>TASK_SIT_DOWN_ON_SEATstatic void TaskSitDownOnNearestObject(Ped ped, int u1, int u2, f32 x, f32 y, f32 z, int model_or_null, f32 a, int minus2, int one)==>>TASK_SIT_DOWN_ON_NEAREST_OBJECTstatic void ClearNewsScrollbar()==>>CLEAR_NEWS_SCROLLBARstatic void AddStringToNewsScrollbar(const ch *newsScrollText)==>>ADD_STRING_TO_NEWS_SCROLLBARstatic void ChangeCharSitIdleAnim(Ped ped, const ch *animSet, const ch *animName, int oneOrNull)==>>CHANGE_CHAR_SIT_IDLE_ANIMstatic void TaskPlayAnimNonInterruptable(Ped ped, const ch *animName, const ch *animSet, f32 unk1, int RepeatIsONE, int unk2, int unk3, int unk4, int unk5)==>>TASK_PLAY_ANIM_NON_INTERRUPTABLEstatic void SetAnimGroupForChar(Ped ped, char *groupname)==>>SET_ANIM_GROUP_FOR_CHARstatic b8 PlayCarAnim(Vehicle car, const ch *animName, const ch *animSet, f32 unknown0, b8 flag0, b8 flag1)==>>PLAY_CAR_ANIMstatic b8 IsCarPlayingAnim(Vehicle car, const ch *animName, const ch *animSet)==>>IS_CAR_PLAYING_ANIMstatic void StopSyncingScriptAnimations(b8 set)==>>STOP_SYNCING_SCRIPT_ANIMATIONSstatic b8 PlayObjectAnim(Object obj, const ch *animName, const ch *animSet, f32 unknown0, b8 flag0, b8 flag1)==>>PLAY_OBJECT_ANIMstatic void SetObjectAnimCurrentTime(Object obj, char *animName, char *animSet, f32 time)==>>SET_OBJECT_ANIM_CURRENT_TIMEstatic void SetObjectAnimPlayingFlag(Object obj, char *animName, char *animSet, b8 flag)==>>SET_OBJECT_ANIM_PLAYING_FLAGstatic void SetObjectAnimSpeed(Object obj, char *animName, char *animSet, f32 speed)==>>SET_OBJECT_ANIM_SPEEDstatic void GetObjectAnimCurrentTime(Object obj, char *animName, char *animSet, f32 *time)==>>GET_OBJECT_ANIM_CURRENT_TIMEstatic void GetObjectAnimTotalTime(Object obj, char *animName, char *animSet, f32 *time)==>>GET_OBJECT_ANIM_TOTAL_TIME// Cutscene & Scenestatic void ClearNamedCutscene(char *name)==>>CLEAR_NAMED_CUTSCENEstatic void InitCutscene(char *name)==>>INIT_CUTSCENEstatic void StopCutscene()==>>STOP_CUTSCENEstatic void StartCutscene()==>>START_CUTSCENEstatic void ClearCutscene()==>>CLEAR_CUTSCENEstatic b8 IsPedInCutsceneBlockingBounds(Ped ped)==>>IS_PED_IN_CUTSCENE_BLOCKING_BOUNDSstatic b8 IsPosInCutsceneBlockingBounds(f32 x, f32 y, f32 z)==>>IS_POS_IN_CUTSCENE_BLOCKING_BOUNDSstatic b8 IsPlayerReadyForCutscene(Player playerIndex)==>>IS_PLAYER_READY_FOR_CUTSCENEstatic void StartCutsceneNow(const ch *cutsceneName)==>>START_CUTSCENE_NOWstatic int GetCutsceneAudioTimeMs()==>>GET_CUTSCENE_AUDIO_TIME_MSstatic int GetCutsceneTime()==>>GET_CUTSCENE_TIMEstatic int GetCutsceneSectionPlaying()==>>GET_CUTSCENE_SECTION_PLAYINGstatic b8 HasCutsceneFinished()==>>HAS_CUTSCENE_FINISHEDstatic b8 WasCutsceneSkipped()==>>WAS_CUTSCENE_SKIPPEDstatic b8 HasCutsceneLoaded()==>>HAS_CUTSCENE_LOADEDstatic void SetCutsceneExtraRoomPos(f32 x, f32 y, f32 z)==>>SET_CUTSCENE_EXTRA_ROOM_POSstatic void GetCutscenePedPosition(Ped ped, Vector3 *pos)==>>GET_CUTSCENE_PED_POSITIONstatic void HideCharWeaponForScriptedCutscene(Ped ped, b8 hide)==>>HIDE_CHAR_WEAPON_FOR_SCRIPTED_CUTSCENEstatic void SetCarInCutscene(Vehicle car, b8 set)==>>SET_CAR_IN_CUTSCENEstatic void ExplodeCarInCutscene(Vehicle car, b8 explode)==>>EXPLODE_CAR_IN_CUTSCENEstatic void ExplodeCarInCutsceneShakeAndBit(Vehicle car, b8 flag0, b8 flag1, b8 flag2)==>>EXPLODE_CAR_IN_CUTSCENE_SHAKE_AND_BITstatic void MakePlayerSafeForCutscene(Player playerIndex)==>>MAKE_PLAYER_SAFE_FOR_CUTSCENEstatic void SetCharInCutscene(Ped ped, b8 set)==>>SET_CHAR_IN_CUTSCENE// Sound & Audio & Radio & TV & Movie & Stream & Cell Phonestatic void PlayAudioEventFromPed(const ch *audioName, Ped ped)==>>PLAY_AUDIO_EVENT_FROM_PEDstatic void PlayAudioEventFromVehicle(const ch *audioName, Vehicle veh)==>>PLAY_AUDIO_EVENT_FROM_VEHICLEstatic void PlayAudioEventFromObject(const ch *audioName, Object obj)==>>PLAY_AUDIO_EVENT_FROM_OBJECTstatic void MutePositionedRadio(b8 yesNo)==>>MUTE_POSITIONED_RADIOstatic void MuteGameworldAndPositionedRadioForTv(b8 yesNo)==>>MUTE_GAMEWORLD_AND_POSITIONED_RADIO_FOR_TVstatic void MuteGameworldAudio(b8 yesNo)==>>MUTE_GAMEWORLD_AUDIOstatic void RegisterScriptWithAudio(b8 one)==>>REGISTER_SCRIPT_WITH_AUDIOstatic void SetMobileRadioEnabledDuringGameplay(b8 onOff)==>>SET_MOBILE_RADIO_ENABLED_DURING_GAMEPLAYstatic void StopPedSpeaking(Ped ped, b8 onOff)==>>STOP_PED_SPEAKINGstatic void SetCurrentMovie(char *moviefile)==>>SET_CURRENT_MOVIEstatic void DrawMovie(f32 u1, f32 u2, f32 u3, f32 u4, f32 u5, int red, int green, int blue, int alpha)==>>DRAW_MOVIEstatic void SetMovieTime(f32 time)==>>SET_MOVIE_TIMEstatic void SetMovieVolume(f32 volume)==>>SET_MOVIE_VOLUMEstatic void StopMovie()==>>STOP_MOVIEstatic void OverrideFreezeFlags(b8 onOff)==>>OVERRIDE_FREEZE_FLAGSstatic void SwitchStreaming(b8 onOff)==>>SWITCH_STREAMINGstatic void PlayStreamFromObject(Object obj)==>>PLAY_STREAM_FROM_OBJECTstatic void PlayStreamFrontend()==>>PLAY_STREAM_FRONTENDstatic void StopStream()==>>STOP_STREAMstatic b8 RequestAmbientAudioBank(char *name)==>>REQUEST_AMBIENT_AUDIO_BANKstatic b8 PreloadStream(char *name)==>>PRELOAD_STREAMstatic void AmbientAudioBankNoLongerNeeded()==>>AMBIENT_AUDIO_BANK_NO_LONGER_NEEDEDstatic int GetStreamPlaytime()==>>GET_STREAM_PLAYTIMEstatic void DrawSprite(Texture texture, f32 u1, f32 u2, f32 u3, f32 u4, f32 angle, int red, int green, int blue, int alpha)==>>DRAW_SPRITEstatic void StartEndCreditsMusic()==>>START_END_CREDITS_MUSICstatic void StopEndCreditsMusic()==>>STOP_END_CREDITS_MUSICstatic void PlaySoundFromPed(eSound sound, ch *soundName, Ped ped)==>>PLAY_SOUND_FROM_PEDstatic void PlaySoundFromObject(eSound sound, ch *soundName, Object obj)==>>PLAY_SOUND_FROM_OBJECTstatic void PlaySoundFromPosition(eSound sound, ch *soundName, f32 x, f32 y, f32 z)==>>PLAY_SOUND_FROM_POSITIONstatic void RetuneRadioToStationName(const char *name)==>>RETUNE_RADIO_TO_STATION_NAMEstatic b8 GetMobilePhoneTaskSubTask(Ped ped, int *subTask)==>>GET_MOBILE_PHONE_TASK_SUB_TASKstatic void ActivateReplayMenu()==>>ACTIVATE_REPLAY_MENUstatic void PlayStreamFromPed(Ped ped)==>>PLAY_STREAM_FROM_PEDstatic b8 DoesTextLabelExist(char *gxtentry)==>>DOES_TEXT_LABEL_EXISTstatic int GetAudibleMusicTrackTextID()==>>GET_AUDIBLE_MUSIC_TRACK_TEXT_IDstatic b8 PreloadStreamWithStartOffset(char *StreamName, int StartOffset)==>>PRELOAD_STREAM_WITH_START_OFFSETstatic int GetPlayerRadioStationIndex()==>>GET_PLAYER_RADIO_STATION_INDEXstatic void RetuneRadioToStationIndex(int radioStation)==>>RETUNE_RADIO_TO_STATION_INDEXstatic void UnpauseRadio()==>>UNPAUSE_RADIOstatic void RetuneRadioUp()==>>RETUNE_RADIO_UPstatic void RetuneRadioDown()==>>RETUNE_RADIO_DOWNstatic void SkipRadioForward()==>>SKIP_RADIO_FORWARDstatic int GetPlayerRadioMode()==>>GET_PLAYER_RADIO_MODEstatic void SetLoudVehicleRadio(Vehicle veh, b8 set)==>>SET_LOUD_VEHICLE_RADIOstatic void ForceRadioTrack(char *radiostation, char *trackname, int unk1, int unk2)==>>FORCE_RADIO_TRACKstatic void SetMobilePhoneRadioState(b8 state)==>>SET_MOBILE_PHONE_RADIO_STATEstatic void ReportTaggedRadioTrack(int TrackTextId)==>>REPORT_TAGGED_RADIO_TRACKstatic void UnfreezeRadioStation(char *radiostation)==>>UNFREEZE_RADIO_STATIONstatic void SetTaxiGarageRadioState(b8 radiostate)==>>SET_TAXI_GARAGE_RADIO_STATEstatic const ch *GetRadioName(int radioStation)==>>GET_RADIO_NAMEstatic const ch *GetPlayerRadioStationNameRoll()==>>GET_PLAYER_RADIO_STATION_NAME_ROLLstatic b8 IsRadioHUDOn()==>>IS_RADIO_HUD_ON// Render & Record & AIstatic void SetGlobalRenderFlags(b8 flag1, b8 flag2, b8 flag3, b8 flag4)==>>SET_GLOBAL_RENDER_FLAGSstatic void SetObjectRenderScorched(Object obj, b8 set)==>>SET_OBJECT_RENDER_SCORCHEDstatic void SetRenderTrainAsDerailed(Vehicle train, b8 set)==>>SET_RENDER_TRAIN_AS_DERAILEDstatic void SetCreditsToRenderBeforeFade(b8 set)==>>SET_CREDITS_TO_RENDER_BEFORE_FADEstatic void RenderRaceTrack(b8 set)==>>RENDER_RACE_TRACKstatic void SetVehicleAlwaysRender(Vehicle veh)==>>SET_VEHICLE_ALWAYS_RENDERstatic void StopVehicleAlwaysRender(Vehicle veh)==>>STOP_VEHICLE_ALWAYS_RENDERstatic void SetVehicleRenderScorched(Vehicle veh, b8 set)==>>SET_VEHICLE_RENDER_SCORCHEDstatic b8 HasCarRecordingBeenLoaded(int CarRec)==>>HAS_CAR_RECORDING_BEEN_LOADEDstatic float GetTotalDurationOfCarRecording(int CarRec)==>>GET_TOTAL_DURATION_OF_CAR_RECORDINGstatic float FindPositionInRecording(Vehicle veh)==>>FIND_POSITION_IN_RECORDINGstatic float FindTimePositionInRecording(Vehicle veh)==>>FIND_TIME_POSITION_IN_RECORDINGstatic void SetObjectRecordsCollisions(Object obj, b8 set)==>>SET_OBJECT_RECORDS_COLLISIONSstatic void SkipInPlaybackRecordedCar(Vehicle veh, f32 time)==>>SKIP_IN_PLAYBACK_RECORDED_CARstatic void UnpausePlaybackRecordedCar(Vehicle veh)==>>UNPAUSE_PLAYBACK_RECORDED_CARstatic void SkipTimeInPlaybackRecordedCar(int CarRec, f32 time)==>>SKIP_TIME_IN_PLAYBACK_RECORDED_CARstatic void StartPlaybackRecordedCarLooped(Vehicle veh, int loops)==>>START_PLAYBACK_RECORDED_CAR_LOOPEDstatic void SkipToEndAndStopPlaybackRecordedCar(Vehicle veh)==>>SKIP_TO_END_AND_STOP_PLAYBACK_RECORDED_CARstatic void RemoveCarRecording(int CarRec)==>>REMOVE_CAR_RECORDINGstatic void StopPlaybackRecordedCar(Vehicle veh)==>>STOP_PLAYBACK_RECORDED_CARstatic void SetRecordingToPointNearestToCoors(Vehicle veh, f32 x, f32 y, f32 z)==>>SET_RECORDING_TO_POINT_NEAREST_TO_COORSstatic void PausePlaybackRecordedCar(Vehicle veh)==>>PAUSE_PLAYBACK_RECORDED_CARstatic void RequestCarRecording(int CarRec)==>>REQUEST_CAR_RECORDINGstatic void GetPositionOfCarRecordingAtTime(int CarRec, f32 time, f32 *pos)==>>GET_POSITION_OF_CAR_RECORDING_AT_TIMEstatic void StartPlaybackRecordedCar(Vehicle veh, int CarRec)==>>START_PLAYBACK_RECORDED_CARstatic void StartPlaybackRecordedCarUsingAI(Vehicle veh, int CarRec)==>>START_PLAYBACK_RECORDED_CAR_USING_AIstatic void AddPedToCinematographyAI(int cine, Ped ped)==>>ADD_PED_TO_CINEMATOGRAPHY_AIstatic void ChangePlaybackToUseAI(Vehicle veh)==>>CHANGE_PLAYBACK_TO_USE_AIstatic void SetPlayerInvisibleToAI(b8 set)==>>SET_PLAYER_INVISIBLE_TO_AI// HTML WEB WHMstatic void AddToHtmlScriptObject(int htmlobj, char *htmlcode)==>>ADD_TO_HTML_SCRIPT_OBJECTstatic int CreateHtmlScriptObject(char *objname)==>>CREATE_HTML_SCRIPT_OBJECTstatic void CreateHtmlViewport(int *htmlviewport)==>>CREATE_HTML_VIEWPORTstatic void DeleteAllHtmlScriptObjects()==>>DELETE_ALL_HTML_SCRIPT_OBJECTSstatic void DeleteHtmlScriptObject(int htmlobj)==>>DELETE_HTML_SCRIPT_OBJECTstatic b8 DoesWebPageExist(char *webaddress)==>>DOES_WEB_PAGE_EXISTstatic b8 DoesViewportExist(int htmlviewport)==>>DOES_VIEWPORT_EXISTstatic void GetScreenViewportId(int *viewportID)==>>GET_SCREEN_VIEWPORT_IDstatic void GetGameViewportId(int *viewportID)==>>GET_GAME_VIEWPORT_IDstatic void LoadWebPage(int htmlviewport, char *webaddress)==>>LOAD_WEB_PAGEstatic void ReloadWebPage(int htmlviewport)==>>RELOAD_WEB_PAGEstatic float GetWebPageHeight(int htmlviewport)==>>GET_WEB_PAGE_HEIGHTstatic void SetWebPageScroll(int htmlviewport, float scroll)==>>SET_WEB_PAGE_SCROLLstatic int GetNumberOfWebPageLinks(int htmlviewport)==>>GET_NUMBER_OF_WEB_PAGE_LINKSstatic const ch *GetWebPageLinkHref(int htmlviewport, int linkid)==>>GET_WEB_PAGE_LINK_HREFstatic void GetWebPageLinkPosn(int htmlviewport, int linkid, float *x, float *y)==>>GET_WEB_PAGE_LINK_POSNstatic int GetWebPageLinkAtPosn(int htmlviewport, float x, float y)==>>GET_WEB_PAGE_LINK_AT_POSNstatic void SetWebPageLinkActive(int htmlviewport, int linkid, b8 active)==>>SET_WEB_PAGE_LINK_ACTIVEstatic void AddFirstNCharactersOfStringToHtmlScriptObject(int htmlobj, char *str, int n)==>>ADD_FIRST_N_CHARACTERS_OF_STRING_TO_HTML_SCRIPT_OBJECTstatic void AddStringToHtmlScriptObject(int htmlobj, char *str)==>>ADD_STRING_TO_HTML_SCRIPT_OBJECTstatic void ConvertThenAddStringToHtmlScriptObject(int htmlobj, char *strgxtkey)==>>CONVERT_THEN_ADD_STRING_TO_HTML_SCRIPT_OBJECTstatic int CompareStrings(const char *str1, const char *str2)==>>COMPARE_STRING

 

 

 

Feel free to edit/use anything! If you have more edited natives post it here. Small code examples are welcome too.
Always respect the hard work of other coders/modders -> please make a small notation like "Thanks to Aru, Alexander Blade, Skorpro" if you use this in own mods! THANX
biggrin.gif


Hope it's helpful - have fun now smile.gif


Special thanx to:

  • Alexander Blade for ASI Loader & SCOCL natives list
  • Aru for C++ ScriptHook SDK

 

EDIT: over 200 new edited natives

Edited by Skorpro
Link to comment
https://gtaforums.com/topic/576633-how-to-use-arus-c-scripthook-sdk/
Share on other sites

  • 3 months later...

Hi guys!

 

It's been a long time...

 

LetsPlayOrDy has looked for a method to set a vehicle to a position just a couple of feet in front of player.
This is a small example to do this in C++
.

Car Spawn Example:

 

CustomFiberThread.h

Scripting::Vehicle SpawnCar(Scripting::eModel model, f32 x, f32 y, f32 z, f32 h);

CustomFiberThread.cpp

.........// Global varsVehicle spawnCar;f32 sx, sy, sz, sh;b8 delcar = 0;Scripting::Vehicle CustomFiberThread::SpawnCar(Scripting::eModel model, f32 x, f32 y, f32 z, f32 h){	// Local vars	Vehicle retVeh;	eInteriorRoomKey carRoomKey;	// Load model	RequestModel(model);	while(!HasModelLoaded(model)) { Wait(0); }	// Spawn vehicle	ClearArea(x, y, z, 3.01f, 1);	Wait(0);	CreateCar(model, x, y, z, &retVeh, true);	GetKeyForCharInRoom(GetPlayerPed(), &carRoomKey);	SetCarOnGroundProperly(retVeh);	SetRoomForCarByKey(retVeh, carRoomKey);	SetCarHeading(retVeh, h);	MarkModelAsNoLongerNeeded(model);	return retVeh;}void CustomFiberThread::RunScript(){	// This is a fiber thread, so we use an loop to run the contents of this script.	// The thread will terminate when we return from this function.		Wait(2000);	while(IsThreadAlive())		// MAIN LOOP	{		if (GetKeyState(116)<0)	// Press <F5> to spawn vehicle (F5 = 116)		{			if (delcar == 0)			{				GetOffsetFromCharInWorldCoords(GetPlayerPed(), 0.0f, 5.0f, 0.0f, &sx, &sy, &sz); // 5 steps from player (y coord!)				GetCharHeading(GetPlayerPed(), &sh);				spawnCar = SpawnCar(MODEL_ORACLE, sx, sy, sz, sh); // Check "ScriptingEnums.h" for models...				ChangeCarColour(spawnCar, 0, 1);				SetExtraCarColours(spawnCar, 0, 0);				SetVehicleDirtLevel(spawnCar, 0.0f);				WashVehicleTextures(spawnCar, 255);				PrintStringWithLiteralStringNow("STRING", "Car spawned!", 2000, 1);				delcar = 1;			}			else if (delcar == 1)			{ 				if ( (DoesVehicleExist(spawnCar)) && (!IsCharInCar(GetPlayerPed(), spawnCar)) ) // To delete car exit it first...				{					DeleteCar(&spawnCar); 					PrintStringWithLiteralStringNow("STRING", "Car deleted!", 2000, 1);					delcar = 0;				}				else PrintStringWithLiteralStringNow("STRING", "Can't delete car...", 2000, 1);			}			Wait(200);		}		Wait(0);	}}

Any questions? Post it here! :)

 

Merry Christmas and a Happy New Year! :D

Edited by Skorpro
  • 10 months later...

Hi guys,

 

it's been a long time... but I want to bring this topic back to life... (Hope Silent - or another moderator - can move this to GTA IV section again @Silent thanx for moving:))

 

Anyway... here is a simple way to switch the vehicle engine:

 

C++

Vehicle car;...GetCarCharIsUsing(GetPlayerPed(), &car);if (t_engine == 0) {	SetCarEngineOn(car, 0, 0);	SetPetrolTankHealth(car, 0.0f);	PrintStringWithLiteralStringNow("STRING","Engine OFF!",1200,1);	t_engine = 1;}else if (t_engine == 1) {	SetPetrolTankHealth(car, 1000.0f);	SetCarEngineOn(car, 0, 0);	Wait(500);	SetCarEngineOn(car, 1, 1);	PrintStringWithLiteralStringNow("STRING","Engine ON!",1200,1);	t_engine = 0;}

To switch the engine on it's better to use SetCarEngineOn twice (yes, you could use SetCarEngineOn(car, 1, 0) but sometimes it does not work!).

 

Have fun :)

Edited by Skorpro

Another example: SCO Loader!

 

Add this to "Scripting.h" or download my files (first post):

static u32 StartNewScript(const ch *scriptName, u32 stacksize) { return NativeInvoke::Invoke<NATIVE_START_NEW_SCRIPT, u32>(scriptName, stacksize); }

C++ SCO Loader:

void SKP::skpp(const char *printText, u32 printTime, b8 printWait){	PrintStringWithLiteralStringNow("STRING", printText, printTime, 1);	if (printWait == 1) { Wait(printTime); }}bool SKP::SCO_Loader(int sco_num1toX, const ch *sco_name, u32 sco_stacksize_0, b8 sco_info, u32 sco_wait){	// Copy your own SCO scripts into "script.img"	// -------------------------------------------	// GTA IV	:	C:\Program Files (x86)\Rockstar Games\Grand Theft Auto IV\common\data\cdimages\script.img	// TBOGT	:	C:\Program Files (x86)\Rockstar Games\EFLC\TBoGT\common\data\cdimages\script.img	// TLAD		:	C:\Program Files (x86)\Rockstar Games\EFLC\TLAD\common\data\cdimages\script.img		b8 sco_ok = 0;	if ( (DoesScriptExist(sco_name)) && (sco_num1toX > 0) )	{		if (GetNumberOfInstancesOfStreamedScript(sco_name) == 0)		{			RequestScript(sco_name);			while (!HasScriptLoaded(sco_name)) Wait(0);			if (sco_num1toX == 1) { if (sco_stacksize_0 == 0) sco_stacksize_0 = 8192; }	// sco_stacksize_0 = 0 -> 8192 (first script)			else if (sco_num1toX > 1) { if (sco_stacksize_0 == 0) sco_stacksize_0 = 1024; }	// sco_stacksize_0 = 0 -> 1024 (other scripts)			u32 sco_scriptnum;			sco_scriptnum = StartNewScript(sco_name, sco_stacksize_0);			MarkScriptAsNoLongerNeeded(sco_name);			if (sco_info == 1) 			{				char infotext[64];				strncpy_s(infotext, "~COL_NET_3~'~COL_NET_4~ ", 26);				strncat_s(infotext, sco_name, strlen(sco_name));				strncat_s(infotext, " ~COL_NET_3~' loaded!", 22);				skpp(infotext, 2000, 0);			}			sco_ok = 1;		}		else skpp("SCO Script already loaded!", 3000, 0);	}	else skpp("Unknown SCO Script or Number!", 3000, 0);	if (sco_wait > 0) Wait(sco_wait);	return sco_ok;}

Hint: Never simply copy & paste! You must adapt this code to your own.

 

 

Usage:

SCO_Loader(1, "z_heliblock", 0, 1, 1000);SCO_Loader(2, "z_traffic", 0, 1, 1000);SCO_Loader(3, "z_worldprops", 0, 1, 1000);SCO_Loader(4, "z_zombgen", 0, 1, 1000);

Note: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" if you want to use them! Thanx :)

  • Like 2
  • 4 weeks later...

Uhhh, little too much for me to get just quickly involved in, i was hopping for little simpler editing. I'm using almost all your scripts since it doesn't bug rain effects without use of ScriptHookDotNet, thanks for all of it. But those tutorials... they very nice for people with deeper interest an knowledge which i have total zero. I better stick with things i have some experience already before i get whole weekends tied up with another hobby.

Edited by tall70

how do we use this native : GetVehicleDirtLevel

 

I tried it this way :

GetVehicleDirtLevel(thecurrentvehicle, dirtyness);

 

thecurrentvehicle is the vehicle we currently use, and dirtyness is a float, but whenever I try to echo the value of dirtyness it always returns with a 0.

how do we use this native : GetVehicleDirtLevel

 

I tried it this way :

 

GetVehicleDirtLevel(thecurrentvehicle, dirtyness);

 

thecurrentvehicle is the vehicle we currently use, and dirtyness is a float, but whenever I try to echo the value of dirtyness it always returns with a 0.

GET_VEHICLE_DIRT_LEVEL(Vehicle vehicle, float* pIntensity);

 

f32 dirtLevel;

GetVehicleDirtLevel(yourVeh, &dirtLevel);

 

Is this how you are using it?

Edited by LetsPlayOrDy

@stef538

Your code is fine! But you have to use DisplayTextWithFloat to show float values :)

f32 fDirt = 0.0f;Vehicle veh;while(IsThreadAlive()){	if (IsCharInAnyCar(GetPlayerPed()))	{		GetCarCharIsUsing(GetPlayerPed(), &veh);		GetVehicleDirtLevel(veh, &fDirt);		DisplayTextWithFloat(0.5f, 0.9f, "NUMBER", fDirt, 3); // decimal places = 3	}	Wait(0);}

Uhhh, little too much for me to get just quickly involved in, i was hopping for little simpler editing. I'm using almost all your scripts since it doesn't bug rain effects without use of ScriptHookDotNet, thanks for all of it. But those tutorials... they very nice for people with deeper interest an knowledge which i have total zero. I better stick with things i have some experience already before i get whole weekends tied up with another hobby.

Thanx :D

Believe me it's easier than it looks. But I have the same problem: Too many ideas/hobbies and not enough time... ;)

 

 

 

always happy when i find a gold mine :colgate: . You should upload your engine off to some downloads sites i think it would be successful

You're welcome :) Maybe I will make a Mods Pack Vol.2 (with some 'unpublished' mods) before GTA V comes out.

@DaBOSS54320 (referring to: "how to disable a vehicle from spawning in traffic")

 

How to suppress a vehicle:

// GlobalVehicle veh;eModel model;. . .while(IsThreadAlive()){	if (IsCharInAnyCar(GetPlayerPed()))	{		GetCarCharIsUsing(GetPlayerPed(), &veh);		GetCarModel(veh, &model);		SuppressCarModel(model);	}	else DontSuppressCarModel(model);	Wait(0);}

Note:

Add this to "Scripting.h" or download my files (first post):

static void SuppressCarModel(eModel model) { NativeInvoke::Invoke<NATIVE_SUPPRESS_CAR_MODEL, ScriptVoid>(model); }static void DontSuppressCarModel(eModel carmodel) { NativeInvoke::Invoke<NATIVE_DONT_SUPPRESS_CAR_MODEL, ScriptVoid>(carmodel); }

 

@stef538

Your code is fine! But you have to use DisplayTextWithFloat to show float values :)

f32 fDirt = 0.0f;Vehicle veh;while(IsThreadAlive()){	if (IsCharInAnyCar(GetPlayerPed()))	{		GetCarCharIsUsing(GetPlayerPed(), &veh);		GetVehicleDirtLevel(veh, &fDirt);		DisplayTextWithFloat(0.5f, 0.9f, "NUMBER", fDirt, 3); // decimal places = 3	}	Wait(0);}

 

Thank you!! But whenever I use the GET_VEHICLE_DIRT_LEVEL it gives me an error... "Attempted to read or write protected memory"

Edited by stef538

Thank you!! But whenever I use the GET_VEHICLE_DIRT_LEVEL it gives me an error... "Attempted to read or write protected memory"

I don't know why you got this error?!

 

I checked it in SCO too. The script works!

#define PP GetPlayerPed()Vehicle veh;float fDirt;. . .if (IS_CHAR_IN_ANY_CAR(PP)){	GET_CAR_CHAR_IS_USING(PP, &veh);	GET_VEHICLE_DIRT_LEVEL(veh, &fDirt);	DISPLAY_TEXT_WITH_FLOAT(0.5, 0.9, "NUMBER", fDirt, 3);}

Hint: If you use .Net don't call this native like this "GTA.Native.Function.Call("GET_VEHICLE_DIRT_LEVEL", veh, fDirt);"! Better use Hazard's classes:

// Taken from Hazard's Vehicle.cpp!float Vehicle::Dirtyness::get(){	NON_EXISTING_CHECK(0.0f);	f32 res;	Scripting::GetVehicleDirtLevel(pHandle,&res);	return res;}void Vehicle::Dirtyness::set(float value){	NON_EXISTING_CHECK();	Scripting::SetVehicleDirtLevel(pHandle,value);}

Hope it works for you :)

 

Another example: SCO Loader!

 

Add this to "Scripting.h" or download my files (first post):

static u32 StartNewScript(const ch *scriptName, u32 stacksize) { return NativeInvoke::Invoke<NATIVE_START_NEW_SCRIPT, u32>(scriptName, stacksize); }

C++ SCO Loader:

 

 

Usage:

SCO_Loader(1, "z_heliblock", 0, 1, 1000);SCO_Loader(2, "z_traffic", 0, 1, 1000);SCO_Loader(3, "z_worldprops", 0, 1, 1000);SCO_Loader(4, "z_zombgen", 0, 1, 1000);

Note: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" if you want to use them! Thanx :)

 

@Skorpro

 

I am a real fan of your work. I've used your bombmod on a SCO mission that was released for PS3 back in 2012 (see video below - and of course, I've given you the credit for the mod in the video):

 

 

I'm currently working on a bigger project now (VC++ app to build your own GTA missions) and I am desperately looking for some help with SCO/.NET

 

I usually code only in native SCO because I started doing mods on PS3 (so I don't have skills to code script hook stuff). Basically, I want to know if it's possible to create a ASI/DLL script to load external SCO files (like the DLL ones that are loaded via script hook console on /scripts dir). That would boost my dev work a lot (and of course would be f**kin' great, lol).

 

Right now I have to rebuild script.img on OpenIV everytime I do changes on my C SCO project (and load up the game afterwards). That takes me around 5 mins (I'd love to speed things up).

 

Let me know if you have any ideas in mind.

 

Thx,

 

- rodd1981

Basically, I want to know if it's possible to create a ASI/DLL script to load external SCO files (like the DLL ones that are loaded via script hook console on /scripts dir). That would boost my dev work a lot (and of course would be f**kin' great, lol).

I don't think that would be possible

I am a real fan of your work.

Thanx :D

 

I usually code only in native SCO because I started doing mods on PS3 (so I don't have skills to code script hook stuff). Basically, I want to know if it's possible to create a ASI/DLL script to load external SCO files (like the DLL ones that are loaded via script hook console on /scripts dir). That would boost my dev work a lot (and of course would be f**kin' great, lol).

 

Right now I have to rebuild script.img on OpenIV everytime I do changes on my C SCO project (and load up the game afterwards). That takes me around 5 mins (I'd love to speed things up).

AFAIK it's impossible, because SCO scripts must be included in a IMG file, otherwise GTA couldn't find them!

Example: The "DoesScriptExist" native checks the known IMG files.

 

 

  • 2 weeks later...

@stef538 (referring to: "Convert GTA IV model hash to string")

 

Here is an example how to convert a model string to a hash string:

char cHash[16];...char *SKP::ModelStringToHashString(char *key, int IHBU){	if (IHBU == 0) { _ltoa_s(GetHashKey(key), cHash, 10); }	// Int=10	if (IHBU == 1) { _ltoa_s(GetHashKey(key), cHash, 16); }	// Hex=16	if (IHBU == 2) { _ltoa_s(GetHashKey(key), cHash, 2); }	// Bin=2	if (IHBU == 3) { _ultoa_s(GetHashKey(key), cHash, 10); }// Unsigned Int=10	return cHash;}

Here is the native to convert a model string to a hash:

u32 GetHashKey(const ch *value) // native// oreModel GetModelHash(const ch *name) // this is NOT a 'regular native' - this function is done by Aru!
  • 1 month later...

Hi guys,

 

here are my file/INI functions:

 

C++

// INI/FILE FUNCTIONS#define INI_Name "./test mod.ini"// STRINGchar* SKP::SkorproReadString(char* Section, char* Key, const char* DefaultString){	char* Result = new char[255];	memset(Result, 0x00, 255);	GetPrivateProfileStringA(Section, Key, DefaultString, Result, 255, INI_Name); 	return Result;}void SKP::SkorproWriteString(char* Section, char* Key, const char* ValueString){	WritePrivateProfileStringA(Section, Key, ValueString, INI_Name);}// INTint SKP::SkorproReadInteger(char* Section, char* Key, int DefaultInt){	 int Result = GetPrivateProfileIntA(Section,  Key, DefaultInt, INI_Name); 	 return Result;}void SKP::SkorproWriteInteger(char* Section, char* Key, int ValueInt, b8 DecHex){	char tmpValue[255];	if (DecHex == 0) { sprintf_s(tmpValue, 255, "%d", ValueInt); } // %d = DEC	if (DecHex == 1) { sprintf_s(tmpValue, 255, "%x", ValueInt); } // %x = HEX	WritePrivateProfileStringA(Section, Key, tmpValue, INI_Name); }// FLOATfloat SKP::SkorproReadFloat(char* szSection, char* szKey, float DefaultFloat){	char szResult[255];	char szDefault[255];	double dResult;	float fResult;	sprintf_s(szDefault, "%f",DefaultFloat);	GetPrivateProfileStringA(szSection,  szKey, szDefault, szResult, 255, INI_Name); 	dResult =  atof(szResult);	fResult = (f32) dResult;	return fResult;}void SKP::SkorproWriteFloat(char* szSection, char* szKey, float ValueFloat, int Nachkommastellen){	char szValue[255];	if (Nachkommastellen <= 1) sprintf_s(szValue, "%.1f", ValueFloat);	else if (Nachkommastellen == 2) sprintf_s(szValue, "%.2f", ValueFloat);	else if (Nachkommastellen == 3) sprintf_s(szValue, "%.3f", ValueFloat);	else if (Nachkommastellen == 4) sprintf_s(szValue, "%.4f", ValueFloat);	else if (Nachkommastellen == 5) sprintf_s(szValue, "%.5f", ValueFloat);	else if (Nachkommastellen == 6) sprintf_s(szValue, "%.6f", ValueFloat);	else if (Nachkommastellen >= 7) sprintf_s(szValue, "%.7f", ValueFloat);	WritePrivateProfileStringA(szSection, szKey, szValue, INI_Name); }// Backupvoid SKP::SkorproBackupINI(){	char BackupINI[64];	strncpy_s(BackupINI, INI_Name, 54);	strncat_s(BackupINI, ".backup", 10);	CopyFileA(INI_Name, BackupINI, false); // "false" überschreibt "BackupINI", falls diese existiert!}

Have fun :)

How to read the carcols.dat

 

Hi,

@ALL & @ClareXoBearrx3 (referring to: "C++ getline()")

 

Here is a way (there are many others in C++ ;)) how to read particular parts of a line taken from a file (here the carcols.dat as example!):

// GTA 4 & TLAD = 134 colors // TBOGT = 137 colors!#define MAX_COLORS 137ifstream iFile;string strLine;int col_temp[3] = { 999, 999, 999 };int col_array[MAX_COLORS][3];int col_count = 0;Vehicle veh;u32 uCol[4];// . . .bool SKP::ColorFile(){   bool bOk = 0;   iFile.open("./common/data/carcols.dat", ios::in);   if (iFile.fail() || iFile.bad())   {      skpp("Carcols.dat READ ERROR!", 5000, 0);   }   else   {      iFile.seekg(0L, ios::beg);      while (!iFile.eof())      {         getline(iFile, strLine);         if (strLine.find("col") == 0) // find 'col' and start reading!         {            while (true)            {               getline(iFile, strLine);               stringstream ss(strLine);               for (int i = 0; i < 3; i++) col_temp[i] = 999;               string token;               int iToken = 0;               while (getline(ss, token, ','))               {                  col_temp[iToken] = atoi(token.c_str());                  iToken++;                  if (iToken == 3) break;               }               ss.clear();               // Check               if (col_temp[0] != 999 && col_temp[1] != 999 && col_temp[2] != 999)               {                  for (int i = 0; i < 3; i++) col_array[col_count][i] = col_temp[i];                                    col_count++;               }               if (strLine.find("end") == 0) break; // read until 'end'!            }         }      }      bOk = 1;   }   iFile.close();   return bOk;}// . . .void SKP::RunScript(){   // read carcols.dat   ColorFile();         // . . .      while(IsThreadAlive())   {      // . . .            if (IsCharInAnyCar(GetPlayerPed()))      {         GetCarCharIsUsing(GetPlayerPed(), &veh);         GetCarColours(veh, &uCol[0], &uCol[1]);         GetExtraCarColours(veh, &uCol[2], &uCol[3]);                  SkorproText("COLOR 1", 0.40f, 0.95f, 0, col_array[uCol[0]][0], col_array[uCol[0]][1], col_array[uCol[0]][2]);         SkorproText("COLOR 2", 0.47f, 0.95f, 0, col_array[uCol[1]][0], col_array[uCol[1]][1], col_array[uCol[1]][2]);         SkorproText("COLOR 3", 0.54f, 0.95f, 0, col_array[uCol[2]][0], col_array[uCol[2]][1], col_array[uCol[2]][2]);         SkorproText("COLOR 4", 0.61f, 0.95f, 0, col_array[uCol[3]][0], col_array[uCol[3]][1], col_array[uCol[3]][2]);      }            Wait(0);   }}

Note: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" if you want to use them! Thanx :D

Hint: Never simply copy & paste! You must adapt this code to your own.

How to play MP3 with C++ ScriptHook: (referring to: "(C++) Playing External Sound")

#include <windows.h>#include <MMSystem.h>#pragma comment(lib, "winmm.lib"). . . .mciSendString(TEXT("open Test.mp3"),NULL,0,0);mciSendString(TEXT("play Test.mp3 repeat"),NULL,0,0);mciSendString(TEXT("setaudio Test.mp3 output volume to 500"),NULL,0,0);  // Volume = 500 (0 - 1000)

Have fun :D

could you post your "SkorproText" function? im still a c++ noob.

Here you are :)

void SKP::SkorproText(const char *text, f32 x, f32 y, int iFont, int iRed, int iGreen, int iBlue){	SetTextFont( (eTextFont) iFont); // 0=SMOOTH_DEFAULT / 1=LED / 2=FAT (Nicht nutzen!) / 3=UNKNOWN (Nicht nutzen!) / 4=SMOOTH_ALT	SetTextBackground(0);	SetTextScale(0.22f, 0.27f);	SetTextColour(iRed, iGreen, iBlue, 255);	SetTextRightJustify(0);	SetTextDropshadow(0, 255, 255, 255, 255);	DisplayTextWithLiteralString(x, y, "STRING", text);}

Another example: SCO Loader!

 

Add this to "Scripting.h" or download my files (first post):

static u32 StartNewScript(const ch *scriptName, u32 stacksize) { return NativeInvoke::Invoke<NATIVE_START_NEW_SCRIPT, u32>(scriptName, stacksize); }
C++ SCO Loader:
void SKP::skpp(const char *printText, u32 printTime, b8 printWait){	PrintStringWithLiteralStringNow("STRING", printText, printTime, 1);	if (printWait == 1) { Wait(printTime); }}bool SKP::SCO_Loader(int sco_num1toX, const ch *sco_name, u32 sco_stacksize_0, b8 sco_info, u32 sco_wait){	// Copy your own SCO scripts into "script.img"	// -------------------------------------------	// GTA IV	:	C:\Program Files (x86)\Rockstar Games\Grand Theft Auto IV\common\data\cdimages\script.img	// TBOGT	:	C:\Program Files (x86)\Rockstar Games\EFLC\TBoGT\common\data\cdimages\script.img	// TLAD		:	C:\Program Files (x86)\Rockstar Games\EFLC\TLAD\common\data\cdimages\script.img		b8 sco_ok = 0;	if ( (DoesScriptExist(sco_name)) && (sco_num1toX > 0) )	{		if (GetNumberOfInstancesOfStreamedScript(sco_name) == 0)		{			RequestScript(sco_name);			while (!HasScriptLoaded(sco_name)) Wait(0);			if (sco_num1toX == 1) { if (sco_stacksize_0 == 0) sco_stacksize_0 = 8192; }	// sco_stacksize_0 = 0 -> 8192 (first script)			else if (sco_num1toX > 1) { if (sco_stacksize_0 == 0) sco_stacksize_0 = 1024; }	// sco_stacksize_0 = 0 -> 1024 (other scripts)			u32 sco_scriptnum;			sco_scriptnum = StartNewScript(sco_name, sco_stacksize_0);			MarkScriptAsNoLongerNeeded(sco_name);			if (sco_info == 1) 			{				char infotext[64];				strncpy_s(infotext, "~COL_NET_3~'~COL_NET_4~ ", 26);				strncat_s(infotext, sco_name, strlen(sco_name));				strncat_s(infotext, " ~COL_NET_3~' loaded!", 22);				skpp(infotext, 2000, 0);			}			sco_ok = 1;		}		else skpp("SCO Script already loaded!", 3000, 0);	}	else skpp("Unknown SCO Script or Number!", 3000, 0);	if (sco_wait > 0) Wait(sco_wait);	return sco_ok;}
Hint: Never simply copy & paste! You must adapt this code to your own.

 

 

Usage:

SCO_Loader(1, "z_heliblock", 0, 1, 1000);SCO_Loader(2, "z_traffic", 0, 1, 1000);SCO_Loader(3, "z_worldprops", 0, 1, 1000);SCO_Loader(4, "z_zombgen", 0, 1, 1000);
Note: All my scripts are for free use! Be fair: Please make a small credit like "Thanx to Skorpro" if you want to use them! Thanx :)
So I have a few questions about this.

 

1. What to do with this Sco Loader code? Should I do it like in the instructions from the first post?

2. (Never simply copy & paste) What should I edit or change in the code? Maybe something like sco_name and sco_stacksize?

3.And where to add the last code (with these SCO_Loader(1, z_heliblock,...))?

 

sry for bad english :D

Edited by yoloman
  • 2 weeks later...

Hey Skorp, quickie question, what was the difference between using CustomThread and CustomFiberThread again? Is it the hash conversion? I have some ideas for rebuilding my studios code, but want to test on IV first.

 

Nice work here!

FiberThread allows one to use an equivalent of the native scripting 'WAIT' command to suspend the 'script', whereas the regular thread only exposes a tick method.
  • Like 2

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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