2kristof2 Posted April 1, 2015 Share Posted April 1, 2015 Hi I created a script to disable ghostmode in race: (Player can hit vehicles like police etc..) function GM_off () local v = getPedOccupiedVehicle(localPlayer) for index,vehicle in ipairs(getElementsByType("vehicle")) do setElementCollidableWith(vehicle, v, true) end end addEventHandler ( "onClientRender", getRootElement(), GM_off) I used onClientRender because every time when I change vehicle, ghostmode is enabled again.. Link to comment
2kristof2 Posted April 1, 2015 Author Share Posted April 1, 2015 Is there another way to set ghostmode disabled (permanently) without using handler "onClientRender" or setTimer(function,50,0) ? Link to comment
WhoAmI Posted April 1, 2015 Share Posted April 1, 2015 Some script has to turn all the time ghostmode on. Link to comment
ALw7sH Posted April 1, 2015 Share Posted April 1, 2015 on your race gamemode open race_server.lua search for this line: g_MapOptions.ghostmode = map.ghostmode == 'true' maybe you'll find it at line 149 change it to g_MapOptions.ghostmode = 'true' Link to comment
2kristof2 Posted April 1, 2015 Author Share Posted April 1, 2015 Yea but i don't want to change the gamemode but do it by (client-side) script. Link to comment
WhoAmI Posted April 1, 2015 Share Posted April 1, 2015 Maybe after changing the map call this function? Link to comment
2kristof2 Posted April 1, 2015 Author Share Posted April 1, 2015 "when I change vehicle, ghostmode is enabled again.." (Every time when i hit a pickup) Anyway if nobody has no idea I will use onClientRender. Link to comment
WhoAmI Posted April 1, 2015 Share Posted April 1, 2015 So call function after hitting the pickup, lol. Link to comment
2kristof2 Posted April 1, 2015 Author Share Posted April 1, 2015 oh maybe you are right I'll try to use onClientPickupHit 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