Jump to content

Jacob Lenn

Members
  • Posts

    69
  • Joined

  • Last visited

Everything posted by Jacob Lenn

  1. I don't understand you at all. getBoundKeys ('player_left') Sth like dat doesn't exist. You can use this getBoundKeys ("left")
  2. U mean random spawn? local n = math.random(1,2) if n == 1 then spawnPlayer ( thePlayer, 2005,1545,14, 90.0, skin ) else spawnPlayer ( thePlayer, -1495,921,8, 90.0, skin2 ) end I can be wrong, but it should work.
  3. Hmmm, better idea is to do in dat way: function createAdminList() adminlist = { } supermodlist = { } modlist = { } for k, v in ipairs(getElementsByType("player")) do if not isGuestAccount(getPlayerAccount(v)) then if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin")) then table.insert(adminlist, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("SuperModerator")) then table.insert(supermodlist, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Moderator")) then table.insert(modlist, v) end end end return adminlist, supermodlist, modlist end function AdminList(sourcePlayer) local admins, supmods, mods = createAdminList() if #admins == 0 then outputConsole("#ff6600[iNFO]#00ff00 Online Admin yok!", sourcePlayer,false ) else for k, v in ipairs(admins) do outputChatBox("Admin : " .. getPlayerName(v), getRootElement (), 16, 160, 17, false) end end if #supmods == 0 then outputConsole("#ff6600[iNFO]#00ff00 Online SuperModerator yok!", sourcePlayer,false ) else for k, v in ipairs(supmods) do outputChatBox("SuperModerator : " .. getPlayerName(v), getRootElement (), 16, 160, 17, false) end end if #mods == 0 then outputConsole("#ff6600[iNFO]#00ff00 Online Moderator yok!", sourcePlayer,false ) else for k, v in ipairs(mods) do outputChatBox("Moderator : " .. getPlayerName(v), getRootElement (), 16, 160, 17, false) end end end addEventHandler("onPlayerChat", root, function (msg, msgType) if msgType == 0 then if msg == "!admins" then AdminList(source) end end end )
  4. If so, u have to use code which i gave u before.
  5. addEventHandler("onPlayerChat", root, function (msg, msgType) if msgType == 0 then if msg == "!admins" then --do sth end end end ) Did you mean sth like this?
  6. Thanks for all. If i have any problems i'll write about them here.
  7. Okey thanks, and what about setting data to da object?
  8. I mean dat i know how to trigger, but do i have to use only trigger in the getting items loop from sql or sth else?
  9. Hello guys, it's me again. I'm writing item system and i dunno how can i write 1 thing. I'm saving items by using sqlite. And here i my question, how can i move all items from server to client and put them to the scrollpane? I know about triggering but i don't have idea how to do this. And 1 more, can i set some data on object?
  10. It shows that it is adding both of us. This is strange, really . @EDIT: Problem resolved, thanks for all. if v~=source then And 2 functions for 2 events.
  11. It shows that i left the server.
  12. On mine when he is leaveing and on his when i am leaving the server.
  13. I tested it with my friend and this script added him to da list, but didn't remove. I'll show code 1 more: x,y = guiGetScreenSize() window = guiCreateWindow((x-200)/2, (y-400)/2, 200, 400, "Player List", false) scrollpane = guiCreateScrollPane(0, 20, 200, 400, false, window) addEventHandler("onClientResourceStart", root, function () for k,v in ipairs(getElementsByType("player")) do guiCreateLabel(0, k*15, 200, 15, tostring(getPlayerName(v)), false, scrollpane) end end ) function clear () for k,v in ipairs(getElementChildren(scrollpane)) do destroyElement(v) end for k,v in ipairs(getElementsByType("player")) do guiCreateLabel(0, k*15, 200, 15, tostring(getPlayerName(v)), false, scrollpane) end end addEventHandler("onClientPlayerJoin", root, clear) addEventHandler("onClientPlayerQuit", root, clear) addEventHandler("onClientPlayerChangeNick", root, clear)
  14. Thank you, bro. You are best.
  15. x,y = guiGetScreenSize() window = guiCreateWindow((x-200)/2, (y-400)/2, 200, 400, "Player List", false) guiSetVisible(window, false) scrollpane = guiCreateScrollPane(0, 0, 200, 400, false, window) addCommandHandler("show", function () guiSetVisible(window, true) end ) addEventHandler("onClientResourceStart", root, function () for k,v in ipairs(getElementsByType("player")) do guiCreateLabel(0, k*15, 90, 15, tostring(getPlayerName(v)), false, scrollpane) end end ) function clear () for k,v in ipairs(getElementChildren(scrollpane)) do destroyElement(v) end for k,v in ipairs(getElementsByType("player")) do guiCreateLabel(0, k*15, 90, 15, tostring(getPlayerName(v)), false, scrollpane) end end addEventHandler("onClientPlayerJoin", root, clear) addEventHandler("onClientPlayerQuit", root, clear) addEventHandler("onClientPlayerChangeNick", root, clear) I wrote sth, but it isn't showing players and scrollpane. No errors in debug.
  16. Hello guys! I want to write player list based on guiCreateLabel. This has to add players on connect and delete players on disconnect. I'm writing to you with this, becouse i don't have any idea how to do this. Maybe table? Dunno. Thanks for all .
×
×
  • Create New...