rafull6 Posted June 24, 2011 Share Posted June 24, 2011 Hello guys! Once upon a time there was [NR]Gaming Freeroam server, and it had one AWESOME (as for me) resource. It worked in the next way. You need to type while you are in the car this command /attach . For example: /attach 1225 0 10 0 0 0 0 will attach explosive barrel opposite to the car on 10 units. You can also attach any object in the game, but you need to be in the car. Where can i find such resource, or how to make it? Guys, help me with this problem. It is my dream point for many years to get this resource. (I looked throught a lot of topics on this forum, but there was no answer ) help Link to comment
#Paper Posted June 24, 2011 Share Posted June 24, 2011 addCommandHandler attachElements Now i'm too lazy to script it Link to comment
rafull6 Posted June 25, 2011 Author Share Posted June 25, 2011 function attachHand ( source, commandName,objID,x,y,z,rx,ry,rz ) car = getPedOccupiedVehicle(source) if (car) then object = createObject(tonumber(objID),0,0,0); attachElements ( car, object, tonumber(x), tonumber(y), tonumber(z), tonumber(rx), tonumber(ry), tonumber(rz) ); else outputChatBox("You must be in car!",source,255,0,0); end end addCommandHandler ( "attach", attachHand ) Like this!? (scripted by Taalasmaa) --------------------------------------- ADDED: BUT IT DOESN'T WORK Help GUYS!!!!! Link to comment
CowTurbo Posted June 25, 2011 Share Posted June 25, 2011 I sended u PM with code, please, DONT GIVE THIS AWAY! Or i come and kill you Link to comment
rafull6 Posted June 25, 2011 Author Share Posted June 25, 2011 I sended u PM with code, please, DONT GIVE THIS AWAY! Or i come and kill you Thank you very much!!! I promise you - i'll keep it in a secret))) Link to comment
Castillo Posted June 25, 2011 Share Posted June 25, 2011 Creating this script would take about 2 mins (even less). local playerObjects = {} function attachObjectToPlayerVehicle ( player, cmd, ID, x, y, z, rx, ry, rz ) local vehicle = getPedOccupiedVehicle(player) if not vehicle then outputChatBox("You must be in a vehicle to use this command.",player,255,0,0) return end if isElement(playerObjects[player]) then destroyElement(playerObjects[player] end playerObjects[player] = createObject(tonumber(ID),0,0,0) attachElements (vehicle, playerObjects[player], tostring(x), tostring(y), tostring(z), tostring(rx), tostring(ry), tostring(rz)) end addCommandHandler ( "attach", attachObjectToPlayerVehicle ) addEventHandler("onPlayerQuit",root, function () if isElement(playerObjects[source]) then destroyElement(playerObjects[source] end end) It should work Link to comment
rafull6 Posted June 27, 2011 Author Share Posted June 27, 2011 Thank you, Solidsnake14! Works great 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