Jump to content

TheDeftGamer

Members
  • Posts

    24
  • Joined

  • Last visited

Details

  • Gang
    Weapons Dealer

TheDeftGamer's Achievements

Civilian

Civilian (7/54)

0

Reputation

  1. This is a great race map!!! I love all the triggered events and even the glow checkpoints. It just found a home on the -]alw[- RPG Racing server!!! Hope you stop by and give it a spin with us! If you have anymore maps i would love to give them all a spin.
  2. taalasma, that was perfect! local Localplayer = getPlayerName(getLocalPlayer()) Label_PlayerName = guiCreateLabel(15,8,428,53,Localplayer,false,GUIEditor_Tab[1]) guiLabelSetColor(Label_PlayerName,255,255,255) guiLabelSetVerticalAlign(Label_Playername,"top") guiLabelSetHorizontalAlign(Label_Playername,"left",false) guiSetFont(Label_PlayerName,"sa-header") Thank you guys very much for the help, stop by the alw race server and see your help in action sometime!
  3. Sadly that did not work. I also had to remove the . because that made the entire window screw up lol. so now it looks like this: local Localplayer = getPlayerName(getLocalPlayer()) Label_PlayerName = guiCreateLabel(14,8,428,53,LocalPlayer,false,GUIEditor_Tab[1]) guiLabelSetColor(Label_PlayerName,255,255,255) guiLabelSetVerticalAlign(Label_Playername,"top") guiLabelSetHorizontalAlign(Label_Playername,"left",false) guiSetFont(Label_PlayerName,"sa-header") still isnt working.. this is hard to understand. all the wiki tutorials do is tell you how to get teh name output on the chatbox and theres nothing about displaying a playername using a label or anything for gui's. ;( EDIT: that first line gave me a debug error: failed to index a booleon variable
  4. okay so ive made a gui window and i created a label which makes text show up which says UserNameHere So, this is where i want a persons user name to show up. So when you press a key, the window opens, and you see your name on the very top left. Label_PlayerName = guiCreateLabel(14,8,428,53,"UserNameHere",false,GUIEditor_Tab[1]) guiLabelSetColor(Label_PlayerName,255,255,255) guiLabelSetVerticalAlign(Label_Playername,"top") guiLabelSetHorizontalAlign(Label_Playername,"left",false) guiSetFont(Label_PlayerName,"sa-header") So how do i do this? I've been making alot of progress with learning to code but the wiki is not very helpful here. If anyone can help it would be highly appreciated.
  5. Hi, i recently figured out how to move and reshape the healthbar, so now im wondering how can i move: The race position The checkpoint's remaining time spent on map (basically everything in the lower right corner of a race hud) I dont know which files to edit, im sure i can alter them as needed but im having a hard time figuring out where.
  6. I got the keybinds working too! --It is kept within a function to output as a onClientResourceStart arguement function createGUI() bindKey("F6","down",OpenStatusWindow) --This is the output code provided by the guieditor resource by R3mp GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {}
  7. - You don't want to hide GUI and show cursor (you want to hide it when you hide window). - Also, you need GUI element as first argument in guiSetVisible. - You also, don't need 2nd argument in showCursor since by default it's true. So many "errors" in such short code. function OpenStatusWindow() guiSetVisible( GUIEditor_Window[1], not guiGetVisible( GUIEditor_Window[1] ) ) showCursor( guiGetVisible( GUIEditor_Window[1] ) ) end YES ! It worked great! Thank you guys very much for this. It's very difficult to learn this stuff but i think i get the idea. I need to learn quite abit more about how to correctly code these functions and everything. This may turn out to be a pretty fun hobby. I cant wait to finish this resource and show you guys!
  8. UPDATE: /Status now opens the window!!!!! Here is the code so far: --This is the code for the status gui --The following code programs /status to open the gui window function OpenStatusWindow() guiSetVisible(GUIEditor_Window[1],true) showCursor(true,true) end addCommandHandler("status",OpenStatusWindow) --This is the output code provided by the guieditor resource by R3mp --It is kept within a function to output as a onClientResourceStart arguement function createGUI() GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Window[1] = guiCreateWindow(324,162,673,753,"MainTitleName",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(9,21,652,722,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab1",GUIEditor_TabPanel[1]) GUIEditor_Button[1] = guiCreateButton(443,631,198,45,"Button1",false,GUIEditor_Tab[1]) GUIEditor_Label[1] = guiCreateLabel(11,10,628,59,"-]alw[-Deftones",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) guiSetFont(GUIEditor_Label[1],"sa-header") GUIEditor_Tab[2] = guiCreateTab("Tab2",GUIEditor_TabPanel[1]) GUIEditor_Tab[3] = guiCreateTab("Tab3",GUIEditor_TabPanel[1]) --Hide the window by default at start until called guiSetVisible(GUIEditor_Window[1],false) end addEventHandler("onClientResourceStart",resourceRoot,createGUI) so now /status opens, no debug errors. but now id like to be able to close the window with a command. would i be able to assign it to close using the same command? im supposed i would need to mix in some if/then statements. or... addEventHandler("onClientResourceStop" ------------but i dunno what to add to this lol
  9. UPDATE: I removed the type="gamemode" from the meta. <meta> <info author="-]alw[-Deftones" name="Status" description="A status page used to display stats"/> <script src="statusgui.lua" type="client"/> meta> ... and now the window shows up, now. yippie!!! But, it opens by default when i join the server, which is not quite right yet. I feel like im getting closer.
  10. okay sorry about that. i've made the adjustment you suggested. Stilll nada. here is my complete lua code: --This is the code for the status gui --The following code programs /status to open the gui window function OpenStatusWindow() guiSetVisible(GUIEditor_Window[1],true) showCursor(true,true) end addCommandHandler("status",OpenStatusWindow) --This is the output code provided by the guieditor resource by R3mp GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Window[1] = guiCreateWindow(324,162,673,753,"MainTitleName",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(9,21,652,722,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab1",GUIEditor_TabPanel[1]) GUIEditor_Button[1] = guiCreateButton(443,631,198,45,"Button1",false,GUIEditor_Tab[1]) GUIEditor_Label[1] = guiCreateLabel(11,10,628,59,"-]alw[-Deftones",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) guiSetFont(GUIEditor_Label[1],"sa-header") GUIEditor_Tab[2] = guiCreateTab("Tab2",GUIEditor_TabPanel[1]) GUIEditor_Tab[3] = guiCreateTab("Tab3",GUIEditor_TabPanel[1]) and just in case, here is my meta.xml: <meta> <info author="-]alw[-Deftones" type="gamemode" name="Status" description="A status page used to display stats for the rpg racing server"/> <script src="statusgui.lua" type="client"/> meta> So the goal is to get the window to open with /status. I know in the future i would need to bind a key to onClientResourceStart and unbind onClientResourceStop if i want to use F6. (thanks woovie), but thats only when i can get /status to work.
  11. Still no dice.. /status .. still does nothing =( -bangs face with frying pan.
  12. For anyone out there, i have tried using the mta wiki scripting tutorials but i am lost. let me start from the top... I made a very simple gui using the resource "guieditor". It's really neat and easy to use but when it saves it's code you have to do some manual work to get it up and running. This is regarding the status page im trying to make. *I made a folder named "status" *inside is a file i made called meta.xml which contains the following: ------------------------------------------------------------------------------------ *i made a file called statusgui.lua which i put the code that guieditor output into a text file: GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Window[1] = guiCreateWindow(324,162,673,753,"MainTitleName",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(9,21,652,722,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab1",GUIEditor_TabPanel[1]) GUIEditor_Button[1] = guiCreateButton(443,631,198,45,"Button1",false,GUIEditor_Tab[1]) GUIEditor_Label[1] = guiCreateLabel(11,10,628,59,"-]alw[-Deftones",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) guiSetFont(GUIEditor_Label[1],"sa-header") GUIEditor_Tab[2] = guiCreateTab("Tab2",GUIEditor_TabPanel[1]) GUIEditor_Tab[3] = guiCreateTab("Tab3",GUIEditor_TabPanel[1]) ------------------------------------------------------------------------------------ SOOO... how do i program this gui window to open upon a keypress like F6? I've tried using the files on our server as refference but i couldnt figure it out. so far all i know is i need a "addcommandhandler". So i added this and altered it based on a wiki gui tutorial: function OpenStatusWindow() guiSetVisible(OpenStatusWindow,true) showCursor(true,true) end addCommandHandler("status",OpenStatusWindow) --------------------------------------------------------------------------------- I'm guessing that the only thing im doing wrong is not declaring what "OpenStatusWindow" should mean to the system but this is where i get lost. i know the above code is meant to allow you to use /status to open the window but i dont know why its not working. If anyone knows, any help would be appreciated.
  13. Im sorry im bugging you, i think i should take a step back and start from scratch. i'm obviously the one doing something wrong. I will learn the basics of scripting the gui and everything and then learn how to use your program to steamline the process once i get to that level. my own noobish desire asks for 2 things in a future update to help us noobies. 1. auto output as a lua file. 2. a setting allowing you to load a gui by file name. 3. a setting to allow the window to be opened by keypress which would also be saved in the lua, like commandhandler etc. i dunno. but i am sorry to bug you with my problems when i dont even have enough knowledge to use this yet. If anyone can help btw, i started a thread asking for some help here: https://forum.multitheftauto.com/viewtopic.php?f=91&t=27332&p=308165#p308165
  14. Its loading the gui i pick just fine. I can alter the gui and add elements like buttons and labels etc... the problem is i cant output the code anywhere. If i start from scrach with a gui and i right click off of that window i get the option to output the code. But i just dont get that option with a gui i loaded with loadgui. If i do print date: it just tells me: (in console) ----------- Relative ----------- x: 0.0000 y: 0.0000 width: 1.0000 height: 1.0000 ----------- Absolute ----------- x: 0.0000 y: 0.0000 width: 1280.0000 height: 960.0000 so i tried using /guioutput but that isnt working right, it only outputs one line of text: Succesfully saved to GUIEditor_output.txt with absolute screen and absolute children. but what the GUIEditor_output.txt has in it is only: --- --- --- --- --- do you understand what i mean, im having the problem of loading... saving....loading... saving.... after a loaded gui is loaded i cant save it again. i just dont have the right clik menu option.
  15. okay but why wont "guieditor" let me output the code after i used to loadgui command? i tried using /guioutput but the txt file only makes a 1-line of text iin the txt file that is no where long enough to program an entire gui =(
×
×
  • Create New...