Skip to content

Commit

Permalink
[francisco-create]
Browse files Browse the repository at this point in the history
veh_ghost: multitheftauto#380

steering_pos: multitheftauto#387
  • Loading branch information
francisco-create committed Dec 3, 2022
1 parent 218f2c7 commit be969f0
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
42 changes: 42 additions & 0 deletions [francisco-create]/steering_pos/c.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
local tables = {}
local whichkey = {
["w"] = true,
["a"] = true,
["s"] = true,
["d"] = true,
}
local binds = false
addEventHandler("onClientVehicleStartExit",root,function()
if source then
local rx1, ry1, rz1 = getVehicleComponentRotation(source, "wheel_lf_dummy")
local rx2, ry2, rz2 = getVehicleComponentRotation(source, "wheel_rf_dummy")
tables[localPlayer] = {on = {"wheel_lf_dummy",rz1},arka = {"wheel_rf_dummy",rz2},araba = source}
binds = false
end
end)

addEventHandler("onClientVehicleStartEnter",root,function()
binds = true
end)

addEventHandler("onClientPedsProcessed",root,function()
local veri = tables[localPlayer] or {}
if veri then
local on = veri.on
local arka = veri.arka
local araba = veri.araba
if araba then
setVehicleComponentRotation(araba,on[1],0,0,on[2])
setVehicleComponentRotation(araba,arka[1],0,0,arka[2])
end
end
end)
addEventHandler("onClientKey",root,function(buton,pres)
if not pres then
return
end
if tables[localPlayer] == nil then return end
if whichkey[buton] and binds and getPedOccupiedVehicle(localPlayer) then
tables[localPlayer] = nil
end
end)
3 changes: 3 additions & 0 deletions [francisco-create]/steering_pos/meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<meta>
<script src="c.lua" type="client" cache="false"/>
</meta>
20 changes: 20 additions & 0 deletions [francisco-create]/veh_ghost/client.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local how = 2
function ghostmode_on()
local playerVehicle = getPedOccupiedVehicle(localPlayer)
if(playerVehicle) then
if how == 2 then
for i,v in pairs(getElementsByType("vehicle")) do
setElementCollidableWith(v, playerVehicle, false)
end
how = 1
outputChatBox("activate")
else
for i,v in pairs(getElementsByType("vehicle")) do
setElementCollidableWith(v, playerVehicle, true)
end
how = 2
outputChatBox("deactivate")
end
end
end
addCommandHandler("ghost", ghostmode_on)
4 changes: 4 additions & 0 deletions [francisco-create]/veh_ghost/meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- This resource need to add in ACL.xml to group Admin. -->
<meta>
<script src="client.lua" type="client" cache="false" />
</meta>

0 comments on commit be969f0

Please sign in to comment.