Krazy Posted August 6, 2017 Share Posted August 6, 2017 Hey guys. my friend made me a script and everything is fine but when a vehicle gets explode in map, mta shuts down somehow with some bugs roster, here is the script addEventHandler("onClientVehicleCollision", root, function(collider,force, bodyPart, x, y, z, nx, ny, nz) if ( source == getPedOccupiedVehicle(localPlayer) ) then if (collider) then fixVehicle(source) end end end ) PS : the script is about an undamage land, it works like when you jump your car doesn't lose health Link to comment
Administrators Lpsd Posted August 6, 2017 Administrators Share Posted August 6, 2017 Maybe I'm missing something but I don't see a problem with the code. Can you show us the errors it gives you? 1 Link to comment
Krazy Posted August 7, 2017 Author Share Posted August 7, 2017 Crash information: Version = 1.5.4-release-11595.8.000 Time = Mon Aug 7 05:54:44 2017 Module = E:\GTA San Andreas\gta_sa.exe Code = 0xC0000005 Offset = 0x000F6655 EAX=00000000 EBX=00000001 ECX=0FB10048 EDX=019163E0 ESI=0FC1F200 EDI=FFFFFFFF EBP=00000000 ESP=0177FB48 EIP=004F6655 FLG=00010287 CS=0023 DS=002B SS=002B ES=002B FS=0053 GS=002B Link to comment
NeXuS™ Posted August 7, 2017 Share Posted August 7, 2017 Try this. addEventHandler("onClientVehicleCollision", root, function(collider,force, bodyPart, x, y, z, nx, ny, nz) if (source == getPedOccupiedVehicle(localPlayer)) then if (collider) and not isVehicleBlown(source) then fixVehicle(source) end end end ) 1 Link to comment
Krazy Posted August 7, 2017 Author Share Posted August 7, 2017 Still facing a problem, called error CL04, by brief it drives me out of the game Link to comment
NeXuS™ Posted August 7, 2017 Share Posted August 7, 2017 Are you sure it's happening because of this script? 1 Link to comment
Krazy Posted August 7, 2017 Author Share Posted August 7, 2017 (edited) Yes, already removed the script and tried the vehicle explosion and everything went cool, but when i added it back the problem started to occur, i am not a professional scripter but i feel like the script don't know what to do once the vehicle explode, more like it gets bugged somehow Edited August 7, 2017 by Krazy Link to comment
NeXuS™ Posted August 7, 2017 Share Posted August 7, 2017 What you can try to do is debug where the game crashes. addEventHandler("onClientVehicleCollision", root, function(collider,force, bodyPart, x, y, z, nx, ny, nz) outputChatBox("Function called, crashed before getting player veh") if (source == getPedOccupiedVehicle(localPlayer)) then outputChatBox("Got player veh, crashed before checking if it has a collider or the veh is blown up") if (collider) and not isVehicleBlown(source) then outputChatBox("Checked if it has a collider or the veh is blown up, crashed before fixVeh") fixVehicle(source) outputChatBox("Got fixVeh and crashed") end end end ) Try this one and once it crashes check your logfile. 1 Link to comment
Krazy Posted August 7, 2017 Author Share Posted August 7, 2017 Still facing the bug, that's what appeared in logfile 23:12:36 - [DEBUG] BeginEventLog 23:12:37 - [DEBUG] DLL_PROCESS_ATTACH 00000000 23:12:37 - [DEBUG] CLocalization::CLocalization Localization set to 'en_US' 23:12:43 - [DEBUG] Loader - Finishing 23:12:45 - [DEBUG] DLL_PROCESS_DETACH 00000001 23:12:52 - [DEBUG] DLL_PROCESS_DETACH 00000001 Link to comment
NeXuS™ Posted August 7, 2017 Share Posted August 7, 2017 Your log is not your logfile.txt, console.log if you have not started the game since it crashed. 1 Link to comment
Krazy Posted August 7, 2017 Author Share Posted August 7, 2017 I didn't start the game since it crashed, followed your instructions above, strange how i can't find the reason. Link to comment
Administrators Lpsd Posted August 7, 2017 Administrators Share Posted August 7, 2017 I don't mean to be "that guy", but have you tried re-installing MTA? 1 Link to comment
NeXuS™ Posted August 7, 2017 Share Posted August 7, 2017 Did anyone else experience this kind of crash with your script? Link to comment
Krazy Posted August 7, 2017 Author Share Posted August 7, 2017 (edited) Didn't try, but i am sure it is not caused by that, since i already gave the map to a friend of mine and he found the problem in his server as well, No sadly, that's why i am asking here :\ @NeXuS™ Edited August 7, 2017 by Krazy Link to comment
NeXuS™ Posted August 7, 2017 Share Posted August 7, 2017 @Krazy, can you give us a little bit more details? When does the game crash? Instantly after joining the server? Link to comment
Krazy Posted August 7, 2017 Author Share Posted August 7, 2017 (edited) Well, when i start the map everything goes smoothly, but when my vehicle gets explode, the game freeze and stop somehow then some error occur, Could you check if the script is well made because i feel like there is something wrong on it some line, i mean the way the script works Edited August 7, 2017 by Krazy Link to comment
NeXuS™ Posted August 7, 2017 Share Posted August 7, 2017 (edited) Alright. Do me a favor. If you haven't updated your code with mine, do it now (which has the outputs in it). If you have done the update, go ahead and join your server and blow your vehicle up. After it blew up, open your console.log file and tell us whats inside it. Edited August 7, 2017 by NeXuS™ 1 Link to comment
Administrators Lpsd Posted August 7, 2017 Administrators Share Posted August 7, 2017 (edited) Very strange. I have just tested this myself and nothing relevant shows up in the console. Upon blowing the vehicle up, there is a slight freeze and the game crashes with the following information: Version = 1.5.4-release-11595.1.000 Time = Mon Aug 7 22:12:51 2017 Module = C:\Program Files (x86)\QuickTime\QTSystem\QuickTime.qts Code = 0xC000001D Offset = 0x00A13A73 EAX=00863C40 EBX=00300000 ECX=0C737400 EDX=00000000 ESI=0C737400 EDI=3F800000 EBP=00080000 ESP=0028FC70 EIP=66253A73 FLG=00210246 CS=0023 DS=002B SS=002B ES=002B FS=0053 GS=002B It should be worth noting that I used this code (as collider would return nil, I was just testing at Grove Street): addEventHandler("onClientVehicleCollision", root, function(collider,force, bodyPart, x, y, z, nx, ny, nz) if (source == getPedOccupiedVehicle(localPlayer)) then fixVehicle(source) end end ) Using the code you provided fixed the crashing (as it never got inside the isVehicleBlown block), however I did experience the slight freeze upon respawning. I only have the default play resource loaded, and of course this script. I suspect this is something to do with fixVehicle when used on a blown vehicle. Edited August 7, 2017 by LopSided_ 1 Link to comment
Krazy Posted August 7, 2017 Author Share Posted August 7, 2017 (edited) @NeXuS™ , your code is already the same with my code, as i tested few mins ago @LopSided_, Exactly, but it is possible though, saw it in a server before and it works fine, don't know what's wrong with my code @NeXuS™, i tested again and the outputs appear perfectly, [2017-08-07 23:12:22] [Output] : Function called, crashed before getting player veh [2017-08-07 23:12:22] [Output] : Got player veh, crashed before checking if it has a collider or the veh is blown up [2017-08-07 23:12:22] [Output] : Checked if it has a collider or the veh is blown up, crashed before fixVeh [2017-08-07 23:12:22] [Output] : Got fixVeh and crashed which is i reckon mean that there is no bug on it somehow !? Edited August 7, 2017 by Krazy Tested again Link to comment
Administrators Lpsd Posted August 7, 2017 Administrators Share Posted August 7, 2017 @Krazy the issue here is using fixVehicle on a vehicle that has been blown up. In the code that NeXuS provided he solves this issue by checking isVehicleBlown, if this returns true then fixVehicle is not called. Link to comment
Krazy Posted August 7, 2017 Author Share Posted August 7, 2017 Then how when my vehicle gets explode i get the same issue taking in mind that i used Nexus code, still strange xd! Link to comment
lopezloo Posted August 15, 2017 Share Posted August 15, 2017 (edited) Try onClientVehicleDamage instead. Edited August 15, 2017 by lopezloo Link to comment
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