Jump to content

Stevenn

Members
  • Posts

    97
  • Joined

  • Last visited

Everything posted by Stevenn

  1. Stevenn

    play sound

    oh, is it possible to not make it trigger?
  2. Stevenn

    play sound

    Yea, i've tried that, the sound is still playing if i reconnect..
  3. Stevenn

    play sound

    hey i want to play a sound when i start the resource, not when a player login or connect only when i restart/start resource function soundPlay() sound = playSound ("files/mission.mp3",false) setSoundVolume(sound, 1.0) end addEventHandler("onClientResourceStart", root, soundPlay) thanks!
  4. Stevenn

    xml and memo

    nope it works i just forgot to add it into the meta.xml I've seen wrong then. actually, mine worked too
  5. Stevenn

    xml and memo

    nope it works i just forgot to add it into the meta.xml
  6. Stevenn

    xml and memo

    well, I've got a problem i'm trying to set the memo text using a .xml file local Rules = xmlLoadFile ( "xml/rules.xml" ) local Ruless = xmlNodeGetValue ( Rules ) window = guiCreateWindow(462,275,716,474,"",false) Rules = guiCreateButton(13,76,82,35,"Rules",false,window) memo = guiCreateMemo(117,29,582,386,"",false,window) function buttonClick(button) if (button) ~= "left" then return end if (source == Rules) then guiSetText(memo, tostring(Ruless)) end end addEventHandler("onClientGUIClick", resourceRoot, buttonClick, true) the file rules.xml inside the xml folder: <Ruless> My rules here </Ruless> "Bad arguement at line: 2"
  7. Hello. I seem to have a problem with a VIP script I'm trying to make. addEventHandler("onClientPlayerLogin",root, function() local account = getAccountName(getPlayerAccount(source)) local lp = getLocalPlayer() if isObjectInACLGroup("user." .. account, aclGetGroup("VIP")) then triggerServerEvent("isVIP",lp) elseif not isObjectInACLGroup("user." .. account, aclGetGroup("VIP")) then -- if the player isn't in the VIP group we should trigger this event. triggerServerEvent("notVIP",lp) end end)
  8. Sorry for bumping, but I found this alot more effective thanks draken!
  9. Oh, lol I feel like an idiot. but, now the memo isn't showing?
  10. Topic is quite obvious. local medicPed = createPed (275, 1178, -1327, 14) paramedicGui = guiCreateWindow(704,317,533,326,"Paramedic ",true) paramedicMemo = guiCreateMemo(9,0,1,1,"text",false,paramedicGui) paramedicLabel = guiCreateLabel(7,27,521,25,"Paramedic Job Information",true,paramedicGui) guiLabelSetHorizontalAlign(paramedicLabel,"center",false) guiSetFont(paramedicLabel,"clear-normal") paramedicAccept = guiCreateButton(143,290,107,27,"Accept",true,paramedicGui) paramedicClose = guiCreateButton(292,289,107,28,"Close",true,paramedicGui) --additions guiMemoSetReadOnly(paramedicMemo, true) guiWindowSetSizable(paramedicGui, false) function medicClick ( button, state, absX, absY, wx, wy, wz, element ) if ( element and element == medicPed ) then guiSetVisible ( paramedicGui, true ) end end addEventHandler ( "onClientClick", getRootElement(), medicClick ) bindKey("K","down", function() showCursor(true) end)
  11. Stevenn

    Nothing?

    Yeah, just noticed it doesn't work with a lower res, but if I need to calculate it myself, how would I do that?
  12. Stevenn

    Nothing?

    Solidsnake, thanks it works but could you just add some comments on where I did wrong so if I were to do it in the future i'd know what I did wrong?
  13. Stevenn

    Nothing?

    well, I can't find the problem anywhere. The gui is there, or only the windows as there is no buttons nor any memo text. texts = {} texts["Overview"] = "texthere" texts["Rules"] = "texthere" texts["FAQ"] = "texthere" docWindow = guiCreateWindow(0.3672,0.3306,0.2823,0.2481,"Information Panel",true) docOverview = guiCreateButton(13,24,92,38,"Overview",true,docWindow) docRules = guiCreateButton(13,85,92,38,"Rules",true,docWindow) docFAQ = guiCreateButton(14,145,92,38,"FAQ",true,docWindow) docClose = guiCreateButton(17,208,92,38,"Close",true,docWindow) docMemo = guiCreateMemo(121,29,410,227,texts["Overview"],true,docWindow) guiSetVisible(docWindow,false) function bindGui() guiSetVisible(docWindow,true) showCursor(true) end bindKey("F1","down", function() guiSetVisible(docWindow,not guiGetVisible(docWindow)) showCursor(guiGetVisible(docWindow)) end) function setText() local source = guiGetText(source) if soruce == "docClose" then guiSetVisible(docWindow,false) showCursor(false) return end guiSetText(docMemo,texts[source]) end addEventHandler("onClientGUIClick",docOverview,setText,false) addEventHandler("onClientGUIClick",docRules,setText,false) addEventHandler("onClientGUIClick",docFAQ,setText,false) addEventHandler("onClientGUIClick",docClose,setText,false)
  14. Wow, didn't know it was that easy! thanks!
  15. Could you please explain it abit more?
  16. Okay so, I've made a gui in guieditor, which fits my resolution (1680x1050) and I thought I had it right calculated but it isn't, if I change toa lower resolution the gui is totally fucked up. I'm sure I've calculated it right since I used a calculator. local sWidth,sHeight = guiGetScreenSize() GUIEditor_Window[1] = guiCreateWindow(sWidth-956,sHeight-692,sWidth-1213,sHeight-868,"Login Window",false) GUIEditor_Label[1] = guiCreateLabel(22,29,71,22,"Username:",false,GUIEditor_Window[1]) guiLabelSetVerticalAlign(GUIEditor_Label[1],"center") GUIEditor_Label[2] = guiCreateLabel(22,85,70,20,"Password:",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(84,77,109,33,"",false,GUIEditor_Window[1]) GUIEditor_Memo[2] = guiCreateMemo(86,23,109,33,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(99,137,91,36,"Login",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(217,138,91,35,"Forgot my details",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(334,138,91,35,"Register",false,GUIEditor_Window[1]) GUIEditor_Label[3] = guiCreateLabel(206,25,221,31,"- Enter your username here.",false,GUIEditor_Window[1]) GUIEditor_Label[4] = guiCreateLabel(203,85,221,31,"- Enter your password here.",false,GUIEditor_Window[1])
  17. Stevenn

    no buttons?

    I'm sorry, but I don't get it. I understand that you don't want to give out codes without me even trying but I am! so I wonder if anyone could just post an example of how I would calculate policeGui = guiCreateWindow(301,463,263,257,"",false) guiMemo = guiCreateMemo(9,26,241,156,"Text",false,policeGui) guiButtonAccept = guiCreateButton(10,216,65,32,"Accept",false,policeGui) guiButtonClose = guiCreateButton(178,215,65,32,"Close",false,policeGui) After reading the guiGetScreenSize again I understand that example, but it will just create a window in the bottom of my screen, what if I want to change the position how would I do that?
  18. Stevenn

    no buttons?

    Now to another thing, if I want to calculate the gui so it centers and the buttons how the hell do I do that? guiGetScreenSize I've read all that but I still don't understand..
  19. Stevenn

    no buttons?

    Wops, my bad. It works perfectly now! thanks.
  20. Stevenn

    no buttons?

    if I use that code, nothing will happen when I press on any of the buttons.
  21. Stevenn

    no buttons?

    Hello.. I have a problem the marker is there and all but when I enter the marker I cannot see the buttons?? --gui policeGui = guiCreateWindow(301,463,263,257,"",false) guiMemo = guiCreateMemo(9,26,241,156,"Text",false,policeGui) guiButtonAccept = guiCreateButton(10,216,65,32,"Accept",true,policeGui)-- if I change to false, nothing happens when I click on the button! guiButtonClose = guiCreateButton(178,215,65,32,"Close",true,policeGui)-- same here! guiSetVisible(policeGui,false) guiMemoSetReadOnly(guiMemo,true) guiWindowSetMovable (policeGui,false ) guiWindowSetSizable (policeGui,false ) lp = getLocalPlayer() policeMarker = createMarker(1552,-1677,16,"cylinder",2,170,30,0) addEventHandler("onClientMarkerHit",policeMarker,function(p) if p == lp and not isPedInVehicle(lp) then guiSetVisible(policeGui,true) showCursor(true) end end) addEventHandler("onClientGuiClick",policeGui, function(b) if b == "left" then if source == guiButtonAccept then triggerServerEvent("policeServer",lp) outputChatBox("You are now hired as a police officer") showCursor(false) guiSetVisible(policeGui,false) end elseif source == guiButtonClose then guiSetVisible(policeGui,false) showCursor(false) end end)
×
×
  • Create New...