Jump to content

Dealman

Members
  • Posts

    1,421
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Dealman

  1. Dealman

    Job [Help]

    You already have the 3 coordinates in the variables theX, theY, theZ. Since I output them with the messages.
  2. Dealman

    Job [Help]

    You've made a multidimensional array which is not indexed, therefore you must usepairs and not ipairs(Would appear you can use both). Here's a quick little 'tutorial' I wrote to assist you, I hope it's easy enough to understand. -- Create a multidimensional array like this; local theTable = { {1315.4921875, -898.7529296875, 39.578125, 228}, {1178.515625, -2036.8623046875, 69.0078125, 228}, {2432.904296875, -1584.7587890625, 13.753595352173, 228}, {475.8759765625, -1279.939453125, 16.483493804932, 228}, {2491.4052734375, -2499.5556640625, 13.655031204224,228} }; function fetchRandomOnStart_Handler() -- Fetch a random array inside the multidimensional array; (As of now, it has 5 arrays, so get a random index between 1 and 5) local randomIndex = theTable[math.random(1, #theTable)]; -- Since the arrays follow the same pattern (X, Y, Z, SkinID), you can fetch specific data like this; local theX = randomIndex[1] -- This gets the first data in the array. local theY = randomIndex[2] -- This gets the second data in the array. local theZ = randomIndex[3] -- You get the idea. local skinID = randomIndex[4] -- It's pretty easy once you get the hang of it -- Then you can output the result, to make sure it works; outputChatBox("X Coordinate: [#FF2626"..tostring(theX).."#BB0000]", 187, 0, 0, true); outputChatBox("Y Coordinate: [#FF2626"..tostring(theY).."#BB0000]", 187, 0, 0, true); outputChatBox("Z Coordinate: [#FF2626"..tostring(theZ).."#BB0000]", 187, 0, 0, true); outputChatBox("Skin ID: [#FF2626"..tostring(skinID).."#BB0000]", 187, 0, 0, true); end addEventHandler("onClientResourceStart", resourceRoot, fetchRandomOnStart_Handler);
  3. function showGUI_Handler() if(guiGetVisible(GUIEditor.window[1]) == false) then guiSetVisible(GUIEditor.window[1], true) else guiSetVisible(GUIEditor.window[1], false) end end bindKey("F4", "down", showGUI_Handler)
  4. Put the if statement inside the function instead
  5. Well, I'd say Forza, but those are Xbox exclusive, so might be a bit difficult to get a hand on those. Not sure what your process is like to get the sound effects working with your resource.
  6. Not as far as I know, but you can create a vehicle and freeze it, make it damage proof. Then it'll have similar properties to an object.
  7. This is probably the one thing you'd find the most search results on, on this entire website. I personally haven't looked into it, since it is not of my interest. But I've seen some answers mentioning you'll need to change the player's dimensions depending on the room. Then you'll of course have to make a gamemode that loads a map for each room separately, set the dimensions and jadda jadda.
  8. Some really impressive work so far, this sure has huge potential. I'd however say that the sound effects are rather bad - it's too loud and doesn't really sound realistic nor good. It kind of reminds me of Test Drive Unlimited, which make engine sound fanatics like me wanna cry ourselves to sleep. But other than that, great work! Can't wait to see some more progress!
  9. Deepu, no offence, but you should read about Megalomania. Why I link this is because you always get into stuff like this because of your arrogant behaviour. I do however agree with you about the whole "Stealing Ideas" thing. You can't really steal an idea, implying such a thing is utmost retarded.
  10. Sorry but that doesn't help. Pa3ck's solution is as close as I can get.
  11. Cheers, it works, but only once. Then it gets stuck. This is how I made it; function activateTeamGlobal_Bind() bindKey("G", "down", "chatbox", "TeamGlobal"); end bindKey("lshift", "down", activateTeamGlobal_Bind); function deactivateTeamGlobal_Bind() unbindKey("G", "down", "chatbox", "TeamGlobal"); bindKey("G", "down", "chatbox", "Global"); -- In case unbind doesn't work end bindKey("lshift", "up", deactivateTeamGlobal_Bind); After I've done LShift+G, it forever gets stuck on TeamGlobal and I can't revert it back to Global. Not even if I bind it again.
  12. Recently I started working a bit on adding a global chat, using the default chatbox. I figured out that I can use bindKey like this to enable chatbox input with a custom prefix, in this case, "Global"; bindKey("G", "down", "chatbox", "Global", activateGlobalChat_Handler); However, this seem to be the only way of doing this, and I can't make use of executeCommandHandler which is preventing me from doing what I want with it - a double-bind. What I mean with double-bind is for example, Left Shift+G, Left Alt+G and so on. I'd rather have something like this, than a separate key for each one of them. Does anyone happen to have a workaround to solve this? Edit: I stumbled upon some information while reading about Control_names. This sentence in particular caught my interest; However, I fail to understand what on earth they are trying to say with that.
  13. Dealman

    Question

    You can use interpolateBetween with pretty much anything. I've used it with for some of my interfaces. So it's certainly doable.
  14. Dealman

    [HELP] Please

    Try something like this, I haven't tested it though. function restoreAllBlood_CMD(thePlayer, theCMD) local accountName = getAccountName(getPlayerAccount(thePlayer)) if(accountName) then if(isObjectInACLGroup("user."..accountName, aclGetGroup("Admin"))) then local alivePlayers = getAlivePlayers(); if(alivePlayers ~= false) then for key, value in ipairs(alivePlayers) do setElementBlood(value, 12000); outputChatBox("Server: Your blood was restored to full by an Admin!", value, 0, 255, 0); end end else outputChatBox("Server: You're not a server Admin you can't use this command.", thePlayer, 255, 0, 0); end end end addCommandHandler("BloodAll", restoreAllBlood_CMD, false, false);
  15. Ren is a boss, that's for sure. However, I'd say that some things look quite a bit too shiny/bright which makes it look less good, and rather just annoying. But other than that, great work!
  16. Aye, their positions are stored via element data. That's how setElementPosition/Rotation works, it modifies the data. I discovered this while writing my own gamemdoe and named the datas PosX, PosY instead of posX, posY etc.. Which broke the position/rotation function.
  17. Do you want to toggle an image when pressing the key N? I am somewhat confused as to what you want, sorry
  18. I think you'll need to use getVehicleModelFromName instead of getElementModel. Can't tell since I don't know how you setup the gridlist. But I'm assuming it's a list of the vehicle names.
  19. I believe it returns a indexed table, thus you'll need to change pairs to ipairs first of all. Second, why are you doing getAccount after getting all accounts? It returns the account element, not their name. local current = getAccountData(v, "ucpMinutesPlayed")
  20. I don't think it support tables, but I believe you can use JSON.
  21. Try this instead, I messed up the logic a bit... local chatHidden = false; function showChatOnButtonClick_Handler() if(source == showChatButton) then if(chatHidden == false) then showChat(false); chatHidden = true; else showChat(true); chatHidden = false; end end end
  22. Try changing the button variable to showChatButton since it might be causing a conflict with the function showChat. For example you can try something like this(Client Side); function showChatOnButtonClick_Handler() local chatHidden = false; if(source == showChatButton and chatHidden == false) then showChat(false); chatHidden = true; elseif(source == showChatButton and chatHidden == true) then showChat(true); chatHidden = false; end end addEventHandler("onClientGUIClick", getRootElement(), showChatOnButtonClick_Handler)
  23. Knowledge is power Then you could just use the function showChat...
  24. For showchat, use the event onClientGUIClick to detect when the button is clicked. Then use executeCommandHandler. For speed and jump you can use; getElementVelocity setElementVelocity
×
×
  • Create New...