Jump to content

Xeno

Members
  • Posts

    728
  • Joined

  • Last visited

Everything posted by Xeno

  1. Xeno

    Tables

    Works like a charm, thanks <3
  2. Xeno

    Tables

    Thank you, thats what I wanted. I'm trying to make it so when you hit the marker it sets a new location for the object, local objects = { { model = 1210, x = -1318, y = -145, z = 13.25, rot = 90, rot2 = 0, rot3 = 90 }, { model = 1210, x = -1322, y = -145, z = 13.25, rot = 90, rot2 = 0, rot3 = 90 }, { model = 1210, x = -1330, y = -145, z = 13.25, rot = 90, rot2 = 0, rot3 = 90 } } local object = objects [ math.random ( #objects ) ] myobject = createObject ( object.model, object.x, object.y, object.z, object.rot3, object.rot2, object.rot ) local x,y,z = getElementPosition ( myobject ) mymarker = createMarker ( x, y, z, "cylinder", 4, 200, 0, 0, 255 ) function giveCash(player) givePlayerMoney(player, 20000) destroyElement(mymarker) destroyElement(myobject) myobject = createObject ( object.model, object.x, object.y, object.z, object.rot3, object.rot2, object.rot ) end addEventHandler("onMarkerHit", mymarker, giveCash) But this doesn't seem to work..
  3. Xeno

    Tables

    local objects = { {model=1210, x=-1318, y=-145, z=13.25, rot=90, rot2=0,rot3=90}, {model=1210, x=-1322, y=-145, z=13.25, rot=90, rot2=0,rot3=90}, {model=1210, x=-1330, y=-145, z=13.25, rot=90, rot2=0,rot3=90} } for index, object in ipairs(objects) do myobject = createObject(object.model, object.x, object.y, object.z, object.rot3, object.rot2, object.rot) local x,y,z = getElementPosition(myobject) mymarker = createMarker(x,y,z,"cylinder",4,200,0,0,255) end at the moment it spawns all objects, but I want it so it only spawns 1, how do I do this?
  4. Do you login in when you spawn?
  5. Xeno

    please help

    addEventHandler("onClientGUIClick", button_exit, hideGUI2,false) Try that again, and if it doesn't work I don't know.
  6. function enter ( theVehicle, player ) local id = getElementModel ( theVehicle ) -- get the model ID of the vehicle if id == 487 or id == 577 then removePedFromVehicle ( source ) outputChatBox("You're not allowed to drive this vehicle!") end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enter ) Fixed and tested.
  7. Xeno

    please help

    gui = guiCreateStaticImage(0,0,0.6,0.593,"images/gui.png", true) button_exit = guiCreateStaticImage(0.93,0.015,0.05,0.05,"images/exit.png",true,gui) button_maximize = guiCreateStaticImage(0.87,0.015,0.05,0.05,"images/maximize.png",true,gui) button_minimize = guiCreateStaticImage(0.81,0.015,0.05,0.05,"images/minimize.png",true,gui) button_house = guiCreateStaticImage(0.02,0.015,0.212,0.049,"images/house.png",true,gui) function showGUI2() guiSetVisible(gui,true) showCursor(true) end addEvent("showGUI2",true) addEventHandler("showGUI2", getRootElement(), showGUI2) function hideGUI2() if (button_exit) then guiSetVisible (gui,false) showCursor(false) end end addEvent("hideGUI2",true) addEventHandler("hideGUI2", getRootElement(), hideGUI2) addEventHandler("onClientGUIClick", button_exit, hideGUI2) My mistake - its because you had getElementRoot() which basically means everything. addEventHandler("onClientGUIClick", [name of element being clicked], [function to be triggered when clicked]) See if it works.
  8. Lonely4 edited the first part of your script, you had tlocal gate = createObject... etc - That "t" stopped it creating. Just thought you should know just in case you didn't realise.
  9. Xeno

    please help

    Did my solution work?
  10. Xeno

    please help

    function showGUI2() guiSetVisible(gui,true) showCursor(true) end addEvent("showGUI2",true) addEventHandler("showGUI2", getRootElement(), showGUI2) function hideGUI2() if (button_exit) then guiSetVisible (gui,false) showCursor(false) end end addEvent("hideGUI2",true) addEventHandler("hideGUI2", getRootElement(), hideGUI2) addEventHandler("onClientGUIClick", getRootElement(), hideGUI2,false) Try using the search function in the future.
  11. tlocal gate = createObject(7033, 1943.2998046875, 848.69921875, 6.7266693115234, 0, 0, 90) local marker = createMarker(1947.6999511719, 849.70001220703, 6.6999998092651, "cylinder", 10, 255, 255, 255, 0) function moveGate(psource) moveObject(gate, 5000, 1937.099609375, 843, 10.39999961853) setTimer(moveBack, 5000, 1) end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 5000, 1943.2998046875, 848.69921875, 6.7266693115234) end You had an extra "end".
  12. function enter ( theVehicle ) local id = getElementModel ( theVehicle ) -- get the model ID of the vehicle if id == 519 or id == 577 then cancelEvent () outputChatBox("You're not allowed to drive this vehicle!") end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enter ) This may work, I have not tested it, I just simply edited some wiki thing. You'll have to replace the ID's though so they are the infernus's ID. PS. Sorry if it doesn't work, as I said - I've not tested it.
  13. How would I go about doing this? And also, I would like it so it only picks 10 randomly locations from the list to spawn them, is this possible?
  14. Nevermind, we're going off topic. ( DayZ is a mod of Arma2 and makes it a huge MMO Zombie game, its the best thing I've played, EVER ). I don't know whats wrong with your script, sorry.
  15. No, I mean are you replicating the current DayZ mod for ArmA 2?
  16. Offtopic: are you building a DayZ resource?
  17. Xeno

    Backdoors

    You mean a backdoor virus?
  18. Why do you need him anyway?
  19. Xeno

    question

    Yes, they are. For example, function changeBodyStrength(thePlayer, commandName) -- Output whether the setPlayerStat was successful in changing the BODY_MUSCLE STAT if setPedStat(thePlayer, 23, 999) then outputChatBox("Your player looks really muscular") else outputChatBox("Failed to make your player look muscular.") end end addCommandHandler("beefcake", changeBodyStrength) -- Wiki script.
  20. createTeam("Criminal", 255,255,255) function setTeam() team = getTeamFromName("Criminal") setPlayerTeam(source, team) end addCommandHandler("setteam", setTeam) -- could be wrong, been off from scripting for about 2 months now.
  21. Ok pretty much, If I start up MTA it just loads and freezes on the first menu ( Not even at the Browse server bit, just the screen where it says "Grand Theft Auto San Andreas".) Sometimes it works but sometimes it doesn't and its so fucking annoying. How can I fix this? I've tried re-installing, no luck.
  22. Lol'd - Nice work, although, you can't really use it for anything.
  23. Thought so, would this also remove Crosshairs ( Custom DX ones )
  24. Could I bind this to a command lets say? addCommandHandler("cheese", dxDrawText) ?
×
×
  • Create New...