kkevihg009 Posted July 17, 2023 Share Posted July 17, 2023 local screenX, screenY = guiGetScreenSize() function optionsWindow() painelVip = guiCreateWindow(0.41, 0.31, 0.18, 0.28, "VIP LT", true) guiWindowSetSizable(painelVip, false) guiSetProperty(painelVip, "FFFFC600") gridVip = guiCreateGridList(0.03, 0.08, 0.95, 0.67, true, painelVip) guiGridListAddColumn(gridVip, "Type", 0.9) for i = 1, 6 do guiGridListAddRow(gridVip) end guiGridListSetItemText(gridVip, 0, 1, "Default Skin", false, false) guiGridListSetItemText(gridVip, 1, 1, "Skin VIP (1)", false, false) guiGridListSetItemText(gridVip, 2, 1, "Skin VIP (2)", false, false) guiGridListSetItemText(gridVip, 3, 1, "Skin VIP (3)", false, false) guiGridListSetItemText(gridVip, 4, 1, "Skin VIP (4)", false, false) guiGridListSetItemText(gridVip, 5, 1, "Skin VIP (5)", false, false) selectBotao = guiCreateButton(0.03, 0.78, 0.94, 0.19, "Select", true, painelVip) guiSetVisible(painelVip, false) addEventHandler("onClientGUIClick", selectBotao, obtemSelecionado, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), optionsWindow) function obtemSelecionado() opcao = guiGridListGetItemText ( gridVip, guiGridListGetSelectedItem ( gridVip ), 1 ) jogador = getLocalPlayer() jogadorNick = getPlayerName(getLocalPlayer()) if tostring(opcao) == "Default Skin" then triggerServerEvent( "skinPadrao", getRootElement(), jogadorNick ) elseif tostring(opcao) == "Skin VIP (1)" then triggerServerEvent( "skinModificada", getRootElement(), jogadorNick, "skin1" ) elseif tostring(opcao) == "Skin VIP (2)" then triggerServerEvent( "skinModificada", getRootElement(), jogadorNick, "skin2" ) elseif tostring(opcao) == "Skin VIP (3)" then triggerServerEvent( "skinModificada", getRootElement(), jogadorNick, "skin3" ) elseif tostring(opcao) == "Skin VIP (4)" then triggerServerEvent( "skinModificada", getRootElement(), jogadorNick, "skin4" ) elseif tostring(opcao) == "Skin VIP (5)" then triggerServerEvent( "skinModificada", getRootElement(), jogadorNick, "skin5" ) elseif tostring(opcao) == "Skin VIP (6)" then triggerServerEvent( "skinModificada", getRootElement(), jogadorNick, "skin6" ) end --setPlayerSkin(getLocalPlayer(), 280) end function fechar() if(guiGetVisible(painelVip))then guiSetVisible(painelVip, false) showCursor(false) else guiSetVisible(painelVip, true) showCursor(true) end end addCommandHandler("sounds", fechar) bindKey ( "F7", "down", fechar ) function definirSkinPadrao(jogadorNick) conta = getPlayerFromName(jogadorNick) local acc = getPlayerAccount ( conta ) local accName = getAccountName (acc) --iprint(setAccountData(getPlayerAccount(conta), "skinPadrao", "sim")) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then setPlayerSkin ( getPlayerFromName(jogadorNick), 0 ) setElementData ( conta, "skinPadrao", "sim" ) end end addEvent ( "skinPadrao", true ) addEventHandler( "skinPadrao", getRootElement(), definirSkinPadrao ) function definirSkinModificada(jogadorNick, skinQual) --iprint(skinQual) conta = getPlayerFromName(jogadorNick) --iprint(setAccountData(getPlayerAccount(conta), "skinPadrao", "nao")) local acc = getPlayerAccount ( conta ) local accName = getAccountName (acc) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then setElementData ( conta, "skinPadrao", "nao" ) if tostring(skinQual) == "skin1" then setPlayerSkin ( getPlayerFromName(jogadorNick), 2 ) setElementData ( conta, "skinVip", 2 ) elseif tostring(skinQual) == "skin2" then setPlayerSkin ( getPlayerFromName(jogadorNick), 137) setElementData ( conta, "skinVip", 137 ) elseif tostring(skinQual) == "skin3" then setPlayerSkin ( getPlayerFromName(jogadorNick), 29 ) setElementData ( conta, "skinVip", 29 ) elseif tostring(skinQual) == "skin4" then setPlayerSkin ( getPlayerFromName(jogadorNick), 11 ) setElementData ( conta, "skinVip", 11 ) elseif tostring(skinQual) == "skin5" then setPlayerSkin ( getPlayerFromName(jogadorNick), 167 ) setElementData ( conta, "skinVip", 167 ) end end end addEvent ( "skinModificada", true ) addEventHandler( "skinModificada", getRootElement(), definirSkinModificada ) alguem me ajuda eu queria que alguem fizesse esse script abrir so por quem estar na acl "VIP" por que ele pode ser aberto por qualquer um ai queria so isso pfvr alguem? Link to comment
Moderators Vinyard Posted July 17, 2023 Moderators Share Posted July 17, 2023 Hi, welcome to the forums! Your topic has been moved to the Portuguese scripting section so you can get better assistance in your native language. Make sure to always use English when posting outside this language-specific section! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now