Jumper_Mych Posted January 4, 2011 Posted January 4, 2011 Doesn't work Skin = { [280]=true } Marker = createMarker ( 2406.61, 83.16, 5002.47, "cylinder", 10, 255, 135, 0, 83 ) Van = createVehicle ( 427, 2418.861328125, 85.333984375, 26.718894958496 ( 0, 0, 90, 12LS34PD ) function attach () attachElements ( Marker, Van, 0, 0, 0 ) end addEventHandler ( "onClientResourceStart", attach ) function equipment ( player, cmd) if isElementWithinMarker ( player, attach) then if Skin[getElementModel(player)] then cancelEvent() local x, y, z = getElementPosition(player) local rotx, roty, rotz = getElementRotation(player) objects[player] = createObject ( 1228, x, y, z+1, rotx, roty, rotz ) attachElements ( objects[player], player, 0, 1.2, -0.6, 0, 0, 180 ) else outputChatBox ( "You're not a Cop", player, 255, 0, 0) end end addCommandHandler("barrel", equipment) EDIT: Author is not allowed copy my code!
SDK Posted January 4, 2011 Posted January 4, 2011 Use debugging... Line 8 needs more parameters. addEventHandler ( "onClientResourceStart", getResourceRootElement(), attach ) Line 11, "attach" is a function, correct element is "Marker". if isElementWithinMarker ( player, Marker) then
SDK Posted January 4, 2011 Posted January 4, 2011 "Doesn't work" .. Try being more specific, any errors in debug? Edit: There's a ( to much on line 3 in createVehicle, and your license plate should be a string!
Jumper_Mych Posted January 4, 2011 Author Posted January 4, 2011 Van = createVehicle ( 427, 2418.52, 84.67, 25.89, 0, 0, 90 ) Doesn't work
SDK Posted January 4, 2011 Posted January 4, 2011 "Doesn't work" ..Try being more specific, any errors in debug?
Jumper_Mych Posted January 4, 2011 Author Posted January 4, 2011 But spawn vehicle is empty, Unless my code error
Wojak Posted January 5, 2011 Posted January 5, 2011 EDIT: Author is not allowed copy my code! You are using a translator? hmm... so there is a matker attached to a vehicle, and when you ger out of the wehicle, stand in this matker and type /barrel it should give you a barrel? i dont understand this line... Skin = { [280]=true } try Skin = 280 WT... if Skin[getElementModel(player)] then cancelEvent() i think it should be: if Skin == getElementModel(player) then is it possible to cancel the command? and why to do it? objects[player] = createObject ( 1228, x, y, z+1, rotx, roty, rotz ) where is the objects table? you are missing: objects = {} on the begining of yours script... and the fatal reason: you can only attach visual part of the marker to a moving element (vehicle), the marker collshape will always stay in the creation position (it will not work if you move the vehicle)
Jumper_Mych Posted January 5, 2011 Author Posted January 5, 2011 You are using a translator? hmm... so there is a matker attached to a vehicle, and when you ger out of the wehicle, stand in this matker and type /barrel it should give you a barrel?i dont understand this line... Skin = { [280]=true } try Skin = 280 WT... if Skin[getElementModel(player)] then cancelEvent() i think it should be: if Skin == getElementModel(player) then is it possible to cancel the command? and why to do it? objects[player] = createObject ( 1228, x, y, z+1, rotx, roty, rotz ) where is the objects table? you are missing: objects = {} on the begining of yours script... and the fatal reason: you can only attach visual part of the marker to a moving element (vehicle), the marker collshape will always stay in the creation position (it will not work if you move the vehicle) DOESN'T WORK I never using the translator because my write fast not exactly Do not know you type lua? you type are bad from lua. (strange) To must test on Host game and check you code are wrong lua? If you not know Lua. see close topic
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