forked from multitheftauto/mtasa-resources
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
veh_ghost: multitheftauto#380 steering_pos: multitheftauto#387
- Loading branch information
1 parent
218f2c7
commit be969f0
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<meta> | ||
<script src="c.lua" type="client" cache="false"/> | ||
</meta> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |