FreeGells Posted February 12, 2013 Share Posted February 12, 2013 hello, please help me with this script function glue() local player = getLocalPlayer() if not getPedOccupiedVehicle(player) then local vehicle = getPedContactElement(player) if getElementType(vehicle) == "vehicle" then local px, py, pz = getElementPosition(player) local vx, vy, vz = getElementPosition(vehicle) local sx = px - vx local sy = py - vy local sz = pz - vz local rotpX = 0 local rotpY = 0 local rotpZ = getPedRotation(player) local rotvX,rotvY,rotvZ = getElementRotation(vehicle) local t = math.rad(rotvX) local p = math.rad(rotvY) local f = math.rad(rotvZ) local ct = math.cos(t) local st = math.sin(t) local cp = math.cos(p) local sp = math.sin(p) local cf = math.cos(f) local sf = math.sin(f) local z = ct*cp*sz + (sf*st*cp + cf*sp)*sx + (-cf*st*cp + sf*sp)*sy local x = -ct*sp*sz + (-sf*st*sp + cf*cp)*sx + (cf*st*sp + sf*cp)*sy local y = st*sz - sf*ct*sx + cf*ct*sy local rotX = rotpX - rotvX local rotY = rotpY - rotvY local rotZ = rotpZ - rotvZ local slot = getPedWeaponSlot(player) triggerServerEvent("gluePlayer", player, slot, vehicle, x, y, z, rotX, rotY, rotZ) unbindKey("m","down",glue) bindKey("m","down",unglue) end end end addCommandHandler("glue",glue) function unglue () local player = getLocalPlayer() triggerServerEvent("ungluePlayer", player) unbindKey("jump","down",unglue) unbindKey("m","down",unglue) bindKey("m","down",glue) end addCommandHandler("unglue",unglue) bindKey("m", "down", glue) ERROR: WARNING: glue.lua:60: Bad argument @ 'bindKey' Is on Server-Side Thanks! Link to comment
MR.S3D Posted February 12, 2013 Share Posted February 12, 2013 https://community.multitheftauto.com/ind ... ails&id=51 Link to comment
iPrestege Posted February 12, 2013 Share Posted February 12, 2013 Argument is needed on the server side bindKey . Link to comment
Anderl Posted February 12, 2013 Share Posted February 12, 2013 Argument is needed on the server side bindKey . The code is clearly client-side. Link to comment
iPrestege Posted February 12, 2013 Share Posted February 12, 2013 Argument is needed on the server side bindKey . The code is clearly client-side. Oh,Sorry But i Read it here "Is on Server-Side" My Bad Thanks . 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