Jump to content

TheGamingMann

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by TheGamingMann

  1. I don't usually like bumping things but I would really like to know if this is possible.
  2. I have a custom login in message and login panel. Could you help me disable or silence the "ACL: You have logged in" message please. Thank you. Here is my code. c_login.lua: function createRegister() local screenW, screenH = guiGetScreenSize() wdwAccount = guiCreateWindow((screenW - 378) / 2, (screenH - 109) / 2, 378, 109, "", false) guiWindowSetSizable(wdwAccount, false) lblPassword = guiCreateLabel(10, 37, 102, 15, "Enter a Password", false, wdwAccount) guiSetFont(lblPassword, "default-bold-small") edtInfo = guiCreateEdit(127, 33, 240, 24, "", false, wdwAccount) guiEditSetMasked(edtInfo, true) btnSubmit = guiCreateButton(112, 67, 153, 30, "Submit", false, wdwAccount) addEventHandler("onClientGUIClick", btnSubmit, accRequest, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() createRegister() guiSetVisible(wdwAccount, false) showRegister() end ) function showRegister() if not guiGetVisible(wdwAccount) then guiSetVisible(wdwAccount, true) showCursor(true, true) end end function hideRegister() guiSetVisible(wdwAccount, false) showCursor(false, false) triggerEvent("showSpawnWindow", localPlayer) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", localPlayer, hideRegister) function accRequest() local password = guiGetText(edtInfo) triggerServerEvent("accLogReg", localPlayer, password) end s_login.lua: function loginHandler(password) local account = getAccount(getPlayerName(source), password) if (account ~= false) then logIn(source, account, password) outputChatBox("Welcome back "..getPlayerName(source)..".", source, 102, 40, 2) triggerClientEvent("hideLoginWindow", source) else if (password ~= "" and password ~= nil) then local accountAdded = addAccount(getPlayerName(source), password) if (accountAdded) then outputChatBox("Thank you for registering "..getPlayerName(source)..".", source, 102, 40, 2) outputChatBox("If you click 'Submit' again you can login.", source, 102, 40, 2) end end end end addEvent("accLogReg", true) addEventHandler("accLogReg", root, loginHandler) Thanks in advanced for any help guys. Also sorry if I am a bit "Annoying". -Fixed
  3. Thanks TAPL, I am not quite sure where the error was because I did try putting the skin variable in that function but it didn't seem to work. Thanks again. It works very well.
  4. So I have this code I am working on. I am trying to get the players old skin and pass it trough so they respawn with it. So far I have it so it gets the skin but it takes the one before the player chooses what he/she wants. Here is my c_spawnlist.lua: local player = getLocalPlayer() local skin = getElementModel(player) function createSpawnList() local sW, sH = guiGetScreenSize() wdwList = guiCreateWindow((sW-830)/2, (sH-538)/2, 830, 538, "Spawn List", false) guiWindowSetSizable(wdwList, false) guiWindowSetMovable(wdwList, false) glistMainList = guiCreateGridList((830-711)/2, (538-441)/2, 711, 441, false, wdwList) guiGridListAddColumn(glistMainList, "Spawn Points", 0.9) btnSpawn = guiCreateButton((830-264)/2, (538-35), 264, 35, "Spawn", false, wdwList) addEventHandler("onClientGUIClick", btnSpawn, spawnHandler, false) makeList() end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() createSpawnList() guiSetVisible(wdwList, false) showWindow() end ) function showWindow() if not guiGetVisible(wdwList) then guiSetVisible(wdwList, true) showCursor(true, true) end end addEvent("showWindow", true) addEventHandler("showWindow", player, showWindow) function hideSpawnList() guiSetVisible(wdwList, false) showCursor(false, false) end addEvent("hideWindow", true) addEventHandler("hideWindow", player, hideSpawnList) function makeList() local file = xmlLoadFile("spawnpoints.xml") if file then for _, spawns in ipairs (xmlNodeGetChildren(file)) do local row = guiGridListAddRow(glistMainList) local name = xmlNodeGetAttribute(spawns, "name") local x = xmlNodeGetAttribute(spawns, "x") local y = xmlNodeGetAttribute(spawns, "y") local z = xmlNodeGetAttribute(spawns, "z") local rot = xmlNodeGetAttribute(spawns, "rot") guiGridListSetItemText(glistMainList, row, 1, name, false, false) guiGridListSetItemData(glistMainList, row, 1, {x, y, z, rot}) end xmlUnloadFile(file) end end function spawnHandler(button, state) if button == "left" and state == "up" then local row, col = guiGridListGetSelectedItem(glistMainList) local data = guiGridListGetItemData(glistMainList, row, col) if row and col and row ~= -1 and col ~=-1 then local x, y, z, rot = unpack(data) triggerServerEvent("spawnPlayer", player, x, y, z, rot, skin, player) end end end addCommandHandler("respawn", showWindow) Here is my s_spawnlist: function startSpawn(x, y, z, rot, skin, player) spawnPlayer(player, x, y, z, rot, skin) fadeCamera(player, true) setCameraTarget(player) triggerClientEvent("hideWindow", player) outputChatBox("If you wish to change your skin use /skin", player, 255, 0, 0) end addEvent("spawnPlayer", true) addEventHandler("spawnPlayer", getRootElement(), startSpawn) addEventHandler( "onPlayerWasted", getRootElement(), function() triggerClientEvent("showWindow", source) end ) Thanks for any help in advanced. -Fixed
×
×
  • Create New...