
papam77
Members-
Posts
517 -
Joined
-
Last visited
Everything posted by papam77
-
----------------------------- -- Userpanel Design --------- ----------------------------- function design () showCursor (true) local realTime = getRealTime ( ) local rTime = string.format ( "%02d:%02d", realTime.hour, realTime.minute) local realDate = getRealTime ( ) local rDate = string.format ( "%02d/%d", realDate.monthday, realDate.month+1) local ikony = { ["pohar"] = guiCreateStaticImage(0.09, 0.11, 0.27, 0.20, "img/1.png", true), -- Obdélník ["ovladac"] = guiCreateStaticImage(0.09, 0.32, 0.13, 0.20, "img/5.png", true), -- Čtverec ["sluchatka"] = guiCreateStaticImage(0.2296, 0.32, 0.13, 0.20, "img/7.png", true), -- Čtverec ["taska"] = guiCreateStaticImage(0.507, 0.11, 0.13, 0.20, "img/9.png", true), -- Čtverec ["fotak"] = guiCreateStaticImage(0.368, 0.11, 0.13, 0.20, "img/8.png", true), -- Čtverec ["posta"] = guiCreateStaticImage(0.368, 0.32, 0.27, 0.20, "img/6.png", true), -- Obdélník ["kalendar"] = guiCreateStaticImage(0.368, 0.53, 0.27, 0.20, "img/2.png", true), -- Obdélník ["kufr"] = guiCreateStaticImage(0.646, 0.53, 0.27, 0.20, "img/3.png", true), -- Obdélník ["statistika"] = guiCreateStaticImage(0.646, 0.32, 0.27, 0.20, "img/11.png", true), -- Obdélník ["cas"] = guiCreateStaticImage(0.646, 0.11, 0.27, 0.20, "img/10.png", true), -- Obdélník ["zpet"] = guiCreateStaticImage(0.09, 0.53, 0.27, 0.20, "img/4.png", true), -- Obdélník } local labely = { ["cas"] = guiCreateLabel(0.637, 0.13, 0.27, 0.19, ""..rTime, true), ["datum"] = guiCreateLabel(0.37, 0.53, 0.27, 0.09, ""..rDate, true), ["rok"] = guiCreateLabel(0.365, 0.62, 0.27, 0.09, "2013", true), } font = guiCreateFont( "cas.ttf", 75 ) guiSetFont( labely["cas"], font ) guiLabelSetHorizontalAlign(labely["cas"], "center", false) guiLabelSetVerticalAlign(labely["cas"], "center") font2 = guiCreateFont( "cas.ttf", 50 ) guiSetFont( labely["datum"], font2 ) guiLabelSetHorizontalAlign(labely["datum"], "center", false) guiLabelSetVerticalAlign(labely["datum"], "center") font3 = guiCreateFont( "cas.ttf", 60 ) guiSetFont( labely["rok"], font3 ) guiLabelSetHorizontalAlign(labely["rok"], "center", false) guiLabelSetVerticalAlign(labely["rok"], "center") -- Alphy -- guiSetAlpha ( ikony["pohar"], 0.75 ) guiSetAlpha ( ikony["ovladac"], 0.75 ) guiSetAlpha ( ikony["sluchatka"], 0.75 ) guiSetAlpha ( ikony["taska"], 0.75 ) guiSetAlpha ( ikony["fotak"], 0.75 ) guiSetAlpha ( ikony["posta"], 0.75 ) guiSetAlpha ( ikony["kalendar"], 0.75 ) guiSetAlpha ( ikony["kufr"], 0.75 ) guiSetAlpha ( ikony["statistika"], 0.75 ) guiSetAlpha ( ikony["cas"], 0.75 ) guiSetAlpha ( ikony["zpet"], 0.75 ) -- Alphy -- function pohar() addEventHandler ( "onClientMouseEnter", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 1 ) break end end end ) addEventHandler ( "onClientMouseLeave", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 0.75 ) break end end end ) addEventHandler ( "onClientGUIClick", ikony["pohar"], btn2, false ) end function btn2(button) if button == "left" then outputChatBox ("xaxax") end end addCommandHandler ("up", pohar ) end addCommandHandler ("up", design ) I've fixed it, but here is problem when i hit ["cas"] label then button lost alpha because label is on button, how can do it when i hit label it will still works for button?
-
Yes, if you want you can try it. http://www.upload.ee/files/3461345/updj.zip.html Or connect to 85.118.131.200:22012 and pass 85219 command for userpanel /up current code: ----------------------------- -- Userpanel Design --------- ----------------------------- function design () showCursor (true) local realTime = getRealTime ( ) local rTime = string.format ( "%02d:%02d", realTime.hour, realTime.minute) local realDate = getRealTime ( ) local rDate = string.format ( "%02d/%d", realDate.monthday, realDate.month+1) local ikony = { ["pohar"] = guiCreateStaticImage(0.09, 0.11, 0.27, 0.20, "img/1.png", true), -- Obdélník ["ovladac"] = guiCreateStaticImage(0.09, 0.32, 0.13, 0.20, "img/5.png", true), -- Čtverec ["sluchatka"] = guiCreateStaticImage(0.2296, 0.32, 0.13, 0.20, "img/7.png", true), -- Čtverec ["taska"] = guiCreateStaticImage(0.507, 0.11, 0.13, 0.20, "img/9.png", true), -- Čtverec ["fotak"] = guiCreateStaticImage(0.368, 0.11, 0.13, 0.20, "img/8.png", true), -- Čtverec ["posta"] = guiCreateStaticImage(0.368, 0.32, 0.27, 0.20, "img/6.png", true), -- Obdélník ["kalendar"] = guiCreateStaticImage(0.368, 0.53, 0.27, 0.20, "img/2.png", true), -- Obdélník ["kufr"] = guiCreateStaticImage(0.646, 0.53, 0.27, 0.20, "img/3.png", true), -- Obdélník ["statistika"] = guiCreateStaticImage(0.646, 0.32, 0.27, 0.20, "img/11.png", true), -- Obdélník ["cas"] = guiCreateStaticImage(0.646, 0.11, 0.27, 0.20, "img/10.png", true), -- Obdélník ["zpet"] = guiCreateStaticImage(0.09, 0.53, 0.27, 0.20, "img/4.png", true), -- Obdélník } guiSetEnabled ( ikony["pohar"], false ) guiSetEnabled ( ikony["ovladac"], false ) guiSetEnabled ( ikony["sluchatka"], false ) guiSetEnabled ( ikony["taska"], false ) guiSetEnabled ( ikony["fotak"], false ) guiSetEnabled ( ikony["posta"], false ) guiSetEnabled ( ikony["kalendar"], false ) guiSetEnabled ( ikony["kurf"], false ) guiSetEnabled ( ikony["statistika"], false ) guiSetEnabled ( ikony["cas"], false ) guiSetEnabled ( ikony["zpet"], false ) local labely = { ["cas"] = guiCreateLabel(0.637, 0.13, 0.27, 0.19, ""..rTime, true), ["datum"] = guiCreateLabel(0.37, 0.53, 0.27, 0.09, ""..rDate, true), ["rok"] = guiCreateLabel(0.365, 0.62, 0.27, 0.09, "2013", true), } font = guiCreateFont( "cas.ttf", 75 ) guiSetFont( labely["cas"], font ) guiLabelSetHorizontalAlign(labely["cas"], "center", false) guiLabelSetVerticalAlign(labely["cas"], "center") font2 = guiCreateFont( "cas.ttf", 50 ) guiSetFont( labely["datum"], font2 ) guiLabelSetHorizontalAlign(labely["datum"], "center", false) guiLabelSetVerticalAlign(labely["datum"], "center") font3 = guiCreateFont( "cas.ttf", 60 ) guiSetFont( labely["rok"], font3 ) guiLabelSetHorizontalAlign(labely["rok"], "center", false) guiLabelSetVerticalAlign(labely["rok"], "center") -- Alphy -- guiSetAlpha ( ikony["pohar"], 0.75 ) guiSetAlpha ( ikony["ovladac"], 0.75 ) guiSetAlpha ( ikony["sluchatka"], 0.75 ) guiSetAlpha ( ikony["taska"], 0.75 ) guiSetAlpha ( ikony["fotak"], 0.75 ) guiSetAlpha ( ikony["posta"], 0.75 ) guiSetAlpha ( ikony["kalendar"], 0.75 ) guiSetAlpha ( ikony["kufr"], 0.75 ) guiSetAlpha ( ikony["statistika"], 0.75 ) guiSetAlpha ( ikony["cas"], 0.75 ) guiSetAlpha ( ikony["zpet"], 0.75 ) -- Alphy -- function pohar() addEventHandler ( "onClientMouseEnter", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 1 ) break end end end ) addEventHandler ( "onClientMouseLeave", root, function ( aX, aY ) for _, gui in pairs ( ikony ) do if ( gui == source ) then guiSetAlpha ( source, 0.75 ) break end end end ) addEventHandler ( "onClientGUIClick", ikony["pohar"], btn2, false ) end function btn2(button) if button == "left" then outputChatBox ("xaxax") end end addCommandHandler ("up", pohar ) end addCommandHandler ("up", design ) And it is setting alpha to 1 only for ["kufr"]
-
Solidsnake, for key, gui in pairs ( ikony ) do This works, but it is works only for one image called ["kufr"]
-
ERROR: userpanel/client.lua:66: bad argument #1 to 'pairs' (table expected, got userdata) ERROR: userpanel/client.lua:77: bad argument #1 to 'pairs' (table expected, got userdata)
-
Thank you, and this. I don't wanna make new thread: ----------------------------- -- Userpanel Design --------- ----------------------------- function design () showCursor (true) local realTime = getRealTime ( ) local rTime = string.format ( "%02d:%02d", realTime.hour, realTime.minute) local ikony = { ["pohar"] = guiCreateStaticImage(0.09, 0.11, 0.27, 0.20, "img/1.png", true), -- Obdélník ["ovladac"] = guiCreateStaticImage(0.09, 0.32, 0.13, 0.20, "img/5.png", true), -- Čtverec ["sluchatka"] = guiCreateStaticImage(0.2296, 0.32, 0.13, 0.20, "img/7.png", true), -- Čtverec ["taska"] = guiCreateStaticImage(0.507, 0.11, 0.13, 0.20, "img/9.png", true), -- Čtverec ["fotak"] = guiCreateStaticImage(0.368, 0.11, 0.13, 0.20, "img/8.png", true), -- Čtverec ["posta"] = guiCreateStaticImage(0.368, 0.32, 0.27, 0.20, "img/6.png", true), -- Obdélník ["kalendar"] = guiCreateStaticImage(0.368, 0.53, 0.27, 0.20, "img/2.png", true), -- Obdélník ["kufr"] = guiCreateStaticImage(0.646, 0.53, 0.27, 0.20, "img/3.png", true), -- Obdélník ["statistika"] = guiCreateStaticImage(0.646, 0.32, 0.27, 0.20, "img/11.png", true), -- Obdélník ["cas"] = guiCreateStaticImage(0.646, 0.11, 0.27, 0.20, "img/10.png", true), -- Obdélník ["zpet"] = guiCreateStaticImage(0.09, 0.53, 0.27, 0.20, "img/4.png", true), -- Obdélník } guiSetEnabled ( ikony["pohar"], false ) guiSetEnabled ( ikony["ovladac"], false ) guiSetEnabled ( ikony["sluchatka"], false ) guiSetEnabled ( ikony["taska"], false ) guiSetEnabled ( ikony["fotak"], false ) guiSetEnabled ( ikony["posta"], false ) guiSetEnabled ( ikony["kalendar"], false ) guiSetEnabled ( ikony["kurf"], false ) guiSetEnabled ( ikony["statistika"], false ) guiSetEnabled ( ikony["cas"], false ) guiSetEnabled ( ikony["zpet"], false ) local labely = { ["cas"] = guiCreateLabel(0.637, 0.13, 0.27, 0.19, ""..rTime, true), } font = guiCreateFont( "lithos.ttf", 75 ) guiSetFont( labely["cas"], font ) guiLabelSetHorizontalAlign(labely["cas"], "center", false) guiLabelSetVerticalAlign(labely["cas"], "center") -- Alphy -- guiSetAlpha ( ikony["pohar"], 0.75 ) guiSetAlpha ( ikony["ovladac"], 0.75 ) guiSetAlpha ( ikony["sluchatka"], 0.75 ) guiSetAlpha ( ikony["taska"], 0.75 ) guiSetAlpha ( ikony["fotak"], 0.75 ) guiSetAlpha ( ikony["posta"], 0.75 ) guiSetAlpha ( ikony["kalendar"], 0.75 ) guiSetAlpha ( ikony["kufr"], 0.75 ) guiSetAlpha ( ikony["statistika"], 0.75 ) guiSetAlpha ( ikony["cas"], 0.75 ) guiSetAlpha ( ikony["zpet"], 0.75 ) -- Alphy -- function pohar() addEventHandler( "onClientMouseEnter", root, function(aX, aY) for key,gui in pairs (ikony["pohar"]) and (ikony["ovladac"]) and (ikony["sluchatka"]) and (ikony["taska"]) and (ikony["fotak"]) and (ikony["posta"]) and (ikony["kalendar"]) and (ikony["statistika"]) and (ikony["cas"]) and (ikony["zpet"]) do if gui == source then guiSetAlpha ( source, 1 ) return end end end ) addEventHandler( "onClientMouseLeave", root, function(aX, aY) for key,gui in pairs (ikony["pohar"]) and (ikony["ovladac"]) and (ikony["sluchatka"]) and (ikony["taska"]) and (ikony["fotak"]) and (ikony["posta"]) and (ikony["kalendar"]) and (ikony["statistika"]) and (ikony["cas"]) and (ikony["zpet"]) do if gui == source then guiSetAlpha ( source, 0.75 ) return end end end ) addEventHandler ( "onClientGUIClick", ikony["pohar"], btn2, false ) end function btn2(button) if button == "left" then outputChatBox ("xaxax") end end addCommandHandler ("up", pohar ) end addCommandHandler ("up", design ) Why it doesn't setting alpha 1 for images which are added in code?
-
And how can do in string.format type HH/MM ?
-
Time: local labely = { ["cas"] = guiCreateLabel(0.637, 0.13, 0.27, 0.19, ""..hours..":"..minutes, true), } But here is problem when is time 18:05 it shows only 18:5 i need it with 0 so 18:05, how can do it? And next ask. How can getLocalDate?
-
Without error and warning. Code now: function design ( source ) playSound ("http://www.181.fm/winamp.pls?station=181-power&style=&description=Power%20181%20(Top%2040)&file=181-power.pls") showCursor ( true ) local source = getLocalPlayer() -- Panels -- panels = { ["bg"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/bg.png", true), ["acc"] = guiCreateStaticImage(0.29, 0.24, 0.14, 0.22, "img/acc.png", true), ["boxid"] = guiCreateStaticImage(0.43, 0.30, 0.23, 0.06, "img/box.png", true), ["boxpass"] = guiCreateStaticImage(0.43, 0.36, 0.23, 0.06, "img/box.png", true), } -- Panels -- -- guiSetEnabled -- guiSetEnabled ( panels["bg"], false ) guiSetEnabled ( panels["acc"], false ) guiSetEnabled ( panels["boxid"], false ) guiSetEnabled ( panels["boxpass"], false ) -- guiSetEnabled -- -- Labels -- labels = { ["name"] = guiCreateLabel(0.45, 0.24, 0.21, 0.03,getPlayerName( source ):gsub("#%x%x%x%x%x%x", "") .."", true, bg), ["state"] = guiCreateLabel(0.45, 0.27, 0.23, 0.03, "Unlogged", true, bg), ["web"] = guiCreateLabel(0.35, 0.97, 0.40, 0.03, "Register at [url=http://EAG-Gaming.eu/]http://EAG-Gaming.eu/[/url]", true, bg), } -- Labels -- -- Settings -- font = guiCreateFont( "lithos.ttf", 13 ) font2 = guiCreateFont( "lithos.ttf", 18 ) guiSetFont( labels["name"], font ) guiSetFont( labels["state"], font2 ) guiSetFont( labels["web"], font2 ) -- Settings -- -- Buttons -- buttons = { ["btn"] = guiCreateStaticImage(0.628, 0.37, 0.02, 0.032, "img/log.png", true, bg ) } -- Buttons -- -- Alpha -- guiSetAlpha ( buttons["btn"], 0.75 ) -- Alpha -- -- Handlers -- addEventHandler( "onClientMouseEnter", guiRoot, function() if source == buttons["btn"] then guiSetAlpha ( source, 1 ) end end ) -- Handlers -- end addEventHandler( "onClientResourceStart", getRootElement( ), design )
-
ERROR: login/client.lua:51: bad argument #1 to 'pairs' (table expected, got userdata)
-
Doesn't work when i hit. I have tryied it with outputConsole ( "something" ) and nothing.
-
Is possible to make it with gui ? guiCreateStaticImage and guiCreateLabel
-
Doesn't work... This is full code. function design ( source ) playSound ("http://www.181.fm/winamp.pls?station=181-power&style=&description=Power%20181%20(Top%2040)&file=181-power.pls") showCursor ( true ) local source = getLocalPlayer() -- Panels -- panels = { ["bg"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/bg.png", true), ["acc"] = guiCreateStaticImage(0.29, 0.24, 0.14, 0.22, "img/acc.png", true), ["boxid"] = guiCreateStaticImage(0.43, 0.30, 0.23, 0.06, "img/box.png", true), ["boxpass"] = guiCreateStaticImage(0.43, 0.36, 0.23, 0.06, "img/box.png", true), } -- Panels -- -- guiSetEnabled -- guiSetEnabled ( panels["bg"], false ) guiSetEnabled ( panels["acc"], false ) guiSetEnabled ( panels["boxid"], false ) guiSetEnabled ( panels["boxpass"], false ) -- guiSetEnabled -- -- Labels -- name = guiCreateLabel(0.45, 0.24, 0.21, 0.03,getPlayerName( source ):gsub("#%x%x%x%x%x%x", "") .."", true, bg) state = guiCreateLabel(0.45, 0.27, 0.23, 0.03, "Unlogged", true, bg) -- Labels -- -- Settings -- font = guiCreateFont( "lithos.ttf", 13 ) font2 = guiCreateFont( "lithos.ttf", 18 ) guiSetFont( name, font2 ) guiSetFont( state, font ) -- Settings -- -- Buttons -- buttons = { ["btn"] = guiCreateStaticImage(0.628, 0.37, 0.02, 0.032, "img/log.png", true, bg ) } -- Buttons -- -- Alpha -- guiSetAlpha ( buttons["btn"], 0.75 ) -- Alpha -- -- Handlers -- addEventHandler( "onClientMouseEnter", root, function(aX, aY) for key,gui in pairs (buttons) do if gui == source then guiSetAlpha ( source, 1 ) end end end ) -- Handlers -- end addEventHandler( "onClientResourceStart", getRootElement( ), design )
-
-- Buttons -- buttons = { ["btn"] = guiCreateStaticImage(0.628, 0.37, 0.02, 0.032, "img/log.png", true, bg ) } -- Buttons -- -- Alpha -- guiSetAlpha ( buttons["btn"], 0.75 ) -- Alpha -- -- Handlers -- addEventHandler( "onClientMouseEnter", root, function(aX, aY) for key,gui in pairs ( buttons["btn"] ) do if gui == source then guiSetAlpha ( source, 1 ) return end end end ) Why Alpha isn't setted to 1 when i hit?
-
How can create it ? I made file box.png and how can use it like edit box ?
-
Hello, is possible to get web online users from IPB 3.3.4 to scoreboard ingame?
-
Doesn't work, ped is still on same place.
-
local John = getElementByID("John") setPedCameraRotation ( "John", 130.791931 ) setPedControlState ( "John", "forwards", true ) now i have this and doesn't work.
-
So local John = getElementByID("John") ?
-
--------------------------------- -- DeeJay v2 -------------------- --------------------------------- function funkce () --------------------------------- -- Pedové ----------------------- --------------------------------- setPedCameraRotation ( John, 130.791931 ) setPedControlState ( John, "forwards", true ) --------------------------------- -- Outputy ---------------------- --------------------------------- outputChatBox ("EAG|#ffffffDeeJay: #ff9900Hello guys", 255,255,255, true ) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), funkce ) And doesn't work.
-
------ Global local function outputChatMsg(msgtype,m,source) if msgtype == 0 then for k,v in ipairs(getElementsByType("player")) do if (getElementData(v,"room") == getElementData(source,"room")) then outputChatBox(m,v,255,255,255,true) end end elseif msgtype == 2 then local team = getPlayerTeam(source) if team then for k,v in ipairs(getElementsByType("player")) do if getPlayerTeam(v) then outputChatBox("#FF6464(Team) #ffffff"..m,v,255,255,255,true) end end end elseif msgtype == 3 then outputChatBox("#FF6464[Global] #ffffff"..m,root,255,255,255,true) end end local function GlobalChat(source,cmd,...) local m = table.concat({...},' '):gsub("#%x%x%x%x%x%x",""):sub(1,100) outputChatMsg(3,getPlayerName(source).."#F2F0F0: "..m,source) end addCommandHandler("Globalsay",GlobalChat) addEventHandler("onPlayerJoin",root, function() bindKey(source,"G","down","chatbox","Globalsay") end) for k,v in ipairs(getElementsByType("player")) do bindKey(v,"G","down","chatbox","Globalsay") end ----- Language function LanguageChat(thePlayer, cmd, ...) local msg = table.concat({...}, " ") for _,players in ipairs(getElementsByType("player")) do local r, g, b = getPlayerNametagColor (thePlayer) local name = getPlayerName(thePlayer) local mycountry = exports.admin:getPlayerCountry(thePlayer) local playerscountry = exports.admin:getPlayerCountry(players) if (playerscountry == mycountry) then if (msg and msg ~= "") then outputChatBox("("..mycountry..") "..getPlayerName(name)..": #FFFFFF"..msg.."",players,r, g, b,true) end end end end addCommandHandler("Language",LanguageChat) addEventHandler("onPlayerJoin",root, function () bindKey(source,"L","down","chatbox","Language") end ) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"L","down","chatbox","Language") end end )
-
--------------------------------- -- DeeJay v2 -------------------- --------------------------------- function funkce () --------------------------------- -- Pedové ----------------------- --------------------------------- setPedCameraRotation ( John, 130.791931 ) setPedControlState ( John, forwards, true ) --------------------------------- -- Outputy ---------------------- --------------------------------- outputChatBox ("EAG|#ffffffDeeJay: #ff9900Hello guys", 255,255,255, true ) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), funkce ) Ped name = John But why he isn't moving?