-
Posts
1,546 -
Joined
-
Last visited
Everything posted by Dimos7
-
I want change the background color of gui window and button its possible?
-
blackLoginScreen = false enableKickPlayer = true disallowLogout = false removeBlackScreenTime = 4 maxLoginAttempts = 5 local localPlayer = getLocalPlayer() local playerName = getPlayerName(localPlayer) function createRegisterWindow() GUIEditor_Button = {} windowr = guiCreateWindow(423, 219, 307, 272, " Register Panel", false) guiSetAlpha(windowr, 1) guiWindowSetMovable(windowr, false) guiWindowSetSizable(windowr, false) usernamer = guiCreateEdit(45, 23, 251, 32, "", false, windowr) guiSetAlpha(usernamer, 1) guiEditSetMaxLength(usernamer,20) usericon = guiCreateStaticImage(13, 23, 32, 32, "images/user77.png", false, windowr) guiSetAlpha(usericon, 1) passwordr = guiCreateEdit(45, 72, 251, 32, "", false, windowr) guiEditSetMasked(passwordr, true) guiEditSetMaxLength(passwordr, 30) guiSetAlpha(passwordr, 1) passicon = guiCreateStaticImage(13, 72, 32, 32, "images/closed.png", false, windowr) guiSetAlpha(passicon, 1) cpassword = guiCreateEdit(45, 120, 251, 32, "", false, windowr) guiEditSetMasked(cpassword, true) guiEditSetMaxLength(cpassword, 30) guiSetAlpha(cpassword, 1) guiSetAlpha(cpasswordicon, 1) cpassicon = guiCreateStaticImage(13, 120, 32, 32, "images/closed.png", false, windowr) guiSetAlpha(cpassicon, 1) GUIEditor_Button[1] = guiCreateButton(66, 169, 172, 40, "Register", false, windowr) guiSetAlpha(GUIEditor_Button[1], 1) addEventHandler("onClientGUIClick", GUIEditor_Button[1], onClientSubmitRegister) Web = guiCreateLabel(87, 247, 151, 20, "www.xtreme-player.net", false, windowr) guiSetAlpha(Web, 1) guiLabelSetVerticalAlign(Web, "top") guiLabelSetHorizontalAlign(Web, "left") guiLabelSetColor(Web, 0, 0, 0) guiSetVisible(windowr, false) end function createLoginWindow() GUIEditor_Button = {} window = guiCreateWindow(423, 219, 307, 272, "Login Panel", false) guiSetAlpha(window, 1) guiWindowSetMovable(window, false) guiWindowSetSizable(window, false) username = guiCreateEdit(45, 23, 251, 32, "", false, window) guiSetAlpha(username, 1) guiEditSetMaxLength(username, 20) usericon = guiCreateStaticImage(13, 23, 32, 32, "images/user77.png", false, window) guiSetAlpha(usericon, 1) password = guiCreateEdit(45, 72, 251, 32, "", false, window) guiSetAlpha(password, 1) guiEditSetMasked(password, true) guiEditSetMaxLength(password, 30) passicon = guiCreateStaticImage(13, 72, 32, 32, "images/closed.png", false, window) guiSetAlpha(passicon, 1) GUIEditor_Button[1] = guiCreateButton(66, 130, 172, 40, "Login", false, window) guiSetAlpha(GUIEditor_Button[1], 1) GUIEditor_Button[2] = guiCreateButton(66, 185, 84, 33, "Guest", false, window) guiSetAlpha(GUIEditor_Button[2], 1) GUIEditor_Button[3] = guiCreateButton(159, 185, 84, 33, "Register", false, window) guiSetAlpha(GUIEditor_Button[3], 1) Web = guiCreateLabel(87, 247, 151, 20, "www.xtreme-player.net", false, window) guiSetAlpha(Web, 1) guiLabelSetVerticalAlign(Web, "top") guiLabelSetHorizontalAlign(Web, "left") guiLabelSetColor(Web, 0, 0, 0) Settings = guiCreateStaticImage(265, 232, 32, 32, "images/settings.png", false, window) guiSetAlpha(Settings, 1) windows = guiCreateWindow(418, 503, 316, 158, "", false) guiSetAlpha(windows, 0) guiWindowSetMovable(windows, false) guiWindowSetSizable(windows, false) guiSetVisible(windows, false) RU = guiCreateStaticImage(9, 26, 80, 30, "images/switch-off.png", false, windows) guiSetAlpha(RU, 0) RP = guiCreateStaticImage(9, 67, 80, 30, "images/switch-off.png", false, windows) guiSetAlpha(RP, 0) SP = guiCreateStaticImage(9, 107, 80, 30, "images/switch-off.png", false, windows) guiSetAlpha(SP, 0) RU_l= guiCreateLabel(98, 31, 161, 22, "Remember my username", false, windows) guiSetAlpha(RU_l, 0) guiLabelSetVerticalAlign(RU_l, "top") guiLabelSetHorizontalAlign(RU_l, "left") guiLabelSetColor(RU_l, 0, 0, 0) RP_l = guiCreateLabel(98, 73, 161, 22, "Remember my password", false, windows) guiSetAlpha(RP_l, 0) guiLabelSetVerticalAlign(RP_l, "top") guiLabelSetHorizontalAlign(RP_l, "left") guiLabelSetColor(RP_l, 0, 0, 0) SP_l = guiCreateLabel(98, 111, 161, 22, "Show password", false, windows) guiSetAlpha(SP_l, 0) guiLabelSetVerticalAlign(SP_l, "top") guiLabelSetHorizontalAlign(SP_l, "left") guiLabelSetColor(SP_l, 0, 0, 0) addEventHandler("onClientGUIClick", GUIEditor_Button[1], onClientSubmitLogin) addEventHandler("onClientGUIClick", GUIEditor_Button[2], onClickGuest) addEventHandler("onClientGUIClick", GUIEditor_Button[3], showRegister) addEventHandler("onClientClick", Settings, onSetting) addEventHandler("onClientClick", RU, onSetting) addEventHandler("onClientClick", RP, onSetting) addEventHandler("onClientClick", SP, onSetting) end function onClickGuest(button, state) if(button == "left" and state =="up") then if (source == GUIEditor_Button[2]) then guiSetVisible(window, false) guiSetInputEnabled(false) showCursor(false) end end end function resourceStart() createLoginWindow() if (window ~= nil) then guiSetVisible(window, true) else outputChatBox("An error has occurred") end guiSetInputEnabled(true) showCursor(true) end function showRegister() createRegisterWindow() guiSetVisible(windowr, true) guiSetInputEnabled(true) showCursor(true) end function onClientSubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(username) local password = guiGetText(password) if username and password then triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password) Success = guiCreateStaticImage(302, 10, 664, 55 , "images/success.png", false) guiSetAlpha(Success, 1) Errorl = guiCreateLabel(102, 22, 244, 27, "", false, Success) guiSetAlpha(Errorl, 1) guiLabelSetVerticalAlign(Errorl, "top") guiLabelSetHorizontalAlign(Errorl, "left") guiSetText(Errorl, "You successfully logged in.") guiSetAlpha(Warning, 0) guiSetAlpha(Error, 0) guiSetAlpha(Information, 0) else guiSetAlpha(Success, 0) guiSetAlpha(Error, 0) guiSetAlpha(Information, 0) Warning = guiCreateStaticImage(302, 10, 664, 55 , "images/warning.png", false) Errorl = guiCreateLabel(102, 22, 244, 27, "", false, Warning) guiSetAlpha(Errorl, 1) guiLabelSetVerticalAlign(Errorl, "top") guiLabelSetHorizontalAlign(Errorl, "left") guiSetAlpha(Warning, 1) guiSetText(Errorl, "Enter username and password.") end end end function onClientSubmitRegister(button, state) if button == "left" and state == "up" then local username = guiGetText(usernamer) local password = guiGetText(passwordr) local cpassword = guiGetText(cpassword) if username and password and cpassword then triggerServerEvent("submitRegister", getRootElement(), localPlayer, username, password, cpassword) Success = guiCreateStaticImage(302, 10, 664, 55 , "images/success.png", false) guiSetAlpha(Success, 1) Errorl = guiCreateLabel(102, 22, 244, 27, "", false, Success) guiSetAlpha(Errorl, 1) guiLabelSetVerticalAlign(Errorl, "top") guiLabelSetHorizontalAlign(Errorl, "left") guiSetText(Errorl, "You successfully registered.") guiSetAlpha(Warning, 0) guiSetAlpha(Information, 0) guiSetAlpha(Error, 0) else guiSetAlpha(Success, 0) guiSetAlpha(Error, 0) guiSetAlpha(Information, 0) Warning = guiCreateStaticImage(302, 10, 664, 55 , "images/warning.png", false) Errorl = guiCreateLabel(102, 22, 244, 27, "", false, Warning) guiSetAlpha(Errorl, 1) guiLabelSetVerticalAlign(Errorl, "top") guiLabelSetHorizontalAlign(Errorl, "left") guiSetAlpha(Warning, 1) guiSetText(Errorl, "Enter username and password.") end resourceStart() end end function onSetting(state) if (source == Settings) and state == "up" then guiSetVisible(windows, true) guiSetAlpha(RP, 1) guiSetAlpha(RP_l, 1) guiSetAlpha(windows, 1) guiSetAlpha(SP, 1) guiSetAlpha(SP_l, 1) guiSetAlpha(RU, 1) guiSetAlpha(RU_l, 1) local username = guiGetText(username) local password = guiGetText(password) if (source == RU) and state == "up" then RU = guiCreateStaticImage(9, 26, 80, 30, "images/switch-on", false, windows) Information = guiCreateStaticImage(302, 10, 664, 55, "images/information.png", false) Errorl = guiCreateLabel(102, 22, 244, 27, "", false, Information) guiSetAlpha(Errorl, 1) guiLabelSetVerticalAlign(Errorl, "top") guiLabelSetHorizontalAlign(Errorl, "left") guiSetAlpha(Success, 0) guiSetAlpha(Error, 0) guiSetAlpha(Warning, 0) guiSetAlpha(Information, 1) guiSetText(Errorl, "Your username is now saved.") guiSetText(username, username) elseif (source == RP) and state == "up" then RU = guiCreateStaticImage(9, 26, 80, 30, "images/switch-off", false, windows) Information = guiCreateStaticImage(302, 10, 664, 55, "images/information.png", false) Errorl = guiCreateLabel(102, 22, 244, 27, "", false, Information) guiSetAlpha(Errorl, 1) guiLabelSetVerticalAlign(Errorl, "top") guiLabelSetHorizontalAlign(Errorl, "left") guiSetAlpha(Success, 0) guiSetAlpha(Error, 0) guiSetAlpha(Warning, 0) guiSetAlpha(Information, 1) guiSetText(Errorl, "Your username is now unsaved.") elseif (source == RP) and state == "up" then RP = guiCreateStaticImage(9, 67, 80, 30, "images/switch-on", false, windows) Information = guiCreateStaticImage(302, 10, 664, 55, "images/information.png", false) Errorl = guiCreateLabel(102, 22, 244, 27, "", false, Information) guiSetAlpha(Errorl, 1) guiLabelSetVerticalAlign(Errorl, "top") guiLabelSetHorizontalAlign(Errorl, "left") guiSetAlpha(Success, 0) guiSetAlpha(Error, 0) guiSetAlpha(Warning, 0) guiSetAlpha(Information, 1) guiSetText(Errorl, "Your password is now saved.")
-
Can change a button color if yes how? also i forget how get a area name
-
I want remove the dafault message from login and register
-
function passwordHandler(player, oldpassword, newpassword) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("You must be logged in to change password.", player, 255, 0, 0) return end local playerName = getPlayerName(player) local password_check = getAccount(playerName, olpassword) if (password_check ~= false) then if (string.len(newpassword) >= 5) then setAccountPassword(account, newpassword) triggerClientEvent(player, "hidePasswordWindow", getRootElement()) else outputChatBox("Your new password must be at least 5 characters.", player, 255, 0, 0) end else outputChatBox("Old password invalid.", player, 255, 0, 0) end end end function loginHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(player, account, password) == true) then outputChatBox("Login:you successfully logged in.", player, 0, 255, 0) triggerClientEvent(player, "hideLoginWindow", getRootElement()) cancelEvent() else outputChatBox("Please report it on forum", player) end else outputChatBox("Username or password is invalid.", player, 255, 0, 0) end end function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox("Username is already in used.", player, 255, 0, 0) else account = addAccount(username, password) cancelEvent() outputChatBox("Register:you successfully register"..getPlayerAccount(player)..password..".",player, 0, 255, 0) if (logIn(player, account, password) == true) then triggerClientEvent(player, "hideLoginWindow", getRootElement()) cancelEvent() else outputChatBox("Please report it on forum", player) end end end addEvent("submitChangepw", true) addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitChangepw", getRootElement(), passwordHandler) addEventHandler("submitLogin", getRootElement(), loginHandler) addEventHandler("submitRegister", getRootElement(), registerHandler) no work why? guy i have put cancelEvent() for remove the message i take from login and register and still take it why?
-
Client Side: blackLoginScreen = true enableKick = true disallowLogout = false removeBlackScrenTime = 4 maxLoginAttempts = 5 local localPlayer = getLocalPlayer() local playerName = getPlayerName(localPlayer) function createPasswordWindow() GUIEditor_Button = {} windowpw = guiCreateWindow(254, 137, 303, 307, "Change Password", false) guiSetAlpha(windowpw, 1) guiWindowSetSizable(windowpw, false) guiWindowSetMovable(windowpw, false) username_lpw = guiCreateLabel (7, 75, 289, 24, " Old Password:", false, windowpw) guiSetAlpha(username_lpw, 1) guiLabelSetVerticalAlign(username_lpw, "top") guiLabelSetHorizontalAlign(username_lpw, "left") usernamepw = guiCreateEdit(9, 100, 285, 25, "", false, windowpw) guiSetAlpha(usernamepw, 1) guiEditSetMasked(usernamepw, true) guiEditSetMaxLength(usernamepw, 30) password_lpw = guiCreateLabel(7, 140, 289, 24, " New Password:", false, windowpw) guiSetAlpha(password_lpw, 1) guiLabelSetVerticalAlign(password_lpw, "top") guiLabelSetHorizontalAlign(password_lpw, "left") passwordpw = guiCreateEdit(9, 168, 285, 25, "", false, windowpw) guiSetAlpha(passwordpw, 1) guiEditSetMasked(passwordpw, true) guiEditSetMaxLength(passwordpw, 30) GUIEditor_Button[1] = guiCreateButton(153, 245, 135, 53, "Okey", false, windowpw) guiSetAlpha(GUIEditor_Button[1], 1) guiSetVisible(windowpw, false) addEventHandler("onClientGUIClick", GUIEditor_Button[1], onClientSubmitChangepw, false) end function createLoginWindow() GUIEditor_Button = {} window = guiCreateWindow(254, 137, 303, 307, "Login Panel", false) guiSetAlpha(window, 1) guiWindowSetMovable(window, false) guiWindowSetSizable(window, false) username_l = guiCreateLabel(7, 75, 289, 24, " Username:", false, window) guiSetAlpha(username_l, 1) guiLabelSetVerticalAlign(username_l, "top") guiLabelSetHorizontalAlign(username_l, "left") username = guiCreateEdit(9, 100, 285, 25, "", false, window) guiSetAlpha(username, 1) password_l = guiCreateLabel(7, 140, 289, 24, " Password:", false, window) guiSetAlpha(password_l, 1) guiLabelSetVerticalAlign(password_l, "top") guiLabelSetHorizontalAlign(password_l, "left") password = guiCreateEdit(9, 168, 285, 25, "", false, window) guiSetAlpha(password, 1) guiEditSetMasked(password, true) guiEditSetMaxLength(password, 30) GUIEditor_Button[1] = guiCreateButton(9, 245, 143, 53, "Login", false, window) guiSetAlpha(GUIEditor_Button[1], 1) GUIEditor_Button[2] = guiCreateButton(153, 245, 143, 53, "Register", false, window) guiSetAlpha(GUIEditor_Button[2], 1) addEventHandler("onClientGUIClick", GUIEditor_Button[1], onClientSubmitLogin) addEventHandler("onClientGUIClick", GUIEditor_Button[2], onClientSubmitRegister) end function resourceStart() createLoginWindow() if (window ~= nil) then guiSetVisible(window, true) else outputChatBox("An error has occurred.") end showCursor(true) guiSetInputEnabled(true) end function changePw() createPasswordWindow() guiSetVisible(windowpw, true) showCursor(true) guiSetInputEnabled(true) end function onClientSubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(username) local password = guiGetText(password) if username and password then triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password) else guiSetText(labelInfo, "Enter username and password.") end end end function onClientSubmitRegister(button, state) if button == "left" and state == "up" then local username = guiGetText(username) local password = guiGetText(password) if username and password then triggerServerEvent("submitRegister", getRootElement(), localPlayer, username, password) else guiSetText(labelInfo, "Enter username and password.") end end end function onClientSubmitChangepw(button, state) if button == "left" and state == "up" then local username = guiGetText(usernamepw) local password = guiGetText(passwordpw) if username and password then triggerServerEvent("submitChangepw", getRootElement(), localPlayer, username, password) else outputChatBox("Enter old and new password.") end end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(window, false) showCursor(false) end function hidePasswordWindow() guiSetInputEnabled(false) guiSetVisible(windowpw, false) showCursor(false) end addEvent("hidePasswordWindow", true) addEvent("hideLoginWindow", true) addEventHandler("hidePasswordWindow", getRootElement(), hidePasswordWindow) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), resourceStart) addCommandHandler("changepass", changePw) Server Side: function passwordHandler(player, oldpassword, newpassword) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("You must be logged in to change password.", player, 255, 0, 0) return end local playerName = getPlayerName(player) local password_check = getAccount(playerName, olpassword) if (password_check ~= false) then if (string.len(newpassword) >= 5) then setAccountPassword(account, newpassword) triggerClientEvent(player, "hidePasswordWindow", getRootElement()) else outputChatBox("Your new password must be at least 5 characters.", player, 255, 0, 0) end else outputChatBox("Old password invalid.", player, 255, 0, 0) end end end function loginHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(player, account, password) == true) then outputChatBox("You successfully logged in.", player, 0, 255, 0) triggerClientEvent(player, "hideLoginWindow", getRootElement()) cancelEvent() else outputChatBox("Please report it on forum", player) end else outputChatBox("Username or password is invalid.", player, 255, 0, 0) end end function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox("Username is already in used.", player, 255, 0, 0) else account = addAccount(username, password) cancelEvent() outputChatBox("You successfully register"..getPlayerAccount(player)..password..".",player, 0, 255, 0) if (logIn(player, account, password) == true) then triggerClientEvent(player, "hideLoginWindow", getRootElement()) cancelEvent() else outputChatBox("Please report it on forum", player) end end end addEvent("submitChangepw", true) addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitChangepw", getRootElement(), passwordHandler) addEventHandler("submitLogin", getRootElement(), loginHandler) addEventHandler("submitRegister", getRootElement(), registerHandler) no work why?
-
local optimize = true local ids = {} function assignID() for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id", i, not optimize) break end end end addEventHandler("onPlayerJoin", root, assignID) function startup() for k, v in ipairs(getElementsByType("player")) do local id = getElementData(v,"id") if id then ids[id] = v end end end addEventHandler("onResourceStart", resourceRoot, startup) function getPlayerID(player) for k, v in ipairs(ids) do if v == player then return k end end end function freeID() local id = getElementData(source, "id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit", root, freeID) function getPlayerByID(id) local player = ids[id] return player or false end function showIDs (option) if option == false then gameShowIDs = false exports["Scoreboard"]:scoreboardRemoveColum("id") else gameShowIDs = true exports["Scoreboard"]:scoreboardAddColumn("id", function() return getPlayerID(player) end, 20, "ID", 1) end end addEventHandler("onResourceStart", resourceRoot, showIDs) still no show the id number
-
still the same and localplayer is for client no server aslo say a nill value
-
can help me with it now aprear the number of id also i want put it before name
-
viewforum.php?f=177 make a post there here is for help you with a code no make you code
-
script was full but anway i fix it
-
error line 75 then excpeted near "="
-
local optimize = true local ids = {} function assignID() for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id", i, not optimize) break end end end addEventHandler("onPlayerJoin", root, assignID) function startup() for k, v in ipairs(getElementsByType("player")) do local id = getElementData(v,"id") if id then ids[id] = v end end end addEventHandler("onResourceStart", resourceRoot, startup) function getPlayerID(player) for k, v in ipairs(ids) do if v == player then return k end end end function freeID() local id = getElementData(source, "id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit", root, freeID) function getPlayerByID(id) local player = ids[id] return player or false end function showIDs (option) if option == false then gameShowIDs = false call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "ID") else gameShowIDs = true call(getResourceFromName("scoreboard"), "addScoreboardColumn", "ID") end end addEventHandler("onResourceStart", resourceRoot, showIDs)
-
addEventHandler("onPlayerLogin", getRootElement(), function() bindKey(source, "x", "down","chatbox", "global") end) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do if isGuestAccount(getPlayerAccount(player)) then outputChatBox("You must be login to speak in chat!", player, 255, 0, 0) else bindKey(player, "x", "down", "chatbox", "global") end end end) function onChat(player, ...) local name = getPlayerName(player) local message = table.concat({...}," ") local team = getPlayerTeam(player) local r,g,b if team then r,g,b = getTeamColor(team) end if not r then r,g,b = getPlayerNametagColor(player) end local hexColor = string.format("#%.2X%.2X%.2X", r, g, b) outputChatBox(hexColor..""..name..":".."#FFFFFF"..message, player, 220, 220, 220, true) end addCommandHandler("global", onChat) http://imgur.com/UJnVleB can tell me how to remove the global from chat?
-
function RGBToHex(red,green, blue, alpha) if ((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alhpa and (alhpa < 0 or alpha > 255 ))) then return nil end if (alpha) then return string.format("#%.2X%.2X%.2X%.2X", red, green, blue, alpha) else return string.format("#%.2X%.2X%.2X", red, green, blue) end end addEventHandler("onPlayerLogin", getRootElement(), function() bindKey(source, "x", "down", "genal","chatbox", "global") end) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do if isGuestAccount(getPlayerAccount(player)) then outputChatBox("You must be login to speak in chat!", player, 255, 0, 0) else bindKey(player, "x", "down", "genal", "chatbox", "global") end end end) function onChat(player, ...) local name = getPlayerName(player) local message = table.concat({...}," ") local r,g,b = getTeamColor(getPlayerTeam(player)) or 255, 255, 255 outputChatBox(RGBToHex(r,g,b)..""..name..":".."#FFFFFF"..message, player) end addCommandHandler("genal", onChat) now apperars #FFFFFF name : #FFFFFF genal chatbox http://imgur.com/mT8JDXH
-
function RGBToHex(red,green, blue, alpha) if ((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alhpa and (alhpa < 0 or alpha > 255 ))) then return nil end if (alpha) then return string.format("#%.2X%.2X%.2X%.2X", red, green, blue, alpha) else return string.format("#%.2X%.2X%.2X", red, green, blue) end end addEventHandler("onPlayerLogin", getRootElement(), function() bindKey(source, "x", "down", "genal","chatbox", "global") end) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do if isGuestAccount(getPlayerAccount(player)) then outputChatBox("You must be login to speak in chat!", player, 255, 0, 0) else bindKey(player, "x", "down", "genal", "chatbox", "global") end end end) function onChat(player, ...) local name = getPlayerName(player) local message = table.concat({...}," ") local r,g,b = getTeamColor(getPlayerTeam(player)) outputChatBox(RGBToHex(r,g,b)..""..name..":".."#FFFFFF"..message, player) bindKey(player, "x", "down") end addCommandHandler("genal", onChat) http://imgur.com/qO6jbIz
-
function RGBToHex(red,green, blue, alpha) if ((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alhpa and (alhpa < 0 or alpha > 255 ))) then return nil end if (alpha) then return string.format("#%.2X%.2X%.2X%.2X", red, green, blue, alpha) else return string.format("#%.2X%.2X%.2X", red, green, blue) end end addEventHandler("onPlayerLogin", getRootElement(), function() bindKey(source, "x", "down", "genal","chatbox", "global") end) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for index,player in pairs(getElementsByType("player")) do bindKey(player, "x", "down", "genal" ,"chatbox", "global") sourceAccount = getPlayerAccount(player) if isGuestAccount(sourceAccount) then outputChatBox("You must be login to speak in chat!", player, 255, 0, 0) end end end) function onChat(player, ...) local name = getPlayerName(player) local message = table.concat({...}," ") local r,g,b = getTeamColor outputChatBox(RGBToHex(r,g,b)..""..name..":".."#FFFFFF"..message, player) bindKey(player, "x", "down") end addCommandHandler("genal", onChat) http://imgur.com/hPnfWJy
-
what new function yours for draw a image?
-
dxDrawImageSection not exist another for images
-
addEventHandler("onPlayerLogin", getRootElement(), function() bindKey(source, "t", "down", "chatbox", "genel") if (account ~= false) then outputChatBox("You must login to speak in chat", player, 255, 0, 0) end end) addEventHandler("onResouceStart", getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player, "t", "down", "chatbox", "genel") end end) function onChat(player, _, ...) local message = table.concat( {...}, " ") local name = getPlayerName(player) local r,g,b = getTeamColor(getPlayerTeam(player)) outputChatBox("#FFFFFFSay:"r,g,b..name.."#FFFFFF"..message.., getRootElement(), true) end http://imgur.com/nwN3P4H
-
can give me a example please for client side
-
how can save the skin have before join the job?