Jump to content

12p

Members
  • Posts

    2,608
  • Joined

  • Last visited

Everything posted by 12p

  1. Edit some free resource. Play around with it. Use your common sense and deduction powers. You might eventually start understanding how it works.
  2. 12p

    Bug Problem

    The "for" statement loops until you tell it to stop. And just by executing setPlayerTeam you're not doing it. Check what I added in your code, it may come handy for related coding: local Table = { {"-|SxG|-","-|SxG|- Skilled Xtreme Gamers",255,155,0}, {"|PaS|","|PaS| Pro Adventure Skills",23,56,89}, } function setTeam2(old,new) for i,v in ipairs(Table) do if new then if string.find(new, v[1]) then --built-in string function if team then setPlayerTeam(source, getTeamFromName(v[2])) break --Stop the "for" loop end else setPlayerTeam(source,nil) break --Stop the "for" loop end end end end addEventHandler("onPlayerChangeNick",root,setTeam2)
  3. Ahhhh, dumb me. That's because you had the button outside the window It's okay like that, but you must add a guiSetVisible for the button in each function (close and open)
  4. Just a matter of ordering your stuff. Creating your windows should be done only once; not attached to any function at all. When you need them (typing the command), you use that guiSetVisible function to make the window appear. And when you click the button, you make it disappear. tl;dr this should work btw, why isn't MainCloseButton attached to MainWindow? local MainWindow = guiCreateWindow(0.2, 0.20, 0.55, 0.5, "Information", true) local MainCloseButton = guiCreateButton(0.6747, 0.1599, 0.075, 0.04, "CLOSE", true) local TabPanel = guiCreateTabPanel(0, 0.1, 1, 1, true, MainWindow) local RuleTab = guiCreateTab("Rules", TabPanel) local CommandTab = guiCreateTab("Commands", TabPanel) guiCreateMemo(15, 10, 1000, 420, "Deatmatching is'nt allowed! \nbla bla bla!", false, RuleTab) --Main/Rules Window Text guiCreateMemo(15, 10, 1000, 420, "This part was too long so I dont put this part to the forum.", false, CommandTab) guiSetVisible(MainWindow, false) function CloseButton () guiSetVisible(MainWindow, false) end addEventHandler("onClientGUIClick", MainCloseButton, CloseButton, false) function Information() guiSetVisible(MainWindow, true) end addCommandHandler ("info", Information)
  5. 12p

    Bug Problem

    Go and check the documentation for the onPlayerChangeNick event. Also, apply common sense and try to understand what your code does, how and why. I once did a step-by-step instruction, but now I don't feel like it. It's actually quite easy.
  6. 12p

    Bug Problem

    function setTeam2(old,new) if old and new then if string.find(getPlayerName(source), "-|SxG|-") then --built-in string function if team then setPlayerTeam(source, getTeamFromName("-|SxG|- Skilled Xtreme Gamers")) end else setPlayerTeam(source,nil) end end end addEventHandler("onPlayerChangeNick",root,setTeam2) I'm guessing it doesn't give troubles at all with that undeclared "team" variable, right?
  7. 12p

    Help BindKey

    Paul, there are 3 "end" in that code of yours, while there's only one "function" and one "if" (this is why indentation is important). It will trigger a script loading error. Also, that command handler triggers a binding everytime the player types "bindme"? Isn't that a bit pointless (and maybe will lead to errors too)? function binds( ) guiSetVisible( GUIEditor.window[2], not guiGetVisible(GUIEditor.window[2]) ) showCursor( guiGetVisible(GUIEditor.window[2]) ) end addCommandHandler( "rules", binds ) bindKey( "F2", "down", "rules" ) Post if there's still any error in /debugscript 3 like Et-win said!
  8. Yeah, well, that ain't true. You'd have to change the scoreboard size so your image fits in, and add the function Blaawee said, near where he said. You'll have to discover how to do it on your own, son: this is kinda messy, and in fact it doesn't feel like you should be doing anything this hard yet. If you really plan to, read the page of documentation for dxDrawImage (click on the red highlighted text up there), so you don't screw everything up. You can always ask for help about what are you doing wrong, but you'd be better trying to do something easier so you actually LEARN how to script, before moving on to DirectX Drawing.
  9. Here, I found your problem quickly. I hope this is the correct workaround, because it's supposed to be patched already (unless you got an old version).
  10. 12p

    [HELP] Script

    For once, I have the time and I'm feeling like it: I'll explain step by step. I hope you understand the process and learn to do it on your own Let's do it! This the line that throws the error if money >= 499 then "money"? That value is declared in this line local money = getPlayerMoney ( source ) But, why is it a boolean (true/false)? According to the wiki, getPlayerMoney (kindly click the blue-highlighted function above to see by yourself): "Returns an integer with the amount of money the specified player has, false if the player is invalid." So,You have an invalid player... "source"? Where does it come from? addCommandHandler ( "armour", function ( ) Nowhere? That's because commands don't give a "source" value. From the wiki (click the blue-highlighted addCommandHandler function above): So, this should fix it... addCommandHandler ( "armour", function (playerSource) Wait, how is this supposed to work when everything within that command handler function still uses "source"? Obvious solution! Replace it all with this new player parameter! Go on, fix it. I even told you what to do, so it shouldn't be bothersome. If you still don't understand, you probably shouldn't be doing this sort of scripts yet. Remember to always search in the wiki for documentation!
  11. 12p

    [HELP] Script

    I wonder why do I even bother. Please read this link and post again once you're done. Also, /debugscript 3 Type that command in the chat when you test your scripts.
  12. Set its rotation, so that said "straight line" leads to your desired point...
  13. 12p

    Sending details

    Not really necessary to do that. In the same resource, every variable that is declared as global (not adding the "local" prefix makes a variable automatically global) is accesible by every other file of the same resource, as long as said files are all client-side or server-side; you can't switch from one to another. In that case, you'll have to use the event system. However, be careful when doing this, because sometimes you might want to trigger a function depending on a variable that wasn't declared yet, and that will cause an error (e.g. trying to access your window before that window gets created in first place).
  14. He can make another table for the values I said. Race has a built-in event used when the player beats a top time, so I don't see the problem.
  15. Add an event handler to the onClientGUIClick event, attach it to GUIEditor.button[15] and then use those functions within the handler function. You can read more about how addEventHandler works at https://wiki.multitheftauto.com/wiki/AddEventHandler
  16. 12p

    New logo MTA :D

    Tommy Vercetti isn't from San Andreas either. Not even 8Ball. Your argument is invalid and the logo looks awesome. Also, wrong board
  17. Indeed, that multigamemode is just the same as FFS one.
  18. Wow, really? It's not hard at all 1. Add a value "topTimeCount" to every player row in the table 2. Make it so when a player beats a top time, that value is increased by 1 3. Make it so when a player loses his top time, the value is decreased by 1 4. Sort them by that value. You're done.
  19. Trigger an event from the client to the server, at the end of the client script. onClientReady or something. When the server receives it, tell it to send back an event with the data to the client. Done.
  20. Simply put a engineLoadTXD and engineImportTXD functions at the start of a client script. It'll be executed for every client that downloads the script.
  21. The XML functions, just like he said. Take in account these functions can only work server-side when you're talking about the meta.xml file. You can easily mess up, so be careful with it
  22. Well, that's the quick, easy solution indeed And it's weird the server doesn't take the gamemode name automatically. Are you running mapmanager resource? If you're not, that's the problem. Otherwise...
  23. Make sure you're admin. Open up console (F8). Type "setgame DayZ" there, without the quotes.
  24. 12p

    Admin Duty

    Oh man. There's just so much cringe in this post. Just learn to script by putting effort, common sense and logic on it. Everybody else has done the same, including myself. If you're not willing to do that, then I repeat: When you try something, come here and ask for help. Sure. But the way you're doing it now...? You're getting no help.
×
×
  • Create New...