sasuke78200 Posted May 30, 2015 Share Posted May 30, 2015 Go on http://dev-c.com/nativedb/, click on "downloads" on the top of the page and download "natives.h", replace the old one on your project with this one. XeClutch 1 Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067530190 Share on other sites More sharing options...
0xsatoshi Posted May 31, 2015 Share Posted May 31, 2015 argument of type "const char *" is incompatible with parameter of type "Any *" if i use (char *) "oddjobs@assassinate@multi@yachttarget@lapdance" i get argument of type "char *" is incompatible with parameter of type "Any *" I need to put pointer to an animation from what i understand. EDIT: i guess i need REQUEST_ANIM_DICT(char *AminSet) and stuff cast it to (Any *) Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067531489 Share on other sites More sharing options...
Fireboyd78 Posted May 31, 2015 Share Posted May 31, 2015 argument of type "const char *" is incompatible with parameter of type "Any *" if i use (char *) "oddjobs@assassinate@multi@yachttarget@lapdance" i get argument of type "char *" is incompatible with parameter of type "Any *" I need to put pointer to an animation from what i understand. EDIT: i guess i need REQUEST_ANIM_DICT(char *AminSet) and stuff cast it to (Any *) No, redownload the natives.h file. Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067531651 Share on other sites More sharing options...
Szabo Posted May 31, 2015 Share Posted May 31, 2015 (edited) Hey guys, I'm trying to find a way to 'unlock' the wheels of the cars so they can spin freely, but I'm failing miserably, any ideas on how to do that, so for example you can let a car go downhill? here's what I've tried (only SOME of the thing I've tried actually): VEHICLE::SET_VEHICLE_HANDBRAKE VEHICLE::SET_VEHICLE_REDUCE_GRIP (not what I want) VEHICLE::STEER_UNLOCK_BIAS VEHICLE::SET_VEHICLE_OUT_OF_CONTROL VEHICLE::_SET_VEHICLE_ENGINE_POWER_MULTIPLIER VEHICLE::SET_VEHICLE_ENGINE_ON VEHICLE::SET_VEHICLE_CAN_BREAK (hoping they mispelled brake ) VEHICLE::SET_VEHICLE_UNDRIVEABLE VEHICLE::SET_VEHICLE_FRICTION_OVERRIDE (not what I want) VEHICLE::SET_VEHICLE_ENGINE_HEALTH (various values) VEHICLE::IS_VEHICLE_DRIVEABLE please if someone is able to let the wheels of the vehicles spin free, lemme know! Edited May 31, 2015 by Szabo Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067531717 Share on other sites More sharing options...
darkphoenixxx Posted May 31, 2015 Share Posted May 31, 2015 (edited) Wonderful! Thank you guys. Here is working thing if someone needs an example. STREAMING::REQUEST_ANIM_DICT("oddjobs@assassinate@multi@yachttarget@lapdance"); while (!STREAMING::HAS_ANIM_DICT_LOADED("oddjobs@assassinate@multi@yachttarget@lapdance")) WAIT(0); AI::TASK_PLAY_ANIM(playerPed, "oddjobs@assassinate@multi@yachttarget@lapdance", "yacht_ld_f", 8.0, 0.0, -1, 0, 0, 0, 0, 0); -1 is duration (infinite in this case) Edited May 31, 2015 by darkphoenixxx Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067532166 Share on other sites More sharing options...
darkphoenixxx Posted May 31, 2015 Share Posted May 31, 2015 I dont suppose anyone know how to get ped i am targeting at? BOOL GET_PLAYER_TARGET_ENTITY(Player player, Entity *entity) does not return entity, but takes one... Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067532346 Share on other sites More sharing options...
0xsatoshi Posted May 31, 2015 Share Posted May 31, 2015 I dont suppose anyone know how to get ped i am targeting at? BOOL GET_PLAYER_TARGET_ENTITY(Player player, Entity *entity) does not return entity, but takes one... It takes a pointer to an Entity. Perhaps it stores the Entity at the address you pass in. Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067532406 Share on other sites More sharing options...
darkphoenixxx Posted May 31, 2015 Share Posted May 31, 2015 Any way to get entity from pointer? &entity ? Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067532616 Share on other sites More sharing options...
0xsatoshi Posted May 31, 2015 Share Posted May 31, 2015 (edited) Any way to get entity from pointer? &entity? Entity *entity = calloc(sizeof Entity);foo(playerid, entity);entity->whateverI dont use c++, but that will be pretty close. Edited May 31, 2015 by 0xsatoshi Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067532633 Share on other sites More sharing options...
InfamousSabre Posted May 31, 2015 Share Posted May 31, 2015 Entity targetEntity;bool foundTarget = PLAYER::GET_PLAYER_TARGET_ENTITY(Player playerID, Entity &targetEntity) != 0;if(foundTarget){//do stuff with targetEntity here} not at my PC at the moment, but this should do what you need Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067532789 Share on other sites More sharing options...
darkphoenixxx Posted May 31, 2015 Share Posted May 31, 2015 Well, Entity ent;PLAYER::GET_PLAYER_TARGET_ENTITY(player, &ent); ENTITY::DELETE_ENTITY(&ent); crashes the game (if use if (PLAYER::GET_PLAYER_TARGET_ENTITY(player, &ent) nothing happens) i target them with a gun, should i use something else? Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067533010 Share on other sites More sharing options...
InfamousSabre Posted May 31, 2015 Share Posted May 31, 2015 Well, Entity ent;PLAYER::GET_PLAYER_TARGET_ENTITY(player, &ent); ENTITY::DELETE_ENTITY(&ent);crashes the game (if use if (PLAYER::GET_PLAYER_TARGET_ENTITY(player, &ent) nothing happens) i target them with a gun, should i use something else? I think it doesn't work if you're free aiming. try PLAYER::_GET_AIMED_ENTITY for free aim Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067533157 Share on other sites More sharing options...
leftas Posted May 31, 2015 Share Posted May 31, 2015 (edited) argument of type "const char *" is incompatible with parameter of type "Any *" if i use (char *) "oddjobs@assassinate@multi@yachttarget@lapdance" i get argument of type "char *" is incompatible with parameter of type "Any *" I need to put pointer to an animation from what i understand. EDIT: i guess i need REQUEST_ANIM_DICT(char *AminSet) and stuff cast it to (Any *) No, redownload the natives.h file. CarLuver69, NO, Why ? Because You can't download natives.h while You programming a program, let Him change type by Himself. Maybe in future He will be a programmer ? Who knows ? And then He f*cking can't download(actually use) Your updated natives.h 0xsatoshi, NO, to You as well. Why ? It's bad habit and bad thing to do. He just should change Type from Any* to char*(it isn't that hard, is it ?) in natives.h Any way to get entity from pointer? &entity? Entity *entity = calloc(sizeof Entity);foo(playerid, entity);entity->whateverI dont use c++, but that will be pretty close. Hm... Entity in scripthook's c++ is just integer, so it doesn't have members(->)(in scripthook, in game, it has)... So You need to use entity somehow else(in this case), and that is * to deference pointer, because all we need is entity's handle(it's just integer). Any way to get entity from pointer? &entity ? Get entity's handle(this is what you want), you just deference pointer using *entity and you will get it's handle. or you can: Entity ent;&ent // to pass something as pointer Like InfamousSabre showed. Best wishes, Paul. Edited May 31, 2015 by leftas Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067533363 Share on other sites More sharing options...
darkphoenixxx Posted May 31, 2015 Share Posted May 31, 2015 Entity ent;PLAYER::_GET_AIMED_ENTITY(player, &ent);ENTITY::DELETE_ENTITY(&ent); Crashes as well. Any ideas? Or how can i target entity console style? (not free aim) Maybe i dont delete entity properly? Like i need to unload it or something. Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067533645 Share on other sites More sharing options...
leftas Posted May 31, 2015 Share Posted May 31, 2015 (edited) Entity ent;PLAYER::_GET_AIMED_ENTITY(player, &ent);ENTITY::DELETE_ENTITY(&ent); Crashes as well. Any ideas? Or how can i target entity console style? (not free aim) Maybe i dont delete entity properly? Like i need to unload it or something. Check if that entity at least exists... WE GOING OFF-TOPIC CREATE THREAD IN CODING SECTION Best wishes, Paul. Edited May 31, 2015 by leftas Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067533709 Share on other sites More sharing options...
ISOFX Posted May 31, 2015 Share Posted May 31, 2015 Does anyone know the code in c++ for locking and unlocking doors? like locking the nearest vehicle or something the whole piece of code would be helpful, thanks Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067534303 Share on other sites More sharing options...
Fireboyd78 Posted June 1, 2015 Share Posted June 1, 2015 Hey guys, I'm trying to find a way to 'unlock' the wheels of the cars so they can spin freely, but I'm failing miserably, any ideas on how to do that, so for example you can let a car go downhill? here's what I've tried (only SOME of the thing I've tried actually): VEHICLE::SET_VEHICLE_HANDBRAKE VEHICLE::SET_VEHICLE_REDUCE_GRIP (not what I want) VEHICLE::STEER_UNLOCK_BIAS VEHICLE::SET_VEHICLE_OUT_OF_CONTROL VEHICLE::_SET_VEHICLE_ENGINE_POWER_MULTIPLIER VEHICLE::SET_VEHICLE_ENGINE_ON VEHICLE::SET_VEHICLE_CAN_BREAK (hoping they mispelled brake ) VEHICLE::SET_VEHICLE_UNDRIVEABLE VEHICLE::SET_VEHICLE_FRICTION_OVERRIDE (not what I want) VEHICLE::SET_VEHICLE_ENGINE_HEALTH (various values) VEHICLE::IS_VEHICLE_DRIVEABLE please if someone is able to let the wheels of the vehicles spin free, lemme know! ffzero58 had a similar question to yours. I'm not sure if he got anywhere with it though. What I can tell you is that if you have a gamepad, you can trigger the "clutch" by very very lightly applying either the brakes or accelerator so as to not actually move forward/backward, but you can hear the "clutch" engaging and you'll notice the vehicle is able to move freely. Hope this helps. Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067535832 Share on other sites More sharing options...
Fireboyd78 Posted June 2, 2015 Share Posted June 2, 2015 Figured out most of the DATAFILE natives! void _OBJECT_VALUE_ADD_BOOLEAN(Any *objectData, char *key, BOOL value) // 0x35124302A556A325 0x9B29D99Bvoid _OBJECT_VALUE_ADD_INTEGER(Any *objectData, char *key, int value) // 0xE7E035450A7948D5 0xEFCF554Avoid _OBJECT_VALUE_ADD_FLOAT(Any *objectData, char *key, float value) // 0xC27E1CC2D795105E 0xE972CACFvoid _OBJECT_VALUE_ADD_STRING(Any *objectData, char *key, char *value) // 0x8FF3847DADD8E30C 0xD437615Cvoid _OBJECT_VALUE_ADD_VECTOR3(Any *objectData, char *key, float valueX, float valueY, float valueZ) // 0x4CD49B76338C7DEE 0x75FC6C3CAny *_OBJECT_VALUE_ADD_OBJECT(Any *objectData, char *key) // 0xA358F56F10732EE1 0x96A8E05FAny *_OBJECT_VALUE_ADD_ARRAY(Any *objectData, char *key) // 0x5B11728527CA6E5F 0x03939B8DBOOL _OBJECT_VALUE_GET_BOOLEAN(Any *objectData, char *key) // 0x1186940ED72FFEEC 0x8876C872int _OBJECT_VALUE_GET_INTEGER(Any *objectData, char *key) // 0x78F06F6B1FB5A80C 0xA6C68693float _OBJECT_VALUE_GET_FLOAT(Any *objectData, char *key) // 0x06610343E73B9727 0xA92C1AF4char *_OBJECT_VALUE_GET_STRING(Any *objectData, char *key) // 0x3D2FD9E763B24472 0x942160ECVector3 _OBJECT_VALUE_GET_VECTOR3(Any *objectData, char *key) // 0x46CD3CB66E0825CC 0xE84A127AAny *_OBJECT_VALUE_GET_OBJECT(Any *objectData, char *key) // 0xB6B9DDC412FCEEE2 0xC9C13D8DAny *_OBJECT_VALUE_GET_ARRAY(Any *objectData, char *key) // 0x7A983AA9DA2659ED 0x1F2F7D00int _OBJECT_VALUE_GET_TYPE(Any *objectData, char *key) // 0x031C55ED33227371 0x2678342Avoid _ARRAY_VALUE_ADD_BOOLEAN(Any *arrayData, BOOL value) // 0xF8B0F5A43E928C76 0x08174B90void _ARRAY_VALUE_ADD_INTEGER(Any *arrayData, int value) // 0xCABDB751D86FE93B 0xF29C0B36void _ARRAY_VALUE_ADD_FLOAT(Any *arrayData, float value) // 0x57A995FD75D37F56 0xE4302123void _ARRAY_VALUE_ADD_STRING(Any *arrayData, char *value) // 0x2F0661C155AEEEAA 0xF3C01350void _ARRAY_VALUE_ADD_VECTOR3(Any *arrayData, float valueX, float valueY, float valueZ) // 0x407F8D034F70F0C2 0x16F464B6Any *_ARRAY_VALUE_ADD_OBJECT(Any *arrayData) // 0x6889498B3E19C797 0xC174C71BBOOL _ARRAY_VALUE_GET_BOOLEAN(Any *arrayData, int arrayIndex) // 0x50C1B2874E50C114 0xA2E5F921int _ARRAY_VALUE_GET_INTEGER(Any *arrayData, int arrayIndex) // 0x3E5AE19425CD74BE 0xBB120CFCfloat _ARRAY_VALUE_GET_FLOAT(Any *arrayData, int arrayIndex) // 0xC0C527B525D7CFB5 0x08AD2CC2 (currently called FOCUS_USE_SPLINE...seriously?)char *_ARRAY_VALUE_GET_STRING(Any *arrayData, int arrayIndex) // 0xD3F2FFEB8D836F52 0x93F985A6 (currently called OVERIDE_TEXTURENAMES)Vector3 _ARRAY_VALUE_GET_VECTOR3(Any *arrayData, int arrayIndex) // 0x8D2064E5B64A628A 0x80E3DA55Any *_ARRAY_VALUE_GET_OBJECT(Any *arrayData, int arrayIndex) // 0x8B5FADCC4E3A145F 0xECE81278int _ARRAY_VALUE_GET_SIZE(Any *arrayData) // 0x065DB281590CEA2D 0xA8A21766int _ARRAY_VALUE_GET_TYPE(Any *arrayData, int arrayIndex)// 0x3A0014ADB172A3C5 0xFA2402C8"JSONObject" and "JSONArray" value types would accompany these natives nicely! (hint hint, nudge nudge ) XBLToothPik, kallas and Alexander Blade 3 Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067540653 Share on other sites More sharing options...
Aquilon96 Posted June 3, 2015 Share Posted June 3, 2015 nicer does not mean better I'm talking specifically about interacting with GTAIV engine using the c++ hook only or interacting through the .net scripthook. The .Net hook DOES in fact make the scripters job easier and to me that is better. I'm not talking which language is better as we all know c++ has it's advantages and .Net has its advantages. Just talking about working with the 2 hooks available. Not to mention the .Net hook allows me to reload scripts I'm working on in game. I love being able to Alt-Tab to VS, change code... compile with a post build event to install the dll and alt-Tab back into game within a few seconds. This is all a matter of how things were designed and the .Net hook is so much nicer. Aru's hook also has the ability to reload on the fly. I prefer the c++ hook over a.net precisely because it allows for more freedom, including the ability to call natives by hash. And it doesn't add another dependency just because it is easier to use, easy doesn't mean it is better. what freedom do u gain i wonder? how do u reload asi scripts then? plus i like c#... it really depends on what u like to code in C# is much better than C++ but hey that's my opinion. Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067545783 Share on other sites More sharing options...
XBLToothPik Posted June 4, 2015 Share Posted June 4, 2015 (edited) Will be posting links to natives that I have researched/discovered on NativeDB on this post. Entity _GET_PED_KILLER(Ped ped) // 93C8B64DEB84728C 84ADF9EB http://www.dev-c.com/nativedb/func/info/93c8b64deb84728cBOOL _WORLD3D_TO_SCREEN2D(float x3d, float y3d, float z3d, float *x2d, float *y2d) // 34E82F05DF2974F5 1F950E4B http://www.dev-c.com/nativedb/func/info/34e82f05df2974f5 Edited June 4, 2015 by XBLToothPik Alexander Blade, leftas and sasuke78200 3 Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067548901 Share on other sites More sharing options...
derkk Posted June 4, 2015 Share Posted June 4, 2015 (edited) I found these but have not added them to nativeDB. Perhaps somebody wants to confirm them, make up better names and add them? GAMEPLAY::_0xF3BBE884A14BB413(out *any, out *any, out *float progress_or_time) _GET_WEATHER_TYPE_TRANSITIONGAMEPLAY::_0x_578C752848ECFA0C(in any, in any, in float time) _SET_WEATHER_TYPE_TRANSITION | I think this uses hashes as in parametersGAMEPLAY::_0x_643E26EA6E024D92(in float) _SET_RAIN_FX_INTENSITY in float | puddles, rain fx on ground/buildings/puddles, rain soundGAMEPLAY::_0x_F6062E089251C898() _CREATE_LIGHTNING_THUNDER | creates single lightning+thunder at random positionGAMEPLAY::_0x_957E790EA1727B64() _CLEAR_CLOUD_HAT | GAMEPLAY::_0x_FC4842A34657BFCB(in char*, float) _SET_CLOUD_HAT_TRANSITION | in type_string, in time_in_seconds cloud hat types: Cloudy 01RAINhorizonband1horizonband2PuffsWispyHorizonStormy 01Clear 01Snowy 01ContrailsaltostratusNimbusCirruscirrocumulusstratoscumulushorizonband3Stripeyhorseyshower Ocean stuff: Lua script to easily test this values, requires GTALua (it is possibly no longer compatible): http://pastebin.com/HimL8jL9 All of these control the ocean: GAMEPLAY::_0xB8F87EAD7533B176(float);GAMEPLAY::_0xC3EAD29AB273ECE8(float); | Wave height?GAMEPLAY::_0xA7A1127490312C36(float);GAMEPLAY::_0x31727907B2C43C55(float);GAMEPLAY::_0x405591EC8FD9096D(float);GAMEPLAY::_0xF751B16FB32ABC1D(float);GAMEPLAY::_0xB3E6360DDE733E82(float);GAMEPLAY::_0x7C9C0B1EEB1F9072(float);GAMEPLAY::_0x6216B116083A7CB4(float); | Ripple min bumpiness?GAMEPLAY::_0x9F5E6BB6B34540DA(float);GAMEPLAY::_0xB9854DFDE0D833D6(float); | Ripple max bumpiness?GAMEPLAY::_0xC54A08C85AE4D410(float); | Wave height multiplier?GAMEPLAY::_0xA8434F1DFF41D6E7(float);GAMEPLAY::_0xC3C221ADDDE31A11(float); | float is time in seconds, goes from smooth surface to current settings over time I think the ocean natives map to some of these values: <RippleBumpiness value="0.420000" /> <RippleMinBumpiness value="0.250000" /> <RippleMaxBumpiness value="0.500000" /> <RippleBumpinessWindScale value="0.500000" /> <RippleScale value="0.040000" /> <RippleSpeed value="20.000000" /> <RippleVelocityTransfer value="0.450000" /> <OceanBumpiness value="0.250000" /> <DeepOceanScale value="4.46000" /> <OceanNoiseMinAmplitude value="20.55000" /> <OceanWaveAmplitude value="2.030000" /> <ShoreWaveAmplitude value="1.800000" /> <OceanWaveWindScale value="0.700000" /> <ShoreWaveWindScale value="0.700000" /> <OceanWaveMinAmplitude value="3.760000" /> <ShoreWaveMinAmplitude value="2.000000" /> <OceanWaveMaxAmplitude value="14.500000" /> <ShoreWaveMaxAmplitude value="1.500000" /> <OceanFoamIntensity value="0.140000" /> <OceanFoamScale value="0.050000" /> <RippleDisturb value="0.050000" /> Edited June 4, 2015 by derkk Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067551734 Share on other sites More sharing options...
timnboys Posted June 5, 2015 Share Posted June 5, 2015 Could anyone enlighten me on how to do in .net scripthook or c++ scripthook how to disable the sirens while leaving the lights on? As I found the lights and sirens mod and spoke to the author on how it works but I am having trouble trying to script the structure of the code as I could code it fine but the problem is how to tell how many times a key on keyboard has been pressed to basically tell whether to enable light stage 0,1,2? Light stage one being off, light stage 1 being lights only, light stage 2 being lights and sirens. If it helps anyone to help me out I have written the below code so far to do this but am stuck on the above issue: Imports System.CollectionsImports System.Collections.GenericImports System.DataImports System.DiagnosticsImports System.Windows.FormsImports GTAImports GTA.NativeImports GTA.MathImports System.IO'Imports System.Collections.GenericImports System.DrawingImports System.Globalization'Imports System.IOImports System.NetImports System.TextImports System.Threading'Imports System.Windows.FormsImports System.Windows.Forms.VisualStylesPublic Class LIGHTSONLYV Inherits GTA.Script Private Player As Integer = Game.Player.Character.Handle Private LightStateOf As New LightStates() 'int StateIndicator = 0; Private State As Integer = 0 'Private _EnableSiren As Boolean = False Public Sub New() AddHandler KeyDown, AddressOf KeyDownHandler AddHandler KeyUp, AddressOf KeyUpHandler AddHandler Tick, AddressOf OnTick ' Main loop event, called every few milliseconds specified via the Interval property. 'KeyUp += KeyUpHandler; '''/ Called when a key or mouse button is released. 'KeyDown += KeyDownHandler; ' Called when a key or mouse button is pressed. ' Tick interval in milliseconds. Set to zero to run as fast as possible. Interval = 0 End Sub Private Enum LightStates LightsOnly LightsSirens Off End Enum Private Sub OnTick(sender As Object, e As EventArgs) Try Select Case State Case 0 Exit Select Case 1 While True GTA.Native.[Function].[Call](Hash.SET_VEHICLE_SIREN, Game.Player.Character.CurrentVehicle, True) GTA.Native.[Function].[Call](Hash.DISABLE_VEHICLE_IMPACT_EXPLOSION_ACTIVATION, Game.Player.Character.CurrentVehicle, True) GTA.Native.[Function].[Call](Hash.SET_VEHICLE_SIREN, Game.Player.Character.CurrentVehicle, False) GTA.Native.[Function].[Call](Hash.DISABLE_VEHICLE_IMPACT_EXPLOSION_ACTIVATION, Game.Player.Character.CurrentVehicle, False) Exit While End While Exit Select Case 2 Exit Select 'Ignore And Continue End Select Catch ex As Exception drawtext(ex.Message.ToString()) End Try End Sub Private Sub PlayYelpSiren() Try GTA.Native.[Function].[Call](Hash.BLIP_SIREN, Game.Player.Character.CurrentVehicle) Catch ex As Exception 'File.WriteAllText(Application.StartupPath + "\\LogLIGHTSONLYV.log", ex.Data.ToString() & ex.InnerException.ToString() & ex.TargetSite.ToString() & ex.StackTrace() & ex.Source() & ex.Message()); drawtext(ex.Message.ToString()) End Try End Sub Private Sub PlayWailSiren() ' Not Possible At the Moment Holded until Future Version End Sub Private Sub KeyUpHandler(o As Object, e As KeyEventArgs) Try Select Case e.KeyData Case Keys.M If State = 0 Then LightStateOf = LightStates.LightsOnly State = 1 ' Perform Code here Exit Select ElseIf State = 1 Then LightStateOf = LightStates.LightsSirens State = 2 ' Perform Code Here Exit Select ElseIf State = 2 Then LightStateOf = LightStates.Off State = 0 ' Perform Code Here Exit Select End If Exit Select 'Case Keys.J ' _EnableSiren = True Case Keys.T PlayYelpSiren() Exit Select 'Case Keys.K ' _EnableSiren = False End Select Catch ex As Exception 'File.WriteAllText(Application.StartupPath + "\\LogLIGHTSONLYV.log", "Error Occurred --- Data:" + ex.Data.ToString + ex.InnerException.ToString + ex.TargetSite.ToString + ex.StackTrace + ex.Source + ex.Message); drawtext(ex.Message.ToString()) End Try End Sub Private Sub KeyDownHandler(o As Object, e As KeyEventArgs) Try Select Case e.KeyData Case Keys.M If State = 0 Then LightStateOf = LightStates.LightsOnly State = 1 ' Perform Code here Exit Select ElseIf State = 1 Then LightStateOf = LightStates.LightsSirens State = 2 ' Perform Code Here Exit Select ElseIf State = 2 Then LightStateOf = LightStates.Off State = 0 ' Perform Code Here Exit Select End If Exit Select 'Case Keys.J ' _EnableSiren = True Case Keys.T PlayYelpSiren() Exit Select 'Case Keys.K ' _EnableSiren = False End Select Catch ex As Exception 'File.WriteAllText(Application.StartupPath + "\\LogLIGHTSONLYV.log", "Error Occurred --- Data:" + ex.Data.ToString + ex.InnerException.ToString + ex.TargetSite.ToString + ex.StackTrace + ex.Source + ex.Message); drawtext(ex.Message.ToString()) End Try End Sub Private Sub drawtext(text As [string]) GTA.Native.[Function].[Call](Hash._SET_TEXT_ENTRY, "STRING") GTA.Native.[Function].[Call](Hash._ADD_TEXT_COMPONENT_STRING, text) GTA.Native.[Function].[Call](Hash._0x2ED7843F8F801023, False, True) End SubEnd Class And here is it's original code in c#: using Microsoft.VisualBasic;using System;using System.Collections;using System.Collections.Generic;using System.Data;using System.Diagnostics;using System.Windows.Forms;using GTA;using GTA.Native;using GTA.Math;using System.IO;//Imports System.Collections.Genericusing System.Drawing;using System.Globalization;//Imports System.IOusing System.Net;using System.Text;using System.Threading;//Imports System.Windows.Formsusing System.Windows.Forms.VisualStyles;public class LIGHTSONLYV : GTA.Script{ int Player = Game.Player.Character.Handle; private LightStates LightStateOf = new LightStates(); //int StateIndicator = 0; int State = 0; //Private _EnableSiren As Boolean = False public LIGHTSONLYV() { KeyDown += KeyDownHandler; KeyUp += KeyUpHandler; Tick += OnTick; // Main loop event, called every few milliseconds specified via the Interval property. //KeyUp += KeyUpHandler; //// Called when a key or mouse button is released. //KeyDown += KeyDownHandler; // Called when a key or mouse button is pressed. // Tick interval in milliseconds. Set to zero to run as fast as possible. Interval = 0; } private enum LightStates { LightsOnly, LightsSirens, Off } private void OnTick(object sender, EventArgs e) { try { switch (State) { case 0: break; case 1: while (true) { GTA.Native.Function.Call(Hash.SET_VEHICLE_SIREN, Game.Player.Character.CurrentVehicle, true); GTA.Native.Function.Call(Hash.DISABLE_VEHICLE_IMPACT_EXPLOSION_ACTIVATION, Game.Player.Character.CurrentVehicle, true); GTA.Native.Function.Call(Hash.SET_VEHICLE_SIREN, Game.Player.Character.CurrentVehicle, false); GTA.Native.Function.Call(Hash.DISABLE_VEHICLE_IMPACT_EXPLOSION_ACTIVATION, Game.Player.Character.CurrentVehicle, false); break; } break; case 2: break; //Ignore And Continue } } catch (Exception ex) { drawtext(ex.Message.ToString()); } } private void PlayYelpSiren() { try { GTA.Native.Function.Call(Hash.BLIP_SIREN, Game.Player.Character.CurrentVehicle); } catch (Exception ex) { drawtext(ex.Message.ToString()); //File.WriteAllText(Application.StartupPath + "\\LogLIGHTSONLYV.log", ex.Data.ToString() & ex.InnerException.ToString() & ex.TargetSite.ToString() & ex.StackTrace() & ex.Source() & ex.Message()); } } private void PlayWailSiren() { // Not Possible At the Moment Holded until Future Version } private void KeyUpHandler(object o, KeyEventArgs e) { try { switch (e.KeyData) { case Keys.M: if (State == 0) { LightStateOf = LightStates.LightsOnly; State = 1; break; // Perform Code here } else if (State == 1) { LightStateOf = LightStates.LightsSirens; State = 2; break; // Perform Code Here } else if (State == 2) { LightStateOf = LightStates.Off; State = 0; break; // Perform Code Here } break; //Case Keys.J // _EnableSiren = True case Keys.T: PlayYelpSiren(); break; //Case Keys.K // _EnableSiren = False } } catch (Exception ex) { drawtext(ex.Message.ToString()); //File.WriteAllText(Application.StartupPath + "\\LogLIGHTSONLYV.log", "Error Occurred --- Data:" + ex.Data.ToString + ex.InnerException.ToString + ex.TargetSite.ToString + ex.StackTrace + ex.Source + ex.Message); } } private void KeyDownHandler(object o, KeyEventArgs e) { try { switch (e.KeyData) { case Keys.M: if (State == 0) { LightStateOf = LightStates.LightsOnly; State = 1; break; // Perform Code here } else if (State == 1) { LightStateOf = LightStates.LightsSirens; State = 2; break; // Perform Code Here } else if (State == 2) { LightStateOf = LightStates.Off; State = 0; break; // Perform Code Here } break; //Case Keys.J // _EnableSiren = True case Keys.T: PlayYelpSiren(); break; //Case Keys.K // _EnableSiren = False } } catch (Exception ex) { drawtext(ex.Message.ToString()); //File.WriteAllText(Application.StartupPath + "\\LogLIGHTSONLYV.log", "Error Occurred --- Data:" + ex.Data.ToString + ex.InnerException.ToString + ex.TargetSite.ToString + ex.StackTrace + ex.Source + ex.Message); } } private void drawtext(String text) { GTA.Native.Function.Call(Hash._SET_TEXT_ENTRY, "STRING"); GTA.Native.Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, text); GTA.Native.Function.Call(Hash._0x2ED7843F8F801023, false, true); }} Please tell me if anyone could help me out and see if my code will do what I want or if I need to change it give me some example code on how to script it instead(or change my code to how it should be). Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067555942 Share on other sites More sharing options...
Fireboyd78 Posted June 5, 2015 Share Posted June 5, 2015 Keep track of the current light state. Each time user presses a button, increase by one. I'm on mobile so posting is a bitch but it'd be something like if state < 2 then state += 1 else state = 0 Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067555993 Share on other sites More sharing options...
Fireboyd78 Posted June 7, 2015 Share Posted June 7, 2015 (edited) Has Glokon been around lately? All the natives I've found below are guaranteed to be correct: start_particle_fx_looped_on_entity_bone set_particle_fx_non_looped_colour set_fade_out_after_death set_fade_out_after_arrestget_shop_ped_outfit get_hash_name_for_prop get_variant_component get_hash_name_for_component get_num_dlc_weapon_components get_num_dlc_weapons set_ped_can_arm_ik set_ped_can_torso_ik Edited June 7, 2015 by Fireboyd78 XBLToothPik and Tez2 2 Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067561376 Share on other sites More sharing options...
XBLToothPik Posted June 7, 2015 Share Posted June 7, 2015 (edited) Has Glokon been around lately? All the natives I've found below are guaranteed to be correct: start_particle_fx_looped_on_entity_bone set_particle_fx_non_looped_colour set_fade_out_after_death set_fade_out_after_arrest get_shop_ped_outfit get_hash_name_for_prop get_variant_component get_hash_name_for_component get_num_dlc_weapon_components get_num_dlc_weapons set_ped_can_arm_ik set_ped_can_torso_ik Sorry, I mainly confirm natives on the site, but haven't been on in a while. Will make sure to confirm these right now. Also I suggest to create an account on there so I know that you are the one posting natives. Edited June 7, 2015 by XBLToothPik Fireboyd78 1 Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067561383 Share on other sites More sharing options...
TJGM Posted June 7, 2015 Share Posted June 7, 2015 @timnboys this thread is for documentation, if you want to ask questions start a thread here. Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067562699 Share on other sites More sharing options...
reoze Posted June 8, 2015 Share Posted June 8, 2015 void _0x10C2FA78D0E128A1(Any *p0, Any *p1) // 10C2FA78D0E128A1 9B38374A REGISTER_ENUM_TO_SAVE sasuke78200 1 Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067565732 Share on other sites More sharing options...
Fireboyd78 Posted June 8, 2015 Share Posted June 8, 2015 void _0x10C2FA78D0E128A1(Any *p0, Any *p1) // 10C2FA78D0E128A1 9B38374A REGISTER_ENUM_TO_SAVE I updated the name for you. Good find! sasuke78200 1 Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067565854 Share on other sites More sharing options...
Natrik Posted June 9, 2015 Share Posted June 9, 2015 Can/Should we document subroutines anywhere? I've found working of couple of them. Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067570097 Share on other sites More sharing options...
Fireboyd78 Posted June 9, 2015 Share Posted June 9, 2015 Can/Should we document subroutines anywhere? I've found working of couple of them.Why not? Any form of documentation is appreciated, at least by me! Link to comment https://gtaforums.com/topic/717612-v-scriptnative-documentation-and-research/page/21/#findComment-1067570104 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now