Mikki m8 Posted May 11, 2015 Share Posted May 11, 2015 I'm new to this but I managed to write a simple script to play animations    if get_key_pressed(PlayAnim_key) thenSTREAMING.REQUEST_ANIM_DICT("rcmextreme3")AI.TASK_PLAY_ANIM(playerPed, "rcmextreme3", "jump_fall", 8, -8, -1, 0, 0, false, 0, true)end I don't know exactly what a few of the parameters do but this code plays the animation once. I can make it loop and have it only play the last frame as well.  The thing is I don't know how to get the names of animations so I can actually play them. I got a few animations from searching around the internet.  I can use OpenIV to find the dictionary/clip set but not the actual animations contained in them.  Is there any way to read the animation dictionaries or get it to play a random animation from the dictionary, with LUA or otherwise? Or is there a list of the animations somewhere? Link to comment Share on other sites More sharing options...
vitalik2187836 Posted May 11, 2015 Share Posted May 11, 2015 (edited) Â Can anyone help me? My game crashing everytime i load savegame. But everything works fine on first game load. post your scripthookv.log and all other logs in your gta5 folder also tell us which mods u have installed how should we find whats wrong when u dont give us more information? Â https://yadi.sk/d/NHLZAGBTgZCBm Here's my logs. I have many mods installed, but it crashes when i install both, gta lua and scripthook v dot net. Edited May 11, 2015 by vitalik2187836 Link to comment Share on other sites More sharing options...
headscript Posted May 11, 2015 Author Share Posted May 11, 2015 Â Â Can anyone help me? My game crashing everytime i load savegame. But everything works fine on first game load. post your scripthookv.log and all other logs in your gta5 folder also tell us which mods u have installed how should we find whats wrong when u dont give us more information? Â https://yadi.sk/d/NHLZAGBTgZCBm Here's my logs. I have many mods installed, but it crashes when i install both, gta lua and scripthook v dot net. Â try from this verson the LUA.asi and main.lua: https://mega.co.nz/#!8BQBQIBZ!BL-Ob84kLAjdUM_-VLTxcxqaWo-rHbharyGkbjBolE8 if that is not working its probably because of the dotnet hook Link to comment Share on other sites More sharing options...
vitalik2187836 Posted May 11, 2015 Share Posted May 11, 2015    Can anyone help me? My game crashing everytime i load savegame. But everything works fine on first game load. post your scripthookv.log and all other logs in your gta5 folder also tell us which mods u have installed how should we find whats wrong when u dont give us more information?  https://yadi.sk/d/NHLZAGBTgZCBm Here's my logs. I have many mods installed, but it crashes when i install both, gta lua and scripthook v dot net.  try from this verson the LUA.asi and main.lua: https://mega.co.nz/#!8BQBQIBZ!BL-Ob84kLAjdUM_-VLTxcxqaWo-rHbharyGkbjBolE8 if that is not working its probably because of the dotnet hook  Ok, ill try. Link to comment Share on other sites More sharing options...
Tiryll Posted May 11, 2015 Share Posted May 11, 2015 (edited) I'm new to this but I managed to write a simple script to play animations   if get_key_pressed(PlayAnim_key) thenSTREAMING.REQUEST_ANIM_DICT("rcmextreme3")AI.TASK_PLAY_ANIM(playerPed, "rcmextreme3", "jump_fall", 8, -8, -1, 0, 0, false, 0, true)end-- Is there any way to read the animation dictionaries or get it to play a random animation from the dictionary, with LUA or otherwise? Or is there a list of the animations somewhere?   I found these online private dance/ mini@strip_club@lap_dance_2g@ld_2g_p1", "ld_2g_p1_s2 dog hump / missfra0_chop_find", "hump_loop_chop tap dance / SPECIAL_PED@MOUNTAIN_DANCER@MONOLOGUE_1@MONOLOGUE_ 1A", "MTN_DNC_if_you_want_to_get_to_heaven trevor anim / SWITCH@TREVOR@MOCKS_LAPDANCE", "001443_01_TRVS_28_IDLE_TRV trevor anim / SWITCH@TREVOR@JERKING_OFF", "trev_jerking_off_loop swim / SWIMMING@scuba", "dive_run shower / mp_safehouseshower@male@", "male_shower_idle_b private dance / mini@strip_club@lap_dance_2g@ld_2g_p2", "ld_2g_p2_s2 drunk sex f / random@drunk_driver_2", "cardrunksex_loop_f drunk sex m / random@drunk_driver_2", "cardrunksex_loop_m car sex f / ODDJOBS@ASSASSINATE@VICE@SEX", "frontseat_carsex_loop_f car sex m / ODDJOBS@ASSASSINATE@VICE@SEX", "frontseat_carsex_loop_m car blowjob f / mini@prostitutes@sexnorm_veh", "BJ_loop_prostitute car blowjob m / mini@prostitutes@sexnorm_veh", "BJ_loop_male priv dance / mini@strip_club@lap_dance_2g@ld_2g_p3", "ld_2g_p3_s2 pushups / amb@world_human_push_ups@male@base", "base sit ups / amb@world_human_sit_ups@male@base", "base pull ups / SWITCH@FRANKLIN@GYM", "001942_02_GC_FRAS_IG_5_BASE two hand wave / random@prisoner_lift", "arms_waving rolling a barrel / misschinese2_barrelroll", "barrel_roll_loop_A meditiating / rcmcollect_paperleadinout@", "meditiate_idle  Did some digging: "amb@world_human_guard_patrol@male@idle_b", "idle_e" "re@construction", "Out_Of_Breath" "re@construction", "idle_panic" "re@construction", "idle_panic" ( IN-CAR )  Using these in my mod atm: RANDOM@ARRESTS@BUSTED "kneeling_arrest_get_up" RANDOM@ARRESTS "idle_2_hands_up"    see: Decompiled scripts All decompiled scripts in one archive. Edited May 11, 2015 by Tiryll Mikki m8 1 Link to comment Share on other sites More sharing options...
topeira Posted May 11, 2015 Share Posted May 11, 2015     i also cant get any LUA script to work. :\  my log:    // GTA V SCRIPT HOOK (build May 2 2015, v1.0.350.2a) // © Alexander Blade 2015 [16:44:20] INIT: Started [16:44:20] INIT: Success, game version is VER_1_0_350_2_NOSTEAM [16:44:20] INIT: Registering script 'HeistVeh.asi' (0x000007FEF7015CA0) [16:44:20] INIT: Registering script 'LUA.asi' (0x000007FEE148B9DC) [16:44:20] INIT: Registering script 'NativeTrainer.asi' (0x000007FEDFA71C2B) [16:44:20] INIT: Registering script 'NitroMod.asi' (0x000007FEF9CB2FB0) [16:44:20] INIT: Registering script 'OpenInteriors.asi' (0x000007FEF4BC65B0) [16:44:20] INIT: Registering script 'RareCars.asi' (0x000007FEE322111D) [16:44:20] INIT: Registering script 'RiotMode.asi' (0x000007FEF4B44EC0) [16:44:20] INIT: Registering script 'ScriptHookVDotNet.asi' (0x000007FEE90F27C0) [16:44:32] INIT: GtaThread collection size 164 [16:44:32] INIT: wnd proc 0x00000000FFFF092D [16:45:28] CORE: Requesting thread creation [16:45:28] CORE: Creating threads [16:45:30] CORE: Started control thread, id 28 active 1 [16:45:30] CORE: Started thread 'HeistVeh.asi', id 29 active 1 [16:45:30] CORE: Started thread 'LUA.asi', id 30 active 1 [16:45:30] CORE: Started thread 'NativeTrainer.asi', id 31 active 1 [16:45:30] CORE: Started thread 'NitroMod.asi', id 32 active 1 [16:45:30] CORE: Started thread 'OpenInteriors.asi', id 33 active 1 [16:45:30] CORE: Started thread 'RareCars.asi', id 34 active 1 [16:45:30] CORE: Started thread 'RiotMode.asi', id 35 active 1 [16:45:30] CORE: Started thread 'ScriptHookVDotNet.asi', id 36 active 1 [16:45:30] CORE: Launching main() for 'HeistVeh.asi' [16:45:30] CORE: Launching main() for 'LUA.asi' [16:45:30] CORE: Launching main() for 'NativeTrainer.asi' [16:45:30] CORE: Launching main() for 'NitroMod.asi' [16:45:30] CORE: Launching main() for 'OpenInteriors.asi' [16:45:30] CORE: Launching main() for 'RareCars.asi' [16:45:30] CORE: Launching main() for 'RiotMode.asi' [16:45:30] CORE: Launching main() for 'ScriptHookVDotNet.asi' [17:41:28] UNINIT: Unregistering script 'ScriptHookVDotNet.asi' (0x000007FEE90F27C0) [17:41:28] UNINIT: Unregistering script 'RareCars.asi' (0x000007FEE322111D) [17:41:28] UNINIT: Unregistering script 'NitroMod.asi' (0x000007FEF9CB2FB0)   which Lua scripts did u tried and show me the content of your scripts and addins folder  my scripts folder has: addins folder lib folder main.lua  inside addins i got: health.lua immersiveHUD.lua regen.lua szabopersist.lua  ok give this version a try https://mega.co.nz/#!8BQBQIBZ!BL-Ob84kLAjdUM_-VLTxcxqaWo-rHbharyGkbjBolE8 many people reported that this one wokrs better replace the lua.asi(or use the SDK to see errors if it still happens :S) with the one of this archive and the main.lua  thaaaaanks!!!  this works. finally!  if this alternative version works for ppl who cant get the main version to work than i guess it's best if there is a clear explanation about this in the main page, telling ppl who have issues to try it. Link to comment Share on other sites More sharing options...
headscript Posted May 11, 2015 Author Share Posted May 11, 2015      i also cant get any LUA script to work. :\  my log:    // GTA V SCRIPT HOOK (build May 2 2015, v1.0.350.2a) // © Alexander Blade 2015 [16:44:20] INIT: Started [16:44:20] INIT: Success, game version is VER_1_0_350_2_NOSTEAM [16:44:20] INIT: Registering script 'HeistVeh.asi' (0x000007FEF7015CA0) [16:44:20] INIT: Registering script 'LUA.asi' (0x000007FEE148B9DC) [16:44:20] INIT: Registering script 'NativeTrainer.asi' (0x000007FEDFA71C2B) [16:44:20] INIT: Registering script 'NitroMod.asi' (0x000007FEF9CB2FB0) [16:44:20] INIT: Registering script 'OpenInteriors.asi' (0x000007FEF4BC65B0) [16:44:20] INIT: Registering script 'RareCars.asi' (0x000007FEE322111D) [16:44:20] INIT: Registering script 'RiotMode.asi' (0x000007FEF4B44EC0) [16:44:20] INIT: Registering script 'ScriptHookVDotNet.asi' (0x000007FEE90F27C0) [16:44:32] INIT: GtaThread collection size 164 [16:44:32] INIT: wnd proc 0x00000000FFFF092D [16:45:28] CORE: Requesting thread creation [16:45:28] CORE: Creating threads [16:45:30] CORE: Started control thread, id 28 active 1 [16:45:30] CORE: Started thread 'HeistVeh.asi', id 29 active 1 [16:45:30] CORE: Started thread 'LUA.asi', id 30 active 1 [16:45:30] CORE: Started thread 'NativeTrainer.asi', id 31 active 1 [16:45:30] CORE: Started thread 'NitroMod.asi', id 32 active 1 [16:45:30] CORE: Started thread 'OpenInteriors.asi', id 33 active 1 [16:45:30] CORE: Started thread 'RareCars.asi', id 34 active 1 [16:45:30] CORE: Started thread 'RiotMode.asi', id 35 active 1 [16:45:30] CORE: Started thread 'ScriptHookVDotNet.asi', id 36 active 1 [16:45:30] CORE: Launching main() for 'HeistVeh.asi' [16:45:30] CORE: Launching main() for 'LUA.asi' [16:45:30] CORE: Launching main() for 'NativeTrainer.asi' [16:45:30] CORE: Launching main() for 'NitroMod.asi' [16:45:30] CORE: Launching main() for 'OpenInteriors.asi' [16:45:30] CORE: Launching main() for 'RareCars.asi' [16:45:30] CORE: Launching main() for 'RiotMode.asi' [16:45:30] CORE: Launching main() for 'ScriptHookVDotNet.asi' [17:41:28] UNINIT: Unregistering script 'ScriptHookVDotNet.asi' (0x000007FEE90F27C0) [17:41:28] UNINIT: Unregistering script 'RareCars.asi' (0x000007FEE322111D) [17:41:28] UNINIT: Unregistering script 'NitroMod.asi' (0x000007FEF9CB2FB0)   which Lua scripts did u tried and show me the content of your scripts and addins folder  my scripts folder has: addins folder lib folder main.lua  inside addins i got: health.lua immersiveHUD.lua regen.lua szabopersist.lua  ok give this version a try https://mega.co.nz/#!8BQBQIBZ!BL-Ob84kLAjdUM_-VLTxcxqaWo-rHbharyGkbjBolE8 many people reported that this one wokrs better replace the lua.asi(or use the SDK to see errors if it still happens :S) with the one of this archive and the main.lua  thaaaaanks!!!  this works. finally!  if this alternative version works for ppl who cant get the main version to work than i guess it's best if there is a clear explanation about this in the main page, telling ppl who have issues to try it.  that version is the future version of the plugin i will release it soon when i got some things fixed Link to comment Share on other sites More sharing options...
ffzero58 Posted May 11, 2015 Share Posted May 11, 2015 Definitely the Decomplied scripts Tiryll referenced is the way to go. Â Here's my sample script STREAMING.REQUEST_ANIM_DICT("mini@strip_club@lap_dance_2g@ld_2g_p3") while (not STREAMING.HAS_ANIM_DICT_LOADED("mini@strip_club@lap_dance_2g@ld_2g_p3")) do wait(50) end AI.TASK_PLAY_ANIM(playerPed, "mini@strip_club@lap_dance_2g@ld_2g_p3", "ld_2g_p3_s2", 8, -4, -1, 0, 0, false, 0, true) wait(50) print("Play anim") I would add a "while (not STREAMING.HAS_ANIM_DICT_LOADED(<anim dict>))" to allow time for the anim dict to load. Sometimes it would not play if the key was pressed. It would take a few tries. Â I use the wait(50) to prevent multiple key presses being registered. Is there a better way to implement this? Link to comment Share on other sites More sharing options...
sakis25 Posted May 11, 2015 Share Posted May 11, 2015 I'm trying to make a script for more interactivity with the objects and props around the player. Something similar to this: https://www.youtube.com/watch?v=sKACZeYo70Q Â But I can't find a way to make the player check if there is an object close to him and then attach to his hand as a weapon. How do think about this idea for GTA V? I believe it will give more realism and interactivity to the game. Link to comment Share on other sites More sharing options...
Tiryll Posted May 11, 2015 Share Posted May 11, 2015 (edited)   But I can't find a way to make the player check if there is an object close to him and then attach to his hand as a weapon. How do think about this idea for GTA V? I believe it will give more realism and interactivity to the game. there's entity touching entity, is entity an object, attach entity to entity, SET_OBJECT_TARGETTABLE all exist. I have no tried working with these things yet  p.s love your mod btw Edited May 11, 2015 by Tiryll Link to comment Share on other sites More sharing options...
headscript Posted May 11, 2015 Author Share Posted May 11, 2015 Definitely the Decomplied scripts Tiryll referenced is the way to go. Â Here's my sample script STREAMING.REQUEST_ANIM_DICT("mini@strip_club@lap_dance_2g@ld_2g_p3") while (not STREAMING.HAS_ANIM_DICT_LOADED("mini@strip_club@lap_dance_2g@ld_2g_p3")) do wait(50) end AI.TASK_PLAY_ANIM(playerPed, "mini@strip_club@lap_dance_2g@ld_2g_p3", "ld_2g_p3_s2", 8, -4, -1, 0, 0, false, 0, true) wait(50) print("Play anim") I would add a "while (not STREAMING.HAS_ANIM_DICT_LOADED(<anim dict>))" to allow time for the anim dict to load. Sometimes it would not play if the key was pressed. It would take a few tries. Â I use the wait(50) to prevent multiple key presses being registered. Is there a better way to implement this? if(self.time == 0) then self.time = GAMEPLAY.GET_GAME_TIMER() end if (GAMEPLAY.GET_GAME_TIMER() - self.time > 5000) then do your things and self.time = 0 ffzero58 1 Link to comment Share on other sites More sharing options...
Szabo Posted May 11, 2015 Share Posted May 11, 2015 Hey guys, is PLAYER.PLAYER_ID() supposed to always return 0? If so, how can I identify which player is currently active? Thanks in advance. Link to comment Share on other sites More sharing options...
TommyX12 Posted May 11, 2015 Share Posted May 11, 2015 Current Version: 9.0 Description: Write any LUA Script for GTA5 you are able to use all Natives from NativeDB    Changelog  Requirements: Script Hook V Visual Studio 2013 x64 Redist Installation Instructions: Extract LUA.zip Move the LUA.asi in the GTA5 Folder where the ScriptHookV.dll is located Place the scripts folder in the GTA 5 Folder Add any Scripts you want into the scripts/addins folder Run GTA 5 over Steam or Rockstar Launcher Extra Note: I can convert your Lua Scripts to fully Independent .asi files for safety/speed just write me a PM Example: local basemodule = {}basemodule .GUI = Libs["GUI"]function basemodule.unload()endfunction basemodule.giveWeapon(weapon) WEAPON.GIVE_DELAYED_WEAPON_TO_PED(PLAYER.PLAYER_PED_ID(), GAMEPLAY.GET_HASH_KEY(weapon), 1000, true)endfunction basemodule.init() bodyguard.GUI.addButton("Give Me RAILGUN",basemodule.giveWeapon,"WEAPON_RAILGUN",0,0.2,0.05,0.05)endfunction basemodule.tick() basemodule.GUI.tick()endreturn basemodule Download: LUA Plugin Download Future Beta Version: https://mega.co.nz/#!8BQBQIBZ!BL-Ob84kLAjdUM_-VLTxcxqaWo-rHbharyGkbjBolE8  Thanks for your Love and Support: martysama0134 (i owe you something)  Hi, how do I get access to the full set of API available (e.g. methods, animations) ? I wanna make a custom fighting mod Link to comment Share on other sites More sharing options...
kopalov Posted May 12, 2015 Share Posted May 12, 2015 So does anyone know how to use DRAW_MARKER? Â And also, why doesn't textutils.unserialize work?Or is it only me who is messing something up and it works for you guys? Otherwise it's kind of a pain to convert lines from file to arrays for table input. Link to comment Share on other sites More sharing options...
headscript Posted May 12, 2015 Author Share Posted May 12, 2015 So does anyone know how to use DRAW_MARKER? Â And also, why doesn't textutils.unserialize work? Or is it only me who is messing something up and it works for you guys? Otherwise it's kind of a pain to convert lines from file to arrays for table input. How is that painful? Can u show some code what u trying to achieve Link to comment Share on other sites More sharing options...
Heist83 Posted May 12, 2015 Share Posted May 12, 2015 (edited)  Hi, I tried both v9 and your future version but I'm still not able to make it work.It worked previously... +scripts +addins defaultradio.lua carupgrade.lua guard.lua pedmoney.lua realistic train.lua regen.lua slomo.lua szabopersist.lua +libs gui.lua main.lua Passenger.dll TruckingMissions.dllLogs :   scripthook.net 0.6[08:11:02] [DEBUG] Created script domain 'ScriptDomain_A72B8CE8'.[08:11:02] [DEBUG] Loading scripts from 'K:\Grand Theft Auto V\scripts' into script domain 'ScriptDomain_A72B8CE8' ...[08:11:02] [DEBUG] Found 1 script(s) in 'Passenger.dll'.[08:11:02] [DEBUG] Found 1 script(s) in 'TruckingMissions.dll'.[08:11:02] [DEBUG] Starting 2 script(s) ...[08:11:02] [DEBUG] Instantiating script 'Moochaka.Passenger' in script domain 'ScriptDomain_A72B8CE8' ...[08:11:02] [DEBUG] Started script 'Moochaka.Passenger'.[08:11:02] [DEBUG] Instantiating script 'TruckingMissions' in script domain 'ScriptDomain_A72B8CE8' ...[08:11:02] [DEBUG] Started script 'TruckingMissions'. // GTA V SCRIPT HOOK (build May 2 2015, v1.0.350.2a)// © Alexander Blade 2015[08:09:46] INIT: Started[08:09:46] INIT: Success, game version is VER_1_0_350_2_NOSTEAM[08:09:46] INIT: Registering script 'AngryPlanes.asi' (0x000007FEEE2331F0)[08:09:46] INIT: Registering script 'ConfPoliceMod.asi' (0x000007FEEEAF96E0)[08:09:46] INIT: Registering script 'EthansAntiVehicle.asi' (0x000007FEFB25E760)[08:09:46] INIT: Registering script 'GravityGun.asi' (0x000007FEEB5B2BD0)[08:09:46] INIT: Registering script 'HeistVeh.asi' (0x000007FEE8733A20)[08:09:46] INIT: Registering script 'Hydraulics.asi' (0x000007FEED8418F0)[08:09:46] INIT: Registering script 'LUA.asi' (0x000007FEE6B3CB30)[08:09:46] INIT: Registering script 'LUA_SDK.asi' (0x000007FEE3BDCBA4)[08:09:46] INIT: Registering script 'Mayhem Mod.asi' (0x000007FEE52611D1)[08:09:46] INIT: Registering script 'NativeTrainer.asi' (0x000007FEE663A610)[08:09:46] INIT: Registering script 'Nice Fly.asi' (0x000007FEE8702700)[08:09:46] INIT: Registering script 'OpenInteriors.asi' (0x000007FEE85565B0)[08:09:46] INIT: Registering script 'PlayerPedRagdoll.asi' (0x000007FEE51B112C)[08:09:46] INIT: Registering script 'RareCars.asi' (0x000007FEE4D11140)[08:09:46] INIT: Registering script 'ScriptHookVDotNet.asi' (0x000007FEE61D27C0)[08:09:46] INIT: Registering script 'Speedometer.asi' (0x000007FEE7491640)[08:09:46] INIT: Registering script 'StrappedPeds.asi' (0x000007FEF77F1410)[08:09:46] INIT: Registering script 'Tank.asi' (0x000007FEE3811140)[08:09:47] INIT: Registering script 'TimeScaler.asi' (0x000007FEE3751177)[08:09:47] INIT: Registering script 'WorkingJB700.asi' (0x000007FEFB281270)[08:10:09] INIT: GtaThread collection size 164[08:10:09] INIT: wnd proc 0x00000000FFFF10ED[08:11:00] CORE: Requesting thread creation[08:11:00] CORE: Creating threads[08:11:02] CORE: Started control thread, id 30 active 1[08:11:02] CORE: Started thread 'AngryPlanes.asi', id 31 active 1[08:11:02] CORE: Started thread 'ConfPoliceMod.asi', id 32 active 1[08:11:02] CORE: Started thread 'EthansAntiVehicle.asi', id 33 active 1[08:11:02] CORE: Started thread 'GravityGun.asi', id 34 active 1[08:11:02] CORE: Started thread 'HeistVeh.asi', id 35 active 1[08:11:02] CORE: Started thread 'Hydraulics.asi', id 36 active 1[08:11:02] CORE: Started thread 'LUA.asi', id 37 active 1[08:11:02] CORE: Started thread 'LUA_SDK.asi', id 38 active 1[08:11:02] CORE: Started thread 'Mayhem Mod.asi', id 39 active 1[08:11:02] CORE: Started thread 'NativeTrainer.asi', id 40 active 1[08:11:02] CORE: Started thread 'Nice Fly.asi', id 41 active 1[08:11:02] CORE: Started thread 'OpenInteriors.asi', id 42 active 1[08:11:02] CORE: Started thread 'PlayerPedRagdoll.asi', id 43 active 1[08:11:02] CORE: Started thread 'RareCars.asi', id 44 active 1[08:11:02] CORE: Started thread 'ScriptHookVDotNet.asi', id 45 active 1[08:11:02] CORE: Started thread 'Speedometer.asi', id 46 active 1[08:11:02] CORE: Started thread 'StrappedPeds.asi', id 47 active 1[08:11:02] CORE: Started thread 'Tank.asi', id 48 active 1[08:11:02] CORE: Started thread 'TimeScaler.asi', id 49 active 1[08:11:02] CORE: Started thread 'WorkingJB700.asi', id 0 active 0[08:11:02] CORE: Launching main() for 'AngryPlanes.asi'[08:11:02] CORE: Launching main() for 'ConfPoliceMod.asi'[08:11:02] CORE: Launching main() for 'EthansAntiVehicle.asi'[08:11:02] CORE: Launching main() for 'GravityGun.asi'[08:11:02] CORE: Launching main() for 'HeistVeh.asi'[08:11:02] CORE: Launching main() for 'Hydraulics.asi'[08:11:02] CORE: Launching main() for 'LUA.asi'[08:11:02] CORE: Launching main() for 'LUA_SDK.asi'[08:11:02] CORE: Launching main() for 'Mayhem Mod.asi'[08:11:02] CORE: Launching main() for 'NativeTrainer.asi'[08:11:02] CORE: Launching main() for 'Nice Fly.asi'[08:11:02] CORE: Launching main() for 'OpenInteriors.asi'[08:11:02] CORE: Launching main() for 'PlayerPedRagdoll.asi'[08:11:02] CORE: Launching main() for 'RareCars.asi'[08:11:02] CORE: Launching main() for 'ScriptHookVDotNet.asi'[08:11:02] CORE: Launching main() for 'Speedometer.asi'[08:11:02] CORE: Launching main() for 'StrappedPeds.asi'[08:11:02] CORE: Launching main() for 'Tank.asi'[08:11:02] CORE: Launching main() for 'TimeScaler.asi'[08:13:35] UNINIT: Unregistering script 'Tank.asi' (0x000007FEE3811140)[08:13:35] UNINIT: Unregistering script 'ScriptHookVDotNet.asi' (0x000007FEE61D27C0)[08:13:35] UNINIT: Unregistering script 'RareCars.asi' (0x000007FEE4D11140)[08:13:35] UNINIT: Unregistering script 'PlayerPedRagdoll.asi' (0x000007FEE51B112C)[08:13:35] UNINIT: Unregistering script 'ConfPoliceMod.asi' (0x000007FEEEAF96E0) // GTA V ASI LOADER (build May 2 2015)// © Alexander Blade 2015LIB: "C:\Windows\system32\dinput8.dll" => 000007FEF0430000API: "DirectInput8Create" => 000007FEF0434820API: "DllCanUnloadNow" => 000007FEF04420DCAPI: "DllGetClassObject" => 000007FEF0442014API: "DllRegisterServer" => 000007FEF0451050API: "DllUnregisterServer" => 000007FEF0451064LOADER: Loading *.asi pluginsASI: Loading "K:\Grand Theft Auto V\AngryPlanes.asi" "AngryPlanes.asi" => 000007FEEEAF0000ASI: Loading "K:\Grand Theft Auto V\ConfPoliceMod.asi" "ConfPoliceMod.asi" => 000007FEEE230000ASI: Loading "K:\Grand Theft Auto V\EthansAntiVehicle.asi" "EthansAntiVehicle.asi" => 000007FEF77F0000ASI: Loading "K:\Grand Theft Auto V\GravityGun.asi" "GravityGun.asi" => 000007FEE95B0000ASI: Loading "K:\Grand Theft Auto V\HeistVeh.asi" "HeistVeh.asi" => 000007FEED840000ASI: Loading "K:\Grand Theft Auto V\Hydraulics.asi" "Hydraulics.asi" => 000007FEEB5C0000ASI: Loading "K:\Grand Theft Auto V\LUA.asi" "LUA.asi" => 000007FEE59C0000ASI: Loading "K:\Grand Theft Auto V\LUA_SDK.asi" "LUA_SDK.asi" => 000007FEE57E0000ASI: Loading "K:\Grand Theft Auto V\Mayhem Mod.asi" "Mayhem Mod.asi" => 000007FEE6230000ASI: Loading "K:\Grand Theft Auto V\NativeTrainer.asi" "NativeTrainer.asi" => 000007FEE6620000ASI: Loading "K:\Grand Theft Auto V\Nice Fly.asi" "Nice Fly.asi" => 000007FEE9580000ASI: Loading "K:\Grand Theft Auto V\OpenInteriors.asi" "OpenInteriors.asi" => 000007FEE7490000ASI: Loading "K:\Grand Theft Auto V\OpenIV.asi" "OpenIV.asi" => 000007FEE8550000ASI: Loading "K:\Grand Theft Auto V\PlayerPedRagdoll.asi" "PlayerPedRagdoll.asi" => 000007FEE5730000ASI: Loading "K:\Grand Theft Auto V\RareCars.asi" "RareCars.asi" => 000007FEE5680000ASI: Loading "K:\Grand Theft Auto V\ScriptHookVDotNet.asi" "ScriptHookVDotNet.asi" => 000007FEE5620000ASI: Loading "K:\Grand Theft Auto V\Speedometer.asi" "Speedometer.asi" => 000007FEE7460000ASI: Loading "K:\Grand Theft Auto V\StrappedPeds.asi" "StrappedPeds.asi" => 000007FEF5500000ASI: Loading "K:\Grand Theft Auto V\Tank.asi" "Tank.asi" => 000007FEE5570000ASI: Loading "K:\Grand Theft Auto V\TimeScaler.asi" "TimeScaler.asi" => 000007FEE54B0000ASI: Loading "K:\Grand Theft Auto V\WorkingJB700.asi" "WorkingJB700.asi" => 000007FEFB060000LOADER: Finished loading *.asi plugins    There is no lua log but I can tell the cmd window comes up & scripts are loaded, no errors, ctrl+r works (cmd shows addins are reloaded), but ingame no script will answer to keyboard commands, absolutely nothing happens. Asi & dll scripts works however. Did I misunderstood something, is there a key to activate it ? It wasn't the case before...I tried a lot of combinations and still no luck.  disabled lua v9 sdk > no more cmd, no lua script working - other dll & asi scripts works reenabled lua v9 sdk, disabled v10beta lua.asi > cmd shows up, no lua script working - other dll & asi scripts works switched back to v9 lua.asi > no more cmd, no lua script working - other dll & asi scripts works disabled scripthook.net > cmd shows up, no lua script working - dll scripts doesn't work, asi works disabled scripthook > can't launch game.  I also tried to put main.lua from v10 with v9 asi, sdk v9 main with v10beta... vice versas... nothing Sadly I didn't backup the last working version.  I'm out of idea and hope you can help.    #Problem Resolved - Issue comes from realistictrain.lua Edited May 12, 2015 by Heist83 Link to comment Share on other sites More sharing options...
headscript Posted May 12, 2015 Author Share Posted May 12, 2015 Hi, I tried both v9 and your future version but I'm still not able to make it work. It worked previously...  +scripts +addins defaultradio.lua carupgrade.lua guard.lua pedmoney.lua realistic train.lua regen.lua slomo.lua szabopersist.lua +libs gui.lua main.lua Passenger.dll TruckingMissions.dll  Logs :   scripthook.net 0.6[08:11:02] [DEBUG] Created script domain 'ScriptDomain_A72B8CE8'.[08:11:02] [DEBUG] Loading scripts from 'K:\Grand Theft Auto V\scripts' into script domain 'ScriptDomain_A72B8CE8' ...[08:11:02] [DEBUG] Found 1 script(s) in 'Passenger.dll'.[08:11:02] [DEBUG] Found 1 script(s) in 'TruckingMissions.dll'.[08:11:02] [DEBUG] Starting 2 script(s) ...[08:11:02] [DEBUG] Instantiating script 'Moochaka.Passenger' in script domain 'ScriptDomain_A72B8CE8' ...[08:11:02] [DEBUG] Started script 'Moochaka.Passenger'.[08:11:02] [DEBUG] Instantiating script 'TruckingMissions' in script domain 'ScriptDomain_A72B8CE8' ...[08:11:02] [DEBUG] Started script 'TruckingMissions'. // GTA V SCRIPT HOOK (build May 2 2015, v1.0.350.2a)// © Alexander Blade 2015[08:09:46] INIT: Started[08:09:46] INIT: Success, game version is VER_1_0_350_2_NOSTEAM[08:09:46] INIT: Registering script 'AngryPlanes.asi' (0x000007FEEE2331F0)[08:09:46] INIT: Registering script 'ConfPoliceMod.asi' (0x000007FEEEAF96E0)[08:09:46] INIT: Registering script 'EthansAntiVehicle.asi' (0x000007FEFB25E760)[08:09:46] INIT: Registering script 'GravityGun.asi' (0x000007FEEB5B2BD0)[08:09:46] INIT: Registering script 'HeistVeh.asi' (0x000007FEE8733A20)[08:09:46] INIT: Registering script 'Hydraulics.asi' (0x000007FEED8418F0)[08:09:46] INIT: Registering script 'LUA.asi' (0x000007FEE6B3CB30)[08:09:46] INIT: Registering script 'LUA_SDK.asi' (0x000007FEE3BDCBA4)[08:09:46] INIT: Registering script 'Mayhem Mod.asi' (0x000007FEE52611D1)[08:09:46] INIT: Registering script 'NativeTrainer.asi' (0x000007FEE663A610)[08:09:46] INIT: Registering script 'Nice Fly.asi' (0x000007FEE8702700)[08:09:46] INIT: Registering script 'OpenInteriors.asi' (0x000007FEE85565B0)[08:09:46] INIT: Registering script 'PlayerPedRagdoll.asi' (0x000007FEE51B112C)[08:09:46] INIT: Registering script 'RareCars.asi' (0x000007FEE4D11140)[08:09:46] INIT: Registering script 'ScriptHookVDotNet.asi' (0x000007FEE61D27C0)[08:09:46] INIT: Registering script 'Speedometer.asi' (0x000007FEE7491640)[08:09:46] INIT: Registering script 'StrappedPeds.asi' (0x000007FEF77F1410)[08:09:46] INIT: Registering script 'Tank.asi' (0x000007FEE3811140)[08:09:47] INIT: Registering script 'TimeScaler.asi' (0x000007FEE3751177)[08:09:47] INIT: Registering script 'WorkingJB700.asi' (0x000007FEFB281270)[08:10:09] INIT: GtaThread collection size 164[08:10:09] INIT: wnd proc 0x00000000FFFF10ED[08:11:00] CORE: Requesting thread creation[08:11:00] CORE: Creating threads[08:11:02] CORE: Started control thread, id 30 active 1[08:11:02] CORE: Started thread 'AngryPlanes.asi', id 31 active 1[08:11:02] CORE: Started thread 'ConfPoliceMod.asi', id 32 active 1[08:11:02] CORE: Started thread 'EthansAntiVehicle.asi', id 33 active 1[08:11:02] CORE: Started thread 'GravityGun.asi', id 34 active 1[08:11:02] CORE: Started thread 'HeistVeh.asi', id 35 active 1[08:11:02] CORE: Started thread 'Hydraulics.asi', id 36 active 1[08:11:02] CORE: Started thread 'LUA.asi', id 37 active 1[08:11:02] CORE: Started thread 'LUA_SDK.asi', id 38 active 1[08:11:02] CORE: Started thread 'Mayhem Mod.asi', id 39 active 1[08:11:02] CORE: Started thread 'NativeTrainer.asi', id 40 active 1[08:11:02] CORE: Started thread 'Nice Fly.asi', id 41 active 1[08:11:02] CORE: Started thread 'OpenInteriors.asi', id 42 active 1[08:11:02] CORE: Started thread 'PlayerPedRagdoll.asi', id 43 active 1[08:11:02] CORE: Started thread 'RareCars.asi', id 44 active 1[08:11:02] CORE: Started thread 'ScriptHookVDotNet.asi', id 45 active 1[08:11:02] CORE: Started thread 'Speedometer.asi', id 46 active 1[08:11:02] CORE: Started thread 'StrappedPeds.asi', id 47 active 1[08:11:02] CORE: Started thread 'Tank.asi', id 48 active 1[08:11:02] CORE: Started thread 'TimeScaler.asi', id 49 active 1[08:11:02] CORE: Started thread 'WorkingJB700.asi', id 0 active 0[08:11:02] CORE: Launching main() for 'AngryPlanes.asi'[08:11:02] CORE: Launching main() for 'ConfPoliceMod.asi'[08:11:02] CORE: Launching main() for 'EthansAntiVehicle.asi'[08:11:02] CORE: Launching main() for 'GravityGun.asi'[08:11:02] CORE: Launching main() for 'HeistVeh.asi'[08:11:02] CORE: Launching main() for 'Hydraulics.asi'[08:11:02] CORE: Launching main() for 'LUA.asi'[08:11:02] CORE: Launching main() for 'LUA_SDK.asi'[08:11:02] CORE: Launching main() for 'Mayhem Mod.asi'[08:11:02] CORE: Launching main() for 'NativeTrainer.asi'[08:11:02] CORE: Launching main() for 'Nice Fly.asi'[08:11:02] CORE: Launching main() for 'OpenInteriors.asi'[08:11:02] CORE: Launching main() for 'PlayerPedRagdoll.asi'[08:11:02] CORE: Launching main() for 'RareCars.asi'[08:11:02] CORE: Launching main() for 'ScriptHookVDotNet.asi'[08:11:02] CORE: Launching main() for 'Speedometer.asi'[08:11:02] CORE: Launching main() for 'StrappedPeds.asi'[08:11:02] CORE: Launching main() for 'Tank.asi'[08:11:02] CORE: Launching main() for 'TimeScaler.asi'[08:13:35] UNINIT: Unregistering script 'Tank.asi' (0x000007FEE3811140)[08:13:35] UNINIT: Unregistering script 'ScriptHookVDotNet.asi' (0x000007FEE61D27C0)[08:13:35] UNINIT: Unregistering script 'RareCars.asi' (0x000007FEE4D11140)[08:13:35] UNINIT: Unregistering script 'PlayerPedRagdoll.asi' (0x000007FEE51B112C)[08:13:35] UNINIT: Unregistering script 'ConfPoliceMod.asi' (0x000007FEEEAF96E0) // GTA V ASI LOADER (build May 2 2015)// © Alexander Blade 2015LIB: "C:\Windows\system32\dinput8.dll" => 000007FEF0430000API: "DirectInput8Create" => 000007FEF0434820API: "DllCanUnloadNow" => 000007FEF04420DCAPI: "DllGetClassObject" => 000007FEF0442014API: "DllRegisterServer" => 000007FEF0451050API: "DllUnregisterServer" => 000007FEF0451064LOADER: Loading *.asi pluginsASI: Loading "K:\Grand Theft Auto V\AngryPlanes.asi" "AngryPlanes.asi" => 000007FEEEAF0000ASI: Loading "K:\Grand Theft Auto V\ConfPoliceMod.asi" "ConfPoliceMod.asi" => 000007FEEE230000ASI: Loading "K:\Grand Theft Auto V\EthansAntiVehicle.asi" "EthansAntiVehicle.asi" => 000007FEF77F0000ASI: Loading "K:\Grand Theft Auto V\GravityGun.asi" "GravityGun.asi" => 000007FEE95B0000ASI: Loading "K:\Grand Theft Auto V\HeistVeh.asi" "HeistVeh.asi" => 000007FEED840000ASI: Loading "K:\Grand Theft Auto V\Hydraulics.asi" "Hydraulics.asi" => 000007FEEB5C0000ASI: Loading "K:\Grand Theft Auto V\LUA.asi" "LUA.asi" => 000007FEE59C0000ASI: Loading "K:\Grand Theft Auto V\LUA_SDK.asi" "LUA_SDK.asi" => 000007FEE57E0000ASI: Loading "K:\Grand Theft Auto V\Mayhem Mod.asi" "Mayhem Mod.asi" => 000007FEE6230000ASI: Loading "K:\Grand Theft Auto V\NativeTrainer.asi" "NativeTrainer.asi" => 000007FEE6620000ASI: Loading "K:\Grand Theft Auto V\Nice Fly.asi" "Nice Fly.asi" => 000007FEE9580000ASI: Loading "K:\Grand Theft Auto V\OpenInteriors.asi" "OpenInteriors.asi" => 000007FEE7490000ASI: Loading "K:\Grand Theft Auto V\OpenIV.asi" "OpenIV.asi" => 000007FEE8550000ASI: Loading "K:\Grand Theft Auto V\PlayerPedRagdoll.asi" "PlayerPedRagdoll.asi" => 000007FEE5730000ASI: Loading "K:\Grand Theft Auto V\RareCars.asi" "RareCars.asi" => 000007FEE5680000ASI: Loading "K:\Grand Theft Auto V\ScriptHookVDotNet.asi" "ScriptHookVDotNet.asi" => 000007FEE5620000ASI: Loading "K:\Grand Theft Auto V\Speedometer.asi" "Speedometer.asi" => 000007FEE7460000ASI: Loading "K:\Grand Theft Auto V\StrappedPeds.asi" "StrappedPeds.asi" => 000007FEF5500000ASI: Loading "K:\Grand Theft Auto V\Tank.asi" "Tank.asi" => 000007FEE5570000ASI: Loading "K:\Grand Theft Auto V\TimeScaler.asi" "TimeScaler.asi" => 000007FEE54B0000ASI: Loading "K:\Grand Theft Auto V\WorkingJB700.asi" "WorkingJB700.asi" => 000007FEFB060000LOADER: Finished loading *.asi plugins    There is no lua log but I can tell the cmd window comes up & scripts are loaded, no errors, ctrl+r works (cmd shows addins are reloaded), but ingame no script will answer to keyboard commands, absolutely nothing happens. Asi & dll scripts works however. Did I misunderstood something, is there a key to activate it ? It wasn't the case before... I tried a lot of combinations and still no luck.  disabled lua v9 sdk > no more cmd, no lua script working - other dll & asi scripts works reenabled lua v9 sdk, disabled v10beta lua.asi > cmd shows up, no lua script working - other dll & asi scripts works switched back to v9 lua.asi > no more cmd, no lua script working - other dll & asi scripts works disabled scripthook.net > cmd shows up, no lua script working - dll scripts doesn't work, asi works disabled scripthook > can't launch game.  I also tried to put main.lua from v10 with v9 asi, sdk v9 main with v10beta... vice versas... nothing Sadly I didn't backup the last working version.  I'm out of idea and hope you can help. have u tried without asi mods and just Lua + some scripts? also i heard that the .net scripthook has some problems with my plugin else i would like to see it myself over teamviewer or something maybe i can help Link to comment Share on other sites More sharing options...
kopalov Posted May 12, 2015 Share Posted May 12, 2015  So does anyone know how to use DRAW_MARKER?  And also, why doesn't textutils.unserialize work? Or is it only me who is messing something up and it works for you guys? Otherwise it's kind of a pain to convert lines from file to arrays for table input. How is that painful? Can u show some code what u trying to achieve  I was trying to do this local file = io.open("houses.txt", "r")sCont = file:read()file:close()tCont = textutils.unserialize(sCont)table.remove(tCont, 3)table.insert(tCont, 3, "New Data") Also, what about markers?  For example, I want to draw this marker: GRAPHICS.DRAW_MARKER(2, -737.743, -2274.540, 13.437, 0.0, 0.0, 0.0, 180.0, 0.0, 0.0, 0.75, 0.75, 0.75, 204, 204, 0, 100, false, true, 2, false, false, false, false) But it returns an error. Will appreciate any help Link to comment Share on other sites More sharing options...
headscript Posted May 12, 2015 Author Share Posted May 12, 2015   So does anyone know how to use DRAW_MARKER?  And also, why doesn't textutils.unserialize work? Or is it only me who is messing something up and it works for you guys? Otherwise it's kind of a pain to convert lines from file to arrays for table input. How is that painful? Can u show some code what u trying to achieve  I was trying to do this local file = io.open("houses.txt", "r")sCont = file:read()file:close()tCont = textutils.unserialize(sCont)table.remove(tCont, 3)table.insert(tCont, 3, "New Data") GRAPHICS.DRAW_MARKER(2, -737.743, -2274.540, 13.437, 0.0, 0.0, 0.0, 180.0, 0.0, 0.0, 0.75, 0.75, 0.75, 204, 204, 0, 100, false, true, 2, false, false, false, false) But it returns an error. Will appreciate any help  local tCont = {}for line in io.open("houses.txt", "r")):lines() do table.insert(tCont , line)endtable.remove(tCont, 3)table.insert(tCont, 3, "New Data") try that and which error does it return? kopalov 1 Link to comment Share on other sites More sharing options...
Heist83 Posted May 12, 2015 Share Posted May 12, 2015 Thanks for your answer.  I'm writing the steps as I progress through "troobleshoot" :  disabled dinput8.dll reswitched to lua v9 sdk disabled most asi mods & kept one lua script Result : The lua script is working! testing with other lua's one by one. Result : When adding realisticTrain.lua, other lua's won't work, the script itself works, I can drive trains, but it also makes all the other scripts useless.  here's it's content :   -- Realistic Train v1.0.2-- Author: stulleman----------------------------------------------------------------------------- Change Keybindings here ------------------------------------------------------------------------------local ENTER_EXIT_TRAIN_KEY = 70 -- Default: F (70)local THROTTLE_UP_KEY = 90 -- Default: W (87) / Z (90)local THROTTLE_DOWN_KEY = 83 -- Default: S (83)local BRAKE_TOGGLE_KEY = 32 -- Default: Space (32)local CHANGE_DIRECTION = 17 -- Default: Control (17)local TOGGLE_GUI = 125 -- Default: F5 (116)local TOGGLE_GUI_POSITION = 126 -- Default: F6 (117)------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------local guiXOffset = 0.01local guiYOffset = 0.73local inTrain = falselocal playerPed = 0local train = 0local trainIsFreight = falselocal guiMode = 0local guiPosition = 0local drawTrainGuiToggle = truelocal enterDelay = 0local brakeDelay = 0local directionDelay = 0local guiDelay = 0local testDelay = 0local brake = falselocal speed = 0local throttle = 0local direction = 1local throttleSpeedFreight = 0.5local maxSpeedFreight = 50local accelerationFreight = 0.02local brakeForceFreight = 0.03local dragForceFreight = 0.005local throttleSpeedMetro = 1local maxSpeedMetro = 35local accelerationMetro = 0.05local brakeForceMetro = 0.06local dragForceMetro = 0.009local realisticTrain = {}function unload()endfunction init()endfunction tick() playerPed = PLAYER.PLAYER_PED_ID() -- if(get_key_pressed(96) and (GAMEPLAY.GET_GAME_TIMER() - testDelay) > 500) then -- testDelay = GAMEPLAY.GET_GAME_TIMER() -- -- for i=0,10,1 do -- -- VEHICLE.SET_VEHICLE_DOOR_OPEN(train, i, false, false) -- -- end -- print(ENTITY.IS_ENTITY_ATTACHED(playerPed)) -- ENTITY.DETACH_ENTITY(playerPed, true, true) -- print(ENTITY.IS_ENTITY_ATTACHED(playerPed)) -- end if(inTrain) then PED.SET_PED_INTO_VEHICLE(playerPed, train, -1) drawTrainGUI() getInput() controlTrain() elseif(train ~= 0) then controlTrain() end -- ENTITY.DETACH_ENTITY(playerPed, false, true) -- ENTITY.ATTACH_ENTITY_TO_ENTITY(playerPed, 0, 0, 0, 0, 0, 0, 0, 0, true, true, true, true, 0, true) -- VEHICLE.SET_TRAIN_SPEED(train, -ENTITY.GET_ENTITY_SPEED(train)) -- print(ENTITY.GET_ENTITY_SPEED(train)) enterExitTrain() endfunction toggleGuiMode() if(guiMode == 0) then drawTrainGuiToggle = false UI.DISPLAY_HUD(true) UI.DISPLAY_RADAR(true) guiMode = 1 elseif(guiMode == 1) then drawTrainGuiToggle = false UI.DISPLAY_HUD(false) UI.DISPLAY_RADAR(false) guiMode = 2 elseif(guiMode == 2) then drawTrainGuiToggle = true UI.DISPLAY_HUD(true) UI.DISPLAY_RADAR(true) guiMode = 0 end endfunction toggleGuiPosition() if(guiPosition == 0) then guiXOffset = 0.01 guiYOffset = 0.01 guiPosition = 1 elseif(guiPosition == 1) then guiXOffset = 0.9 guiYOffset = 0.01 guiPosition = 2 elseif(guiPosition == 2) then guiXOffset = 0.9 guiYOffset = 0.9 guiPosition = 3 elseif(guiPosition == 3) then guiXOffset = 0.01 guiYOffset = 0.73 guiPosition = 0 end endfunction drawTrainGUI() if(drawTrainGuiToggle) then drawtext("Throttle: " .. string.format("%i", tostring(throttle)) .. " %", 0+guiXOffset, 0.0+guiYOffset, 255, 255, 255) drawtext("Speed: " .. string.format("%i", tostring(speed * 3.6)) .. " km/h", 0+guiXOffset, 0.015+guiYOffset, 255, 255, 255) drawtext("Brake: " , 0+guiXOffset, 0.030+guiYOffset, 255, 255, 255) if(brake) then drawtext("Armed", 0.03+guiXOffset, 0.030+guiYOffset,255,0,0) else drawtext("Released", 0.03+guiXOffset, 0.030+guiYOffset,0,255,0) end drawtext("Direction: " , 0+guiXOffset, 0.045+guiYOffset,255,255,255) if(direction > 0) then drawtext("Forward", 0.045+guiXOffset, 0.045+guiYOffset, 0,255,0) else drawtext("Backward", 0.0425+guiXOffset, 0.045+guiYOffset, 255,0,0) end end endfunction getInput() if(trainIsFreight) then -- Throttle up if(get_key_pressed(THROTTLE_UP_KEY) and throttle < 100) then throttle = throttle + throttleSpeedFreight end -- Throttle down if(get_key_pressed(THROTTLE_DOWN_KEY) and throttle > 0) then throttle = throttle - throttleSpeedFreight end else -- Throttle up if(get_key_pressed(THROTTLE_UP_KEY) and throttle < 100) then throttle = throttle + throttleSpeedMetro end -- Throttle down if(get_key_pressed(THROTTLE_DOWN_KEY) and throttle > 0) then throttle = throttle - throttleSpeedMetro end end -- Brake key if(get_key_pressed(BRAKE_TOGGLE_KEY) and (GAMEPLAY.GET_GAME_TIMER() - brakeDelay) > 500) then brakeDelay = GAMEPLAY.GET_GAME_TIMER() brake = not brake end -- Change direction key if(get_key_pressed(CHANGE_DIRECTION) and (GAMEPLAY.GET_GAME_TIMER() - directionDelay) > 500 and (speed <= 0.01 and speed >= -0.01)) then directionDelay = GAMEPLAY.GET_GAME_TIMER() direction = -direction end -- Toggle GUI Mode if(get_key_pressed(TOGGLE_GUI) and (GAMEPLAY.GET_GAME_TIMER() - guiDelay) > 200) then guiDelay = GAMEPLAY.GET_GAME_TIMER() toggleGuiMode() end -- Toggle GUI Position if(get_key_pressed(TOGGLE_GUI_POSITION) and (GAMEPLAY.GET_GAME_TIMER() - guiDelay) > 200) then guiDelay = GAMEPLAY.GET_GAME_TIMER() toggleGuiPosition() end endfunction controlTrain() if(trainIsFreight) then -- Forward local speedLimit = (throttle / 100) * maxSpeedFreight -- Speed if(speed < speedLimit) then speed = speed + accelerationFreight end -- Brake if(brake and (speed - brakeForceFreight) >= 0) then speed = speed - brakeForceFreight end -- Drag if((speed - dragForceFreight) >= 0) then speed = speed - dragForceFreight end else -- Forward local speedLimit = (throttle / 100) * maxSpeedMetro -- Speed if(speed < speedLimit) then speed = speed + accelerationMetro end -- Brake if(brake and (speed - brakeForceMetro) >= 0) then speed = speed - brakeForceMetro end -- Drag if((speed - dragForceMetro) >= 0) then speed = speed - dragForceMetro end end VEHICLE.SET_TRAIN_SPEED(train, direction * speed) endfunction enterExitTrain() playerPed = PLAYER.PLAYER_PED_ID() -- Enter/Exit Train if(get_key_pressed(ENTER_EXIT_TRAIN_KEY) and (GAMEPLAY.GET_GAME_TIMER() - enterDelay) > 500) then enterDelay = GAMEPLAY.GET_GAME_TIMER() -- Exit train if(inTrain) then if(isVehicleModel(train, "freight")) then -- Exit Freight local playerOffset = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 2.3, -1.5, -1.0) ENTITY.SET_ENTITY_COORDS(playerPed, playerOffset.x, playerOffset.y, playerOffset.z, false, false, false, false) PED.SET_PED_INTO_VEHICLE(0, train, -1) -- Empty Ped in train so AI doesn't control it inTrain = false else -- Exit Metro local playerOffset = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.7, -1.0, -0.9) ENTITY.SET_ENTITY_COORDS(playerPed, playerOffset.x, playerOffset.y, playerOffset.z, false, false, false, false) PED.SET_PED_INTO_VEHICLE(0, train, -1) -- Empty Ped in train so AI doesn't control it inTrain = false end -- Enter train else train = getCloseTrain(playerPed) if(train ~=0) then -- Enter new Freight if(isVehicleModel(train, "freight")) then local trainPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(train, 1.0, 3.5, 1.0) local playerPosition = ENTITY.GET_ENTITY_COORDS(playerPed, true) if(isInRange(trainPosition, playerPosition, 1)) then -- Set and get current speed speed = ENTITY.GET_ENTITY_SPEED(train) -- Remove driver local pedinTrain = VEHICLE.GET_PED_IN_VEHICLE_SEAT(train, -1) if(pedinTrain) then ENTITY.SET_ENTITY_COORDS(pedinTrain, 0, 0, 0, false,false,false,false) end -- Put player in train PED.SET_PED_INTO_VEHICLE(playerPed, train, -1) inTrain = true trainIsFreight = true -- Not in range to enter train else train = 0 end -- Enter new Metro elseif(isVehicleModel(train, "metrotrain")) then local trainPosition = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(train, 0.0, 0.0, 0.0) local playerPosition = ENTITY.GET_ENTITY_COORDS(playerPed, true) if(isInRange(trainPosition, playerPosition, 4)) then -- Set and get current speed speed = ENTITY.GET_ENTITY_SPEED(train) -- Remove driver local pedinTrain = VEHICLE.GET_PED_IN_VEHICLE_SEAT(train, -1) if(pedinTrain) then ENTITY.SET_ENTITY_COORDS(pedinTrain, 0, 0, 0, false,false,false,false) end -- Put player in train PED.SET_PED_INTO_VEHICLE(playerPed, train, -1) inTrain = true trainIsFreight = false -- Not in range to enter train else train = 0 end end end end endendfunction isVehicleModel(model, name) local hashModel = GAMEPLAY.GET_HASH_KEY(name); local hashName = ENTITY.GET_ENTITY_MODEL(model) if(hashModel == hashName) then return true end return false endfunction isInRange(position1, position2, maxDistance) if((math.abs(position1.x - position2.x) < maxDistance) and (math.abs(position1.y - position2.y) < maxDistance) and (math.abs(position1.z - position2.z) < maxDistance)) then return true end return falseendfunction drawtext(text, x, y, r, g, b) UI.SET_TEXT_FONT(0) UI.SET_TEXT_SCALE(0.3, 0.3) UI.SET_TEXT_COLOUR(r, g, b, 255) UI.SET_TEXT_WRAP(0, 1) UI.SET_TEXT_CENTRE(false) UI.SET_TEXT_DROPSHADOW(15, 15, 0, 0, 0) UI.SET_TEXT_EDGE(5, 0, 0, 0, 255) UI._SET_TEXT_ENTRY("STRING") UI._ADD_TEXT_COMPONENT_STRING(text) UI._DRAW_TEXT(x, y) endfunction getCloseTrain(playerPed) local Table,Count = PED.GET_PED_NEARBY_VEHICLES(playerPed, 1) for k,v in ipairs(Table) do if(VEHICLE.IS_THIS_MODEL_A_TRAIN(ENTITY.GET_ENTITY_MODEL(v))) then return v end end return 0 endreturn realisticTrain    Added back all the other asi's & reenabled scripthook.net, everything is working.  Do you think the problem comes from this script or could it be some sort of limitation on the lua plugin side ? I may also ask the author of this script. Anyways, sorry for the trouble & keep up the good work !  Link to comment Share on other sites More sharing options...
headscript Posted May 12, 2015 Author Share Posted May 12, 2015 Thanks for your answer. Â I'm writing the steps as I progress through "troobleshoot" : Â Â Â Added back all the other asi's & reenabled scripthook.net, everything is working. Â Do you think the problem comes from this script or could it be some sort of limitation on the lua plugin side ? I may also ask the author of this script. Anyways, sorry for the trouble & keep up the good work ! Â yep its definitly from his script he overwrites in global namespace functions which are needed to run other scripts Link to comment Share on other sites More sharing options...
kopalov Posted May 12, 2015 Share Posted May 12, 2015 (edited)    So does anyone know how to use DRAW_MARKER?  And also, why doesn't textutils.unserialize work? Or is it only me who is messing something up and it works for you guys? Otherwise it's kind of a pain to convert lines from file to arrays for table input. How is that painful? Can u show some code what u trying to achieve  I was trying to do this local file = io.open("houses.txt", "r")sCont = file:read()file:close()tCont = textutils.unserialize(sCont)table.remove(tCont, 3)table.insert(tCont, 3, "New Data") GRAPHICS.DRAW_MARKER(2, -737.743, -2274.540, 13.437, 0.0, 0.0, 0.0, 180.0, 0.0, 0.0, 0.75, 0.75, 0.75, 204, 204, 0, 100, false, true, 2, false, false, false, false) But it returns an error. Will appreciate any help  local tCont = {}for line in io.open("houses.txt", "r")):lines() do table.insert(tCont , line)endtable.remove(tCont, 3)table.insert(tCont, 3, "New Data") try that and which error does it return?  Thank you. After some searching I already found lines() solution for reading from file. Now it's problematic to write file:write() wants string, and I got array like h1 = {1, 4, 5, 0, 0}. I know that you can convert arrays to strings, but all methods I found for that seem very complex, like http://lua-users.org/wiki/SaveTableToFile, and I'm not sure how to implement them. Would appreciate any help  UPDATE. Never mind, I already found a solution. So only question about marker remains.  This DRAW_MARKER example gives error "...argument #22 is 'boolean'; 'number' expected". If I change it to number, like 1, it complains about #23. If I also change #23, there is no error message in console, but game freezes and Scripthook gives error in lua_sdk.asi: exception accured. After that game does not come back to life and has to be killed by taskmanager. Edited May 13, 2015 by kopalov Link to comment Share on other sites More sharing options...
NeatSquid Posted May 12, 2015 Share Posted May 12, 2015 I seem to get time out errors currently. Any idea why? Link to comment Share on other sites More sharing options...
gunziness Posted May 13, 2015 Share Posted May 13, 2015 The game gets minimized by the plugin when its about to load the save, is there any way to avoid that? Link to comment Share on other sites More sharing options...
headscript Posted May 13, 2015 Author Share Posted May 13, 2015 The game gets minimized by the plugin when its about to load the save, is there any way to avoid that?Use beta gunziness 1 Link to comment Share on other sites More sharing options...
boss of g-unit Posted May 13, 2015 Share Posted May 13, 2015 (edited) i want to make a high beam toggle for gta v like in real life, using the gamepad [xbox controller]red button B .. it's by default makes the camera goes into cinema mode, i want to disable that and make it as a toggle for the high beams , is such thing possible ? key = {}key.closemenu = 8 -- "backspace"local rvc = {}isAllLightsOn = falseif CONTROLS.IS_CONTROL_PRESSED(2,80) then if (isPlayerDriving == true) then rvc.isAllLightsOn() endfunction rvc.toggleAllLights() isAllLightsOn = not isAllLightsOn VEHICLE.SET_VEHICLE_LIGHTS(playerVehicle, booltoint(isAllLightsOn)) rvc.keyDelay()end i got those lines from a much larger script written, what i need is the gamepad control codes and the function in the game to turn on the high beams on and off any help appreciated .. Edited May 13, 2015 by boss of g-unit Link to comment Share on other sites More sharing options...
headscript Posted May 14, 2015 Author Share Posted May 14, 2015 Working on it that whenever you edit natviesdb the changes are made in the plugin aswell (every 10 min i grab the natives.h from nativedb and recompile my plugin) Link to comment Share on other sites More sharing options...
Zer0w5 Posted May 14, 2015 Share Posted May 14, 2015 (edited) http://gtaforums.com/topic/794383-possibility-of-trojan-downloaderspyware-installed-via-gta-v-mod  Can .lua files also mess with the pc? Edited May 14, 2015 by Zer0w5 Link to comment Share on other sites More sharing options...
headscript Posted May 14, 2015 Author Share Posted May 14, 2015 http://gtaforums.com/topic/794383-possibility-of-trojan-downloaderspyware-installed-via-gta-v-mod  Can .lua files also mess with the pc? probably yes but i could block most if it, but mod developers should understand then why i removed those lua features Link to comment Share on other sites More sharing options...
headscript Posted May 14, 2015 Author Share Posted May 14, 2015 V10 is out Zer0w5 1 Link to comment 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