2kristof2 Posted April 1, 2015 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..
2kristof2 Posted April 1, 2015 Author Posted April 1, 2015 Is there another way to set ghostmode disabled (permanently) without using handler "onClientRender" or setTimer(function,50,0) ?
ALw7sH Posted April 1, 2015 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'
2kristof2 Posted April 1, 2015 Author Posted April 1, 2015 Yea but i don't want to change the gamemode but do it by (client-side) script.
2kristof2 Posted April 1, 2015 Author 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.
2kristof2 Posted April 1, 2015 Author Posted April 1, 2015 oh maybe you are right I'll try to use onClientPickupHit
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