iFerasMO Posted March 3, 2015 Share Posted March 3, 2015 (edited) . Edited March 6, 2015 by Guest Link to comment
Et-win Posted March 3, 2015 Share Posted March 3, 2015 I really don't understand what you want to do. Any debugscript 3 errors btw? Link to comment
xeon17 Posted March 3, 2015 Share Posted March 3, 2015 read what i need i want the script works with key ( Like K or num_5 ) + car and does not appear .. Link to comment
Tekken Posted March 3, 2015 Share Posted March 3, 2015 bindKey("k","down","lk") Was realy hard. Link to comment
iFerasMO Posted March 3, 2015 Author Share Posted March 3, 2015 i want the script works with key ( Like K or num_5 ) + car and does not appear .. but if the player side the car and pressed the button script works And if there are no nearby car does not work .. Link to comment
xXMADEXx Posted March 4, 2015 Share Posted March 4, 2015 We're not here to be your slaves and do it for you. How about you try to do it and we help you... You'll never learn anything if you never try. Link to comment
#RooTs Posted March 4, 2015 Share Posted March 4, 2015 Try using this (Not Tested) client.lua bindKey("k","down","lk") server.lua function ChopperGunner ( plr ) local accName = getAccountName ( getPlayerAccount ( plr ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Everyone" ) ) then blip = {} local x, y, z = getElementPosition( plr ) local Heli = createVehicle( 405, x+2, y+3, z+2 ) blip[1] = ( createBlipAttachedTo ( Heli, 41 ) ) setVehicleDamageProof ( Heli, true ) local time1 = setTimer( function() xx = createPed ( 107, x, y, z ) setPedAnimation ( xx, "ped", "SEAT_idle", -1, true, false, false ) attachElements( xx, Heli, -0.2, -2.2, 1 ) attachElements( plr, Heli, -0.4, -1.8, 0.8 ) setElementAlpha( plr, 0, true) giveWeapon( plr, 38, 9999, true ) end, 3000, 1) local time2 = setTimer( function() giveWeapon( plr, 38, 9999, true ) end, 3000, 1) local time3 = setTimer( function() setElementPosition ( plr, x, y, z ) takeWeapon ( plr, 38 ) setElementAlpha( plr, 255 ) destroyElement( Pilot ) destroyElement( xx ) destroyElement( blip[1] ) destroyElement( Heli ) end, 30000, 1) end end addCommandHandler("lk", ChopperGunner) Link to comment
RenanPG Posted March 4, 2015 Share Posted March 4, 2015 -- Client bindKey("k", "down", function() triggerServerEvent("call:test", resourceRoot) end) -- Server function ChopperGunner ( plr ) local accName = getAccountName ( getPlayerAccount ( plr ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Everyone" ) ) then blip = {} local x, y, z = getElementPosition( plr ) local Heli = createVehicle( 405, x+2, y+3, z+2 ) blip[1] = ( createBlipAttachedTo ( Heli, 41 ) ) setVehicleDamageProof ( Heli, true ) local time1 = setTimer( function() xx = createPed ( 107, x, y, z ) setPedAnimation ( xx, "ped", "SEAT_idle", -1, true, false, false ) attachElements( xx, Heli, -0.2, -2.2, 1 ) attachElements( plr, Heli, -0.4, -1.8, 0.8 ) setElementAlpha( plr, 0, true) giveWeapon( plr, 38, 9999, true ) end, 3000, 1) local time2 = setTimer( function() giveWeapon( plr, 38, 9999, true ) end, 3000, 1) local time3 = setTimer( function() setElementPosition ( plr, x, y, z ) takeWeapon ( plr, 38 ) setElementAlpha( plr, 255 ) destroyElement( Pilot ) destroyElement( xx ) destroyElement( blip[1] ) destroyElement( Heli ) end, 30000, 1) end end addEvent("call:test", true) addEventHandler("call:test", resourceRoot, function() ChopperGunner(client) end) Link to comment
iFerasMO Posted March 5, 2015 Author Share Posted March 5, 2015 (edited) . Edited March 6, 2015 by Guest Link to comment
xeon17 Posted March 5, 2015 Share Posted March 5, 2015 Post the part of the code where you are trying to attach the sound. Link to comment
iFerasMO Posted March 6, 2015 Author Share Posted March 6, 2015 (edited) . Edited March 6, 2015 by Guest Link to comment
xeon17 Posted March 6, 2015 Share Posted March 6, 2015 Well , post the llk function if that's one where you attact the sound. Link to comment
iFerasMO Posted March 6, 2015 Author Share Posted March 6, 2015 (edited) . Edited March 6, 2015 by Guest Link to comment
Dealman Posted March 6, 2015 Share Posted March 6, 2015 Heli is not defined client-side. You need to pass it to the Client via triggerClientEvent. -- Server triggerClientEvent(plr, "llk" plr, Heli) -- Client function lkk(theHeli) attachElements(so, theHeli) Read the Wiki thoroughly and you'll be able to figure things like these out on your own Link to comment
iFerasMO Posted March 6, 2015 Author Share Posted March 6, 2015 (edited) . Edited March 7, 2015 by Guest Link to comment
Addlibs Posted March 6, 2015 Share Posted March 6, 2015 Read the Wiki thoroughly and you'll be able to figure things like these out on your own 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