Turbe$Z Posted March 15, 2017 Share Posted March 15, 2017 i downloaded this script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11102 and added to my server, but some player doesn't want to raise, and i want create a /antigg script, that they could not lift players, but i don't know how. anyone can help? /sorry for my bad English/ Link to comment
DREFTHUN Posted March 15, 2017 Share Posted March 15, 2017 You should use this: --Add this to the serverfile: function antigravitygun(player) if not getElementData(player, "antigravitygun") then setElementData(player, "antigravitygun", true) outputChatBox("You have succesfully turned off 'Gravity Gun'!",player,255,0,0) else setElementData(player, "antigravitygun", false) outputChatBox("You have succesfully turned on 'Gravity Gun'!",player,0,255,0) end end addCommandHandler("antigg", antigravitygun) --And this to the client: if getElementData(localPlayer, "antigravitygun") then return end --This one has to be between these two: if not getControlState("aim_weapon") or isElementInWater(localPlayer) then return end --(Row: 23) local ggun_obj = getElementData(localPlayer,"ggun_taken") --(Row: 24) --So it should look like this: if not getControlState("aim_weapon") or isElementInWater(localPlayer) then return end --(Row: 23) if getElementData(localPlayer, "antigravitygun") then return end --(Row: 24) local ggun_obj = getElementData(localPlayer,"ggun_taken") --(Row: 25) 1 Link to comment
Turbe$Z Posted March 15, 2017 Author Share Posted March 15, 2017 37 minutes ago, DREFTHUN said: You should use this: --Add this to the serverfile: function antigravitygun(player) if not getElementData(player, "antigravitygun") then setElementData(player, "antigravitygun", true) outputChatBox("You have succesfully turned off 'Gravity Gun'!",player,255,0,0) else setElementData(player, "antigravitygun", false) outputChatBox("You have succesfully turned on 'Gravity Gun'!",player,0,255,0) end end addCommandHandler("antigg", antigravitygun) --And this to the client: if getElementData(localPlayer, "antigravitygun") then return end --This one has to be between these two: if not getControlState("aim_weapon") or isElementInWater(localPlayer) then return end --(Row: 23) local ggun_obj = getElementData(localPlayer,"ggun_taken") --(Row: 24) --So it should look like this: if not getControlState("aim_weapon") or isElementInWater(localPlayer) then return end --(Row: 23) if getElementData(localPlayer, "antigravitygun") then return end --(Row: 24) local ggun_obj = getElementData(localPlayer,"ggun_taken") --(Row: 25) thanks Link to comment
Turbe$Z Posted March 15, 2017 Author Share Posted March 15, 2017 5 minutes ago, DREFTHUN said: No problem! wait, when i disable the gravity gun, i can't to lift players, and vehicles, but others can me to lift why? Link to comment
DREFTHUN Posted March 15, 2017 Share Posted March 15, 2017 That just disables it for you. Link to comment
Turbe$Z Posted March 15, 2017 Author Share Posted March 15, 2017 1 minute ago, DREFTHUN said: That just disables it for you. how to disable others to lift me? Link to comment
DREFTHUN Posted March 15, 2017 Share Posted March 15, 2017 --Clientside: if getElementData(getPedTarget(localPlayer), "antigravitygun") then return end --It has to look like this: if isElement(ggun_obj) and isTimer(buildupTimer) then --(Row: 30) if not isElement(ggun_obj) then ggun_obj = getPedTarget(localPlayer) end --(Row: 31) if getElementData(getPedTarget(localPlayer), "antigravitygun") then return end --(Row: 32) Though, others can still lift the vehicle you are sitting in. Link to comment
Turbe$Z Posted March 15, 2017 Author Share Posted March 15, 2017 3 minutes ago, DREFTHUN said: --Clientside: if getElementData(getPedTarget(localPlayer), "antigravitygun") then return end --It has to look like this: if isElement(ggun_obj) and isTimer(buildupTimer) then --(Row: 30) if not isElement(ggun_obj) then ggun_obj = getPedTarget(localPlayer) end --(Row: 31) if getElementData(getPedTarget(localPlayer), "antigravitygun") then return end --(Row: 32) players still can lift me Link to comment
DREFTHUN Posted March 15, 2017 Share Posted March 15, 2017 Than I'm sorry, I don't know what to do Link to comment
Turbe$Z Posted March 15, 2017 Author Share Posted March 15, 2017 3 minutes ago, DREFTHUN said: Than I'm sorry, I don't know what to do 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