Jump to content

Turbesz

Members
  • Posts

    245
  • Joined

  • Last visited

Everything posted by Turbesz

  1. ERROR: xy.lua:13: attempt to call global 'guiGetText' (a nil value)
  2. Yes, but only me see the word. /sorry for my bad english/
  3. WARNING: xy.lua:17: Bad argument @ 'guiCreateLabel' [Expected string at argument 5, got nil] WARNING: xy.lua:18: Bad argument @ 'guiLabelSetHorizontalAlign' [Expected gui-element at argument 1, got boolean] WARNING: xy.lua:19: Bad argument @ 'guiSetFont' [Expected gui-element at argument 1, got boolean] ERROR: xy.lua:20: attempt to concatenate local 'v_1' (a nil value)
  4. why not working this? (sorry, but me very very noob "scripter") --client local szavon = false local ido = 30 local valasz = 0 GUIEditor_Window = {} GUIEditor_Label = {} function szAblak(ker,v1,v2) if not szavon then local v_1 = v1 local v_2 = v2 local szavon = true local sw,sh = guiGetScreenSize() GUIEditor_Window[1] = guiCreateWindow(sw/1.48,sh/1.4,sw/3.2,sh/3.6,"Szavazás",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(0.0474,0.1242,0.9161,0.2919,ker,true,GUIEditor_Window[1]) guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(0.0657,0.4783,0.8759,0.1553,"1.) "..v_1,true,GUIEditor_Window[1]) --guiLabelSetColor(GUIEditor_Label[2],255,200,200) --guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(0.0657,0.6335,0.8759,0.1491,"2.) "..v_2,true,GUIEditor_Window[1]) GUIEditor_Label[4] = guiCreateLabel(0.0474,0.8075,0.8,0.1,ido,true,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],150,150,255) guiSetFont(GUIEditor_Label[4],"clear-normal") bindKey ("1", "down", function() guiSetFont(GUIEditor_Label[3],"clear-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) valasz = 1 guiLabelSetColor(GUIEditor_Label[2],255,200,200) guiSetFont(GUIEditor_Label[2],"default-bold-small") end) bindKey ("2", "down", function() guiSetFont(GUIEditor_Label[2],"default-normal") guiLabelSetColor(GUIEditor_Label[2],255,255,255) valasz = 2 guiLabelSetColor(GUIEditor_Label[3],255,200,200) guiSetFont(GUIEditor_Label[3],"default-bold-small") end) lejar = setTimer( function() ido = ido-1 guiSetText(GUIEditor_Label[4], ido ) if ido == 0 then szVeg() --killTimer(lejar) end end, 1000,30) end end function szVeg() if isTimer(lejar) then killTimer(lejar) end szavon = false guiSetText(GUIEditor_Label[4], "szavazatok számlálása..." ) guiSetFont(GUIEditor_Label[2],"default-normal") guiSetFont(GUIEditor_Label[3],"default-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) guiLabelSetColor(GUIEditor_Label[2],255,255,255) --("valasz: "..valasz) triggerServerEvent("submit",getLocalPlayer(),valasz) unbindKey ("1", "down", function() guiSetFont(GUIEditor_Label[3],"clear-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) valasz = 1 guiLabelSetColor(GUIEditor_Label[2],255,200,200) guiSetFont(GUIEditor_Label[2],"default-bold-small") end) unbindKey ("2", "down", function() guiSetFont(GUIEditor_Label[2],"default-normal") guiLabelSetColor(GUIEditor_Label[2],255,255,255) valasz = 2 guiLabelSetColor(GUIEditor_Label[3],255,200,200) guiSetFont(GUIEditor_Label[3],"default-bold-small") end) end addEvent("szvzas",true) addEventHandler("szvzas",getRootElement(), function(kerdes,val1,val2) szAblak(kerdes,val1,val2) end) addEvent("valaszok",true) addEventHandler("valaszok",getRootElement(), function(v1,v2) local v_1 = v1 local v_2 = v2 guiSetText(GUIEditor_Label[4], "_@/\"" ) guiSetText(GUIEditor_Label[2], guiGetText(GUIEditor_Label[2]) .. " - " .. v1 ) guiSetText(GUIEditor_Label[3], guiGetText(GUIEditor_Label[3]) .. " - " .. v2 ) if v1 > v2 then guiSetFont(GUIEditor_Label[2],"default-bold-small") elseif v1 < v2 then guiSetFont(GUIEditor_Label[3],"default-bold-small") end setTimer( function() destroyElement(GUIEditor_Window[1]) szavon = false ido = 30 valasz = 0 end, 5000, 1) end) --server function met(p,s) if hasObjectPermissionTo(p,"function.kickPlayer") then triggerClientEvent(getRootElement(),"szvzas",getRootElement()) end end addCommandHandler("k",met) function valaszok () --if hasObjectPermissionTo(p,"function.kickPlayer") then triggerClientEvent(getRootElement(),"valaszok",getRootElement()) end --end
  5. local GUIEditor = { button = {}, window = {}, memo = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(471, 309, 511, 161, "FullFunPlay ~ Egyedi szavazás indító panel ~ by turbesz", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(13, 27, 77, 18, "Kérdés:", false, GUIEditor.window[1]) local kerdes = guiCreateMemo(66, 22, 435, 33, "", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(64, 67, 95, 17, "Válasz 1:", false, GUIEditor.window[1]) local valasz1 = guiCreateMemo(122, 61, 152, 33, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(284, 67, 79, 20, "Válasz 2:", false, GUIEditor.window[1]) local valasz2 = guiCreateMemo(336, 59, 165, 35, "", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(10, 116, 239, 35, "Szavazás indítása!", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(468, 123, 33, 28, "X", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFF0000") guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], function() outputChatBox("#FF0000Szavazás! #00FF00Kérdés:#aeaeae "..guiGetText(kerdes).."#00ff00Lehetséges válaszok: #00baff\n1="..guiGetText(valasz1).."2="..guiGetText(valasz2),root,r,g,b,true) end) function showGUI() guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) end addEvent( "showguii", true ) addEventHandler( "showguii", localPlayer, showGUI ) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end )
  6. --client local GUIEditor = { button = {}, window = {}, memo = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(471, 309, 511, 161, "FullFunPlay ~ Egyedi szavazás indító panel ~ by turbesz", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(13, 27, 77, 18, "Kérdés:", false, GUIEditor.window[1]) local kerdes = guiCreateMemo(66, 22, 435, 33, "", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(64, 67, 95, 17, "Válasz 1:", false, GUIEditor.window[1]) local valasz1 = guiCreateMemo(122, 61, 152, 33, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(284, 67, 79, 20, "Válasz 2:", false, GUIEditor.window[1]) local valasz2 = guiCreateMemo(336, 59, 165, 35, "", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(10, 116, 239, 35, "Szavazás indítása!", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(468, 123, 33, 28, "X", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFF0000") guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], function() outputChatBox("#FF0000Szavazás! #00FF00Kérdés:#aeaeae "..guiGetText(kerdes).."#00ff00Lehetséges válaszok: #00baff\n1="..guiGetText(valasz1).."2="..guiGetText(valasz2),r,g,b,true) end) function showGUI() guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) end addEvent( "showguii", true ) addEventHandler( "showguii", localPlayer, showGUI ) --server function teszt(p) if hasObjectPermissionTo(p,"function.kickPlayer") then triggerClientEvent(thePlayer,"showguii",thePlayer) end end addCommandHandler("szav",teszt)
  7. why not working this? (sorry, but me very very noob "scripter") local GUIEditor = { button = {}, window = {}, memo = {} } local szoveg = {} GUIEditor.window[1] = guiCreateWindow(675, 322, 317, 305, "teszt panel", false) guiWindowSetSizable(GUIEditor.window[1], false) szoveg = guiCreateMemo(13, 23, 294, 223, "", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(33, 255, 257, 40, "ok", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", GUIEditor.button[1], outputChatBox("Szöveg "..szoveg.." még szöveg") ) and... ERROR: xy.lua:15: attempt to concatenate global 'szoveg' (a userdata value)
  8. sorry for my bad english.. this script take money from all players instead of one player, but why? --client addEvent( "hp", true ) addEventHandler( "hp", root, function (thePlayer) setElementHealth (thePlayer, 200) end ) addEvent( "pa", true ) addEventHandler( "pa", root, function (thePlayer) setPedArmor( thePlayer, 100 ) end ) function takeCash ( ) -- when the takecash command is called takePlayerMoney ( source, 7000 ) -- take the amount of money from the player end addEvent( "penzhp", true ) addEventHandler( "penzhp", root, takeCash ) function drift (thePlayer) setElementPosition ( thePlayer, -1910, 832, 36 ) outputChatBox ('#1E90FF[ #FFFFFFKajálda#1E90FF ]: #00FFFF' .. getPlayerName(thePlayer) .. ' #C0C0C0 Elteleportált #FF0000! #1E90FF/kajalda', root, 255, 255, 255, true) end addCommandHandler ( "kajalda", drift ) --server local marker = createMarker(-1912.09, 828.07, 34.20,"cylinder",1.2,235,0,0,235) local GUIEditor = { button = {}, window = {}, staticimage = {} } GUIEditor.window[1] = guiCreateWindow(537, 334, 383, 229, "FullFunPlay ~ Egyedi kajálda /by Turbesz/", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF4EFE00") GUIEditor.staticimage[1] = guiCreateStaticImage(18, 21, 174, 142, "hamburger.png", false, GUIEditor.window[1]) GUIEditor.staticimage[2] = guiCreateStaticImage(209, 31, 164, 121, "sor.png", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(25, 153, 157, 32, "Hambi ~ 200 HP ~ 7000Ft", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(209, 153, 157, 32, "Sör ~ 100 Pajzs ~ 8000Ft", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") GUIEditor.button[3] = guiCreateButton(89, 193, 203, 26, "BEZÁRÁS BEZÁRÁS BEZÁRÁS ", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFF0000") guiSetVisible (GUIEditor.window[1], false) addEventHandler("onClientMarkerHit", marker, function (p) if p == localPlayer then count = 10 --addEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(GUIEditor.window[1], true) --guiSetVisible(GUIEditor.memo[1], true) showCursor(true) end end ) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[3] then guiSetVisible(GUIEditor.window[1],false) showCursor ( false ) end end ) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then triggerServerEvent ("penzhp", root, getLocalPlayer()) end end ) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[2] then triggerServerEvent ("penzap", root, getLocalPlayer()) end end ) function health() triggerServerEvent ("hp", root, getLocalPlayer()) end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], health, false ) function armor() triggerServerEvent ("pa", root, getLocalPlayer()) end addEventHandler ( "onClientGUIClick", GUIEditor.button[2], armor, false )
  9. not the votemanager another script --client local szavon = false local ido = 30 local valasz = 0 GUIEditor_Window = {} GUIEditor_Label = {} function szAblak(ker,v1,v2) if not szavon then local v_1 = v1 local v_2 = v2 local szavon = true local sw,sh = guiGetScreenSize() GUIEditor_Window[1] = guiCreateWindow(sw/1.48,sh/1.4,sw/3.2,sh/3.6,"Szavazás",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(0.0474,0.1242,0.9161,0.2919,ker,true,GUIEditor_Window[1]) guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(0.0657,0.4783,0.8759,0.1553,"1.) "..v_1,true,GUIEditor_Window[1]) --guiLabelSetColor(GUIEditor_Label[2],255,200,200) --guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(0.0657,0.6335,0.8759,0.1491,"2.) "..v_2,true,GUIEditor_Window[1]) GUIEditor_Label[4] = guiCreateLabel(0.0474,0.8075,0.8,0.1,ido,true,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],150,150,255) guiSetFont(GUIEditor_Label[4],"clear-normal") bindKey ("1", "down", function() guiSetFont(GUIEditor_Label[3],"clear-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) valasz = 1 guiLabelSetColor(GUIEditor_Label[2],255,200,200) guiSetFont(GUIEditor_Label[2],"default-bold-small") end) bindKey ("2", "down", function() guiSetFont(GUIEditor_Label[2],"default-normal") guiLabelSetColor(GUIEditor_Label[2],255,255,255) valasz = 2 guiLabelSetColor(GUIEditor_Label[3],255,200,200) guiSetFont(GUIEditor_Label[3],"default-bold-small") end) lejar = setTimer( function() ido = ido-1 guiSetText(GUIEditor_Label[4], ido ) if ido == 0 then szVeg() --killTimer(lejar) end end, 1000,30) end end function szVeg() if isTimer(lejar) then killTimer(lejar) end szavon = false guiSetText(GUIEditor_Label[4], "szavazatok számlálása..." ) guiSetFont(GUIEditor_Label[2],"default-normal") guiSetFont(GUIEditor_Label[3],"default-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) guiLabelSetColor(GUIEditor_Label[2],255,255,255) --("valasz: "..valasz) triggerServerEvent("submit",getLocalPlayer(),valasz) unbindKey ("1", "down", function() guiSetFont(GUIEditor_Label[3],"clear-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) valasz = 1 guiLabelSetColor(GUIEditor_Label[2],255,200,200) guiSetFont(GUIEditor_Label[2],"default-bold-small") end) unbindKey ("2", "down", function() guiSetFont(GUIEditor_Label[2],"default-normal") guiLabelSetColor(GUIEditor_Label[2],255,255,255) valasz = 2 guiLabelSetColor(GUIEditor_Label[3],255,200,200) guiSetFont(GUIEditor_Label[3],"default-bold-small") end) end addEvent("szvzas",true) addEventHandler("szvzas",getRootElement(), function(kerdes,val1,val2) szAblak(kerdes,val1,val2) end) addEvent("valaszok",true) addEventHandler("valaszok",getRootElement(), function(v1,v2) guiSetText(GUIEditor_Label[4], "_@/\"" ) guiSetText(GUIEditor_Label[2], guiGetText(GUIEditor_Label[2]) .. " - " .. v1 ) guiSetText(GUIEditor_Label[3], guiGetText(GUIEditor_Label[3]) .. " - " .. v2 ) if v1 > v2 then guiSetFont(GUIEditor_Label[2],"default-bold-small") elseif v1 < v2 then guiSetFont(GUIEditor_Label[3],"default-bold-small") end setTimer( function() destroyElement(GUIEditor_Window[1]) szavon = false ido = 30 valasz = 0 end, 5000, 1) end) --server function submit ( ) end addEvent( "submit", true ) addEventHandler( "submit", root, submit )
  10. no errors, but the progressbar doesn't working |
  11. ERROR: Loading script failed: game-fuvarmunka\c.lua:84: ')' expected (to close '(' at line 79) near 'setTimer' but why? --client local marker = createMarker(2159,-1807,12.35,"cylinder",2,65,131,215,235) local GUIEditor = { window = {}, memo = {}, button = {}, label = {}, progressbar = {}, } GUIEditor.window[1] = guiCreateWindow(633, 284, 166, 194, "Fuvarmunka", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(133, 25, 23, 21, "X", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "B5E30000") GUIEditor.button[2] = guiCreateButton(9, 50, 147, 29, "Munkajármű kérése", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") GUIEditor.label[1] = guiCreateLabel(72, 173, 94, 15, "turbesz [FFP] ©", false, GUIEditor.window[1]) GUIEditor.memo[1] = guiCreateMemo(10, 81, 146, 92, "A munka elfogadásához kérd le a munkajárműved. Menj a munkajárműveddel a teherautó ikonhoz a radaron, várd meg még lepakolják az árut, és menj a következő helyre. Felmondáshoz szállj ki a munka járműből.", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) guiSetVisible (GUIEditor.window[1], false) addEventHandler("onClientMarkerHit", marker, function (p) if p == localPlayer then count = 10 --addEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(GUIEditor.window[1], true) guiSetVisible(GUIEditor.memo[1], true) showCursor(true) end end ) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) local aButtons5 = { GUIEditor.button[2] } addEventHandler('onClientGUIClick',root, function ( ) for i,v in ipairs ( aButtons5 ) do if source == v then if getElementData ( source,'AntiButtonFlood' ) == true then return outputChatBox('Már rendelkezel járművel!') end setElementData ( source,'AntiButtonFlood',true ) triggerServerEvent("munkajarmu",getLocalPlayer(),255,0,0,"Lekérted a munkajárműved!") guiSetVisible(GUIEditor.window[1],false) showCursor(false) local marker2 = createMarker(1809,-1433,12.35,"cylinder",2,65,131,215,235) triggerServerEvent("blipipi", getLocalPlayer(), group) setTimer ( setElementData,600000,1,source,'AntiButtonFlood',false ) end end end ) GUIEditor.progressbar[1] = guiCreateProgressBar(486, 371, 465, 35, false) guiSetVisible (GUIEditor.progressbar[1], false) addEventHandler("onClientMarkerHit", marker2, setTimer(function() guiProgressBarSetProgress(GUIEditor.progressbar[1], 10) end, 1000, 1) setTimer(function() guiProgressBarSetProgress(GUIEditor.progressbar[1], 20) end, 2000, 1) setTimer(function() guiProgressBarSetProgress(GUIEditor.progressbar[1], 30) end, 3000, 1) setTimer(function() guiProgressBarSetProgress(GUIEditor.progressbar[1], 40) end, 4000, 1) setTimer(function() guiProgressBarSetProgress(GUIEditor.progressbar[1], 50) end, 5000, 1) setTimer(function() guiProgressBarSetProgress(GUIEditor.progressbar[1], 60) end, 6000, 1) setTimer(function() guiProgressBarSetProgress(GUIEditor.progressbar[1], 70) end, 7000, 1) setTimer(function() guiProgressBarSetProgress(GUIEditor.progressbar[1], 80) end, 8000, 1) setTimer(function() guiProgressBarSetProgress(GUIEditor.progressbar[1], 90) end, 9000, 1) setTimer(function() guiProgressBarSetProgress(GUIEditor.progressbar[1], 100) end, 10000, 1) setTimer(function() guiSetVisible (GUIEditor.progressbar[1], false) triggerServerEvent("jutalmad", getLocalPlayer(), group) end, 11000, 1) ) Thanks, the help |
  12. i put this in fr_client.lua but doesn't working --------------------------- -- Warp toggle ------------------------- function warpTo(leaf) if not leaf then leaf = getSelectedGridListLeaf(wndWarp, 'playerlist') if not leaf then return end end local player = getPlayerFromNick(leaf.name) if player then if getElementData(player,"warp.status") then outputChatBox ( "This player has disabled warping.", player, 255, 0, 0 ) return end -- added server.warpMe(player) end closeWindow(wndWarp) end function warpToCommand(cmd, player) if player then player = getPlayerFromNick(player) if player then if getElementData(player,"warp.status") then outputChatBox ( "This player has disabled warping.", player, 255, 0, 0 ) return end --added server.warpMe(player) end else createWindow(wndWarp) showCursor(true) end end addCommandHandler('warpto', warpToCommand) addCommandHandler('wt', warpToCommand) and {'chk', id='warponoff', text='Warp', onclick=toggleWarpOnOff, width=50}, how to fix?:c /sorry for my bad english/
  13. doesn't working, chat window not open, and debugscript: ERROR: pmv3\pmc.lua:112: attempt to concatenate global 'msg' (a nil value)
  14. local GUIEditor = { label = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() yourGui = guiCreateWindow(405, 62, 682, 451, "privát beszélgetés by turbesz", false) guiWindowSetSizable(yourGui, false) close = guiCreateButton(646, 20, 26, 26, "X", false, yourGui) guiSetProperty(close, "NormalTextColour", "FFFF0000") bb = guiCreateButton(658, 33, 172, 22, "Privát beszélgetés", false) guiSetVisible(bb,true) grdPlayers = guiCreateGridList(0.0991,0.2449,0.8108,0.6968, true, yourGui) colPlayers = guiGridListAddColumn(grdPlayers, "Játékosok", 0.85) guiSetVisible(yourGui,false) GUIEditor.label[1] = guiCreateLabel(24, 22, 620, 82, "Szia, üdvözöllek a FullFunPlay egyedi Privát üzenet rendszerében! \"{SMILIES_PATH}/icon_wink.gif\" alt=\"\" title=\"Wink\" /> \n\nVálassz ki valakit, és kattints duplán (kétszer) a nevére, utána megnyillik a csevegő ablak, ahol nyugodtan, mindenki hátamögött (kivéve turbeszt persze:3) beszélhettek a pucér nagy mellű nőkről, vagy akármiről, ez whatever.", false, yourGui) guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true) -- events addEventHandler("onClientGUIClick",bb,clickButtonBB,false) addEventHandler ( "onClientGUIClick", close, Bezaras,false) end ) -- add all players to your gridlist function addPlayersToGridlist() guiGridListClear(grdPlayers) local players = getElementsByType("player") for index, player in pairs(players) do local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(player) guiGridListSetItemText(grdPlayers, row,1, name, false, false) end end -- open the Gui when the player click bb button function clickButtonBB() if not guiGetVisible (yourGui) then guiSetVisible(yourGui,true) showCursor(true) addPlayersToGridlist() else guiSetVisible(yourGui,false) showCursor(false) end end -- close the gui when the player click the close button function Bezaras() if guiGetVisible (yourGui) then guiSetVisible(yourGui, false) showCursor ( false ) end end function buildChatWindow(ply) local x,y = guiGetScreenSize() local width,height = 300,250 x = x*.5 y = y*.5 chat[ply] = {} chat[ply].wnd = guiCreateWindow(337,277,395,252, getPlayerName(ply), false) chat[ply].img = guiCreateStaticImage(0.0228,0.0754,0.9544,0.8889,"image/shruk.png",true,chat[ply].wnd) chat[ply].memo = guiCreateMemo(0.043,0.1746,0.9089,0.623, "", true, chat[ply].wnd) chat[ply].edit = guiCreateEdit(0.043,0.8214,0.7089,0.1111, "", true, chat[ply].wnd) chat[ply].btnX = guiCreateButton(0.9215,0.0754,0.0557,0.0794, "X", true, chat[ply].wnd) chat[ply].btnSend = guiCreateButton(0.757,0.8135,0.2127,0.1429, "Küldés", true, chat[ply].wnd) guiSetProperty(chat[ply].img,"Disabled","true") guiMemoSetReadOnly(chat[ply].memo, true) guiWindowSetSizable(chat[ply].wnd, false) guiSetProperty(chat[ply].wnd, "RollUpEnabled", "true") guiSetProperty(chat[ply].wnd, "Dragable", "true") end function sendChatMessage(ply) outputDebugString("sendChatMessage: " .. tostring(ply)) if chat[ply] and isElement(chat[ply].wnd) then local newText = guiGetText(chat[ply].edit) if newText and string.len(newText) > 0 then local oldText = guiGetText(chat[ply].memo) if not oldText then oldText = "" end oldText = oldText .. getPlayerName(g_LocalPlayer) .. ": " .. newText .. "\n" guiSetText(chat[ply].memo, oldText) guiSetText(chat[ply].edit, "") guiMemoSetCaretIndex(chat[ply].memo, string.len(oldText)) triggerServerEvent("onGUIPrivateMessage", g_LocalPlayer, ply,newText) end end end function recieveChatMessage(ply, msg) outputDebugString("recieveChatMessage: " .. msg) if not chat[ply] then buildChatWindow(ply) end end local newmsg.show = true newmsg.tick = getTickCount() guiSetText(newmsg.lbl, getPlayerName(ply) .. ": " .. msg .. "\n") guiSetText(newmsg.lbl, "Üzenet tőle " .. getPlayerName(ply) .. "\n") outputChatBox("Üzeneted érkezett. Nyomj F3-at hogy megnézd.",255,255,255,true) local sound = playSound("GatkResalh~.mp3",false) setSoundVolume(sound, 0.2) event_player_join = function() --outputDebugString("onClientPlayerJoin") addPlayersToGridlist(source) end event_player_quit = function() --outputDebugString("onClientPlayerQuit") removePlayerFromGridList(source) destroyChatWindow(source) end event_gui_doubleclick = function(button, state, absx, absy) if button == "left" and state == "up" then if source == grdPlayers then local row, col = guiGridListGetSelectedItem(grdPlayers) --outputDebugString("double clicked row: "..tostring(row)) if row == -1 or col == -1 then return end local name = guiGridListGetItemText(grdPlayers, row, col) local ply = getPlayerFromName(name) if not chat[ply] then buildChatWindow(ply) end guiBringToFront(chat[ply].wnd) end end end event_gui_accepted = function(element) local parent = getElementParent(source) if parent ~= false then local ply = getPlayerFromName(guiGetText(parent)) if ply then if element == chat[ply].edit then sendChatMessage(ply) end end end end event_render = function() if newmsg.show == true then if getTickCount() > newmsg.tick + newmsg.showtime then anims.nmfadeout:play() anims.nmtextout:play() newmsg.show = false end end end addEvent("onPrivateChatSent", true) addEventHandler("onPrivateChatSent", g_Root, recieveChatMessage) addEventHandler("onClientResourceStart", g_ResourceRoot, event_resource_start) addEventHandler("onClientResourceStop", g_ResourceRoot, event_resource_stop) addEventHandler("onClientGUIDoubleClick", g_ResourceRoot, event_gui_doubleclick) addEventHandler("onClientGUIClick", g_ResourceRoot, event_gui_click) addEventHandler("onClientGUIAccepted", g_ResourceRoot, event_gui_accepted) addEventHandler("onClientPlayerJoin", g_Root, event_player_join) addEventHandler("onClientPlayerQuit", g_Root, event_player_quit) addEventHandler("onClientRender", g_Root, event_render)
  15. Now: ERROR: Loading script failed: pmv3\pmc.lua:102: unexpected symbol near '.'
  16. Debugscript: ERROR: pmv3\pmc.lua:102: attempt to index global 'newmsg' (a nil value) --client local GUIEditor = { label = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() yourGui = guiCreateWindow(405, 62, 682, 451, "privát beszélgetés by turbesz", false) guiWindowSetSizable(yourGui, false) close = guiCreateButton(646, 20, 26, 26, "X", false, yourGui) guiSetProperty(close, "NormalTextColour", "FFFF0000") bb = guiCreateButton(658, 33, 172, 22, "Privát beszélgetés", false) guiSetVisible(bb,true) grdPlayers = guiCreateGridList(0.0991,0.2449,0.8108,0.6968, true, yourGui) colPlayers = guiGridListAddColumn(grdPlayers, "Játékosok", 0.85) guiSetVisible(yourGui,false) GUIEditor.label[1] = guiCreateLabel(24, 22, 620, 82, "Szia, üdvözöllek a FullFunPlay egyedi Privát üzenet rendszerében! \"{SMILIES_PATH}/icon_wink.gif\" alt=\"\" title=\"Wink\" /> \n\nVálassz ki valakit, és kattints duplán (kétszer) a nevére, utána megnyillik a csevegő ablak, ahol nyugodtan, mindenki hátamögött (kivéve turbeszt persze:3) beszélhettek a pucér nagy mellű nőkről, vagy akármiről, ez whatever.", false, yourGui) guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true) -- events addEventHandler("onClientGUIClick",bb,clickButtonBB,false) addEventHandler ( "onClientGUIClick", close, Bezaras,false) end ) -- add all players to your gridlist function addPlayersToGridlist() guiGridListClear(grdPlayers) local players = getElementsByType("player") for index, player in pairs(players) do local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(player) guiGridListSetItemText(grdPlayers, row,1, name, false, false) end end -- open the Gui when the player click bb button function clickButtonBB() if not guiGetVisible (yourGui) then guiSetVisible(yourGui,true) showCursor(true) addPlayersToGridlist() else guiSetVisible(yourGui,false) showCursor(false) end end -- close the gui when the player click the close button function Bezaras() if guiGetVisible (yourGui) then guiSetVisible(yourGui, false) showCursor ( false ) end end function buildChatWindow(ply) local x,y = guiGetScreenSize() local width,height = 300,250 x = x*.5 y = y*.5 chat[ply] = {} chat[ply].wnd = guiCreateWindow(337,277,395,252, getPlayerName(ply), false) chat[ply].img = guiCreateStaticImage(0.0228,0.0754,0.9544,0.8889,"image/shruk.png",true,chat[ply].wnd) chat[ply].memo = guiCreateMemo(0.043,0.1746,0.9089,0.623, "", true, chat[ply].wnd) chat[ply].edit = guiCreateEdit(0.043,0.8214,0.7089,0.1111, "", true, chat[ply].wnd) chat[ply].btnX = guiCreateButton(0.9215,0.0754,0.0557,0.0794, "X", true, chat[ply].wnd) chat[ply].btnSend = guiCreateButton(0.757,0.8135,0.2127,0.1429, "Küldés", true, chat[ply].wnd) guiSetProperty(chat[ply].img,"Disabled","true") guiMemoSetReadOnly(chat[ply].memo, true) guiWindowSetSizable(chat[ply].wnd, false) guiSetProperty(chat[ply].wnd, "RollUpEnabled", "true") guiSetProperty(chat[ply].wnd, "Dragable", "true") end function sendChatMessage(ply) outputDebugString("sendChatMessage: " .. tostring(ply)) if chat[ply] and isElement(chat[ply].wnd) then local newText = guiGetText(chat[ply].edit) if newText and string.len(newText) > 0 then local oldText = guiGetText(chat[ply].memo) if not oldText then oldText = "" end oldText = oldText .. getPlayerName(g_LocalPlayer) .. ": " .. newText .. "\n" guiSetText(chat[ply].memo, oldText) guiSetText(chat[ply].edit, "") guiMemoSetCaretIndex(chat[ply].memo, string.len(oldText)) triggerServerEvent("onGUIPrivateMessage", g_LocalPlayer, ply,newText) end end end function recieveChatMessage(ply, msg) outputDebugString("recieveChatMessage: " .. msg) if not chat[ply] then buildChatWindow(ply) end end newmsg.show = true newmsg.tick = getTickCount() guiSetText(newmsg.lbl, getPlayerName(ply) .. ": " .. msg .. "\n") guiSetText(newmsg.lbl, "Üzenet tőle " .. getPlayerName(ply) .. "\n") outputChatBox("Üzeneted érkezett. Nyomj F3-at hogy megnézd.",255,255,255,true) local sound = playSound("GatkResalh~.mp3",false) setSoundVolume(sound, 0.2) event_player_join = function() --outputDebugString("onClientPlayerJoin") addPlayersToGridlist(source) end event_player_quit = function() --outputDebugString("onClientPlayerQuit") removePlayerFromGridList(source) destroyChatWindow(source) end event_gui_doubleclick = function(button, state, absx, absy) if button == "left" and state == "up" then if source == grdPlayers then local row, col = guiGridListGetSelectedItem(grdPlayers) --outputDebugString("double clicked row: "..tostring(row)) if row == -1 or col == -1 then return end local name = guiGridListGetItemText(grdPlayers, row, col) local ply = getPlayerFromName(name) if not chat[ply] then buildChatWindow(ply) end guiBringToFront(chat[ply].wnd) end end end event_gui_accepted = function(element) local parent = getElementParent(source) if parent ~= false then local ply = getPlayerFromName(guiGetText(parent)) if ply then if element == chat[ply].edit then sendChatMessage(ply) end end end end event_render = function() if newmsg.show == true then if getTickCount() > newmsg.tick + newmsg.showtime then anims.nmfadeout:play() anims.nmtextout:play() newmsg.show = false end end end addEvent("onPrivateChatSent", true) addEventHandler("onPrivateChatSent", g_Root, recieveChatMessage) addEventHandler("onClientResourceStart", g_ResourceRoot, event_resource_start) addEventHandler("onClientResourceStop", g_ResourceRoot, event_resource_stop) addEventHandler("onClientGUIDoubleClick", g_ResourceRoot, event_gui_doubleclick) addEventHandler("onClientGUIClick", g_ResourceRoot, event_gui_click) addEventHandler("onClientGUIAccepted", g_ResourceRoot, event_gui_accepted) addEventHandler("onClientPlayerJoin", g_Root, event_player_join) addEventHandler("onClientPlayerQuit", g_Root, event_player_quit) addEventHandler("onClientRender", g_Root, event_render) --server addEvent("onGUIPrivateMessage", true) addEventHandler("onGUIPrivateMessage", getRootElement(), function(toplayer, text) triggerClientEvent(toplayer, "onPrivateChatSent", source, source, text) end )
  17. i told you , you don't know how to use it read my first post again.
  18. I think you don't know how to use it , try to do it by yourself then post your code here. bb = guiCreateButton(658, 33, 172, 22, "Privát beszélgetés", false) guiSetVisible(bb,true) local GUIEditor = { button = {}, window = {}, gridlist = {}, } GUIEditor.window[1] = guiCreateWindow(405, 62, 682, 451, "privát beszélgetés by turbesz", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(646, 20, 26, 26, "X", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF0000") grdPlayers = guiCreateGridList(0.0991,0.2449,0.8108,0.6968, true, GUIEditor.window[1]) colPlayers = guiGridListAddColumn(grdPlayers, "Játékosok", 0.85) local players = getElementsByType("player") for k,v in ipairs(players) do addPlayerToList(v) end function addPlayersToGridlist() guiGridListClear(grdPlayers) local players = getElementsByType("player") for index, player in pairs(players) do local row = guiGridListAddRow(grdPlayers) local name = getPlayerName(player) guiGridListSetItemText(grdPlayers, row,1, name, false, false) end end guiSetVisible(GUIEditor.window[1],false) addEventHandler("onClientGUIClick",root, function () if source == bb then guiSetVisible(GUIEditor.window[1],true) showCursor ( true ) end end ) function Bezaras() guiSetVisible(GUIEditor.window[1], false) showCursor ( false ) end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], Bezaras)
×
×
  • Create New...