Jump to content

Help gui


APCLegend

Recommended Posts

Hi everyone, i was doing a gui to buy tags but when i run the script the gui just appears instantly when i put it to open with a command, and then it does not dissapear if you don´t enter the command i have stop the resource and the functions doesn´t response 

 

here is the code

 


GUIEditor = {
    button = {},
    window = {}
}


 GUIEditor.window[1] =  guiCreateWindow(227, 127, 571, 514, "Panel de tags Apocalipsis Mundial", false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(17, 73, 155, 47, "【ИλŽÎ】", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(212, 73, 155, 47, "➳SparTan➹", false, GUIEditor.window[1])
        GUIEditor.button[3] = guiCreateButton(398, 73, 155, 47, "җΛҚĀTŠŨKÎҗ", false, GUIEditor.window[1])
        GUIEditor.button[4] = guiCreateButton(17, 181, 155, 47, "╚>SΛÏЎAJIŇ<╝", false, GUIEditor.window[1])
        GUIEditor.button[5] = guiCreateButton(212, 186, 155, 47, "Ω »GᴏᴅOғWᴀʀ« Ω", false, GUIEditor.window[1])
        GUIEditor.button[6] = guiCreateButton(398, 186, 155, 47, "[»Aᴘᴏᴄᴀʟɪᴘꜱɪꜱ«]", false, GUIEditor.window[1])
        GUIEditor.button[7] = guiCreateButton(17, 289, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[8] = guiCreateButton(212, 289, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[9] = guiCreateButton(398, 289, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[10] = guiCreateButton(17, 394, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[11] = guiCreateButton(212, 394, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[12] = guiCreateButton(398, 394, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[13] = guiCreateButton(50, 136, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[14] = guiCreateButton(241, 136, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[15] = guiCreateButton(424, 136, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[16] = guiCreateButton(50, 248, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[17] = guiCreateButton(50, 351, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[18] = guiCreateButton(244, 250, 91, 24, "Probar", false, GUIEditor.window[1])
        
        GUIEditor.label[1] = guiCreateLabel(50, 50, 92, 13, "$500,000", false, GUIEditor.window[1])
        GUIEditor.label[2] = guiCreateLabel(240, 47, 92, 13, "$600,000", false, GUIEditor.window[1])
        GUIEditor.label[3] = guiCreateLabel(438, 47, 92, 13, "$500,000", false, GUIEditor.window[1])
        GUIEditor.label[4] = guiCreateLabel(50, 163, 92, 13, "$600,000", false, GUIEditor.window[1])
        GUIEditor.label[5] = guiCreateLabel(244, 168, 92, 13, "$500,000", false, GUIEditor.window[1])
        GUIEditor.label[6] = guiCreateLabel(429, 166, 92, 13, "$200,000", false, GUIEditor.window[1])
guiSetVisible( GUIEditor.window[1], false )


function guiToggleVisible ( )  
     
        if ( guiGetVisible ( GUIEditor.window[1] ) == true ) then                
                guiSetVisible ( GUIEditor.window[1], false ) 
        else              
                guiSetVisible ( GUIEditor.window[1], true ) 
showCursor(GUIEditor.window[1], true)
        end
end


addCommandHandler ( "tags", guiToggleVisible )

function NAZI(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 500000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("GodOfWar"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("APC"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[1], NAZI )


function SPARTAN(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 600000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("GodOfWar"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("APC"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[2], SPARTAN )

function AKATSUKI(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 500000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("GodOfWar"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("APC"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[3], AKATSUKI )

function SAIYAYIN(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 600000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("GodOfWar"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("APC"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[4], SAIYAYIN )


function WAR(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 500000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("GodOfWar"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("APC"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[5], WAR )

function APC(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 200000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("APC"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("GodOfWar"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[6], APC )

function probar1(source)
outputChatBox("#101010【#660099ŇλŽĬ#101010】", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[13], probar1 )
---------
function probar2(source)
outputChatBox("#FFCC00➳#222222SᴘᴀʀTᴀɴ#FFCC00➹", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[14], probar2 )
--------
function probar3(source)
outputChatBox("#ff0000җ»#303030ΛҚĀTŠŬKÎ#ff0000«җ", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[15], probar3 )
----------
function probar4(source)
outputChatBox("#00ffff╚>#ffff00SΛÏЎAJIŇ#00ffff<╝", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[16], probar4 )
---------
function probar5(source)
outputChatBox("#550000Ω »#ffffffGᴏᴅOғWᴀʀ#550000« Ω", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[18], probar5 )
-----------
function probar6(source)
outputChatBox("#000000》»#00FFFFAᴘᴏᴄᴀ#00FF99ʟɪᴘꜱɪꜱ#000000«《", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[19], probar6 )

 

 

Edited by APCLegend
Link to comment
GUIEditor = {
    button = {},
    window = {}
}

 GUIEditor.window[1] =  guiCreateWindow(227, 127, 571, 514, "Panel de tags Apocalipsis Mundial",true)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(17, 73, 155, 47, "【ИλŽÎ】", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(212, 73, 155, 47, "➳SparTan➹", false, GUIEditor.window[1])
        GUIEditor.button[3] = guiCreateButton(398, 73, 155, 47, "җΛҚĀTŠŨKÎҗ", false, GUIEditor.window[1])
        GUIEditor.button[4] = guiCreateButton(17, 181, 155, 47, "╚>SΛÏЎAJIŇ<╝", false, GUIEditor.window[1])
        GUIEditor.button[5] = guiCreateButton(212, 186, 155, 47, "Ω »GᴏᴅOғWᴀʀ« Ω", false, GUIEditor.window[1])
        GUIEditor.button[6] = guiCreateButton(398, 186, 155, 47, "[»Aᴘᴏᴄᴀʟɪᴘꜱɪꜱ«]", false, GUIEditor.window[1])
        GUIEditor.button[7] = guiCreateButton(17, 289, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[8] = guiCreateButton(212, 289, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[9] = guiCreateButton(398, 289, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[10] = guiCreateButton(17, 394, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[11] = guiCreateButton(212, 394, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[12] = guiCreateButton(398, 394, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[13] = guiCreateButton(50, 136, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[14] = guiCreateButton(241, 136, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[15] = guiCreateButton(424, 136, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[16] = guiCreateButton(50, 248, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[17] = guiCreateButton(50, 351, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[18] = guiCreateButton(244, 250, 91, 24, "Probar", false, GUIEditor.window[1])
        
        GUIEditor.label[1] = guiCreateLabel(50, 50, 92, 13, "$500,000", false, GUIEditor.window[1])
        GUIEditor.label[2] = guiCreateLabel(240, 47, 92, 13, "$600,000", false, GUIEditor.window[1])
        GUIEditor.label[3] = guiCreateLabel(438, 47, 92, 13, "$500,000", false, GUIEditor.window[1])
        GUIEditor.label[4] = guiCreateLabel(50, 163, 92, 13, "$600,000", false, GUIEditor.window[1])
        GUIEditor.label[5] = guiCreateLabel(244, 168, 92, 13, "$500,000", false, GUIEditor.window[1])
        GUIEditor.label[6] = guiCreateLabel(429, 166, 92, 13, "$200,000", false, GUIEditor.window[1])
guiSetVisible( GUIEditor.window[1], false )


function guiToggleVisible ( )  
     
        if ( guiGetVisible ( GUIEditor.window[1] ) == true ) then                
                guiSetVisible ( GUIEditor.window[1], false ) 
        else              
                guiSetVisible ( GUIEditor.window[1], true ) 
showCursor(GUIEditor.window[1], true)
        end
end


addCommandHandler ( "tags", guiToggleVisible )

function NAZI(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 500000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("GodOfWar"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("APC"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[1], NAZI )


function SPARTAN(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 600000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("GodOfWar"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("APC"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[2], SPARTAN )

function AKATSUKI(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 500000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("GodOfWar"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("APC"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[3], AKATSUKI )

function SAIYAYIN(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 600000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("GodOfWar"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("APC"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[4], SAIYAYIN )


function WAR(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 500000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("GodOfWar"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("APC"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[5], WAR )

function APC(source,accountName )
local money = getPlayerMoney(source)
if accountName then 
if (money > 200000) then
outputChatBox("Has adquirido este tag", source, 255, 0, 0)
aclGroupAddObject (aclGetGroup("APC"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Spartan"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Quinx"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Saiyayin"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Nazi"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("Akatsuki"), "user."..accountName)
aclGroupRemoveObject (aclGetGroup("GodOfWar"), "user."..accountName)
else
outputChatBox("No tienes suficiente dinero", source, 255, 0, 0)
end
end


end
 addEventHandler ( "onClientGUIClick", GUIEditor.button[6], APC )

function probar1(source)
outputChatBox("#101010【#660099ŇλŽĬ#101010】", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[13], probar1 )
---------
function probar2(source)
outputChatBox("#FFCC00➳#222222SᴘᴀʀTᴀɴ#FFCC00➹", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[14], probar2 )
--------
function probar3(source)
outputChatBox("#ff0000җ»#303030ΛҚĀTŠŬKÎ#ff0000«җ", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[15], probar3 )
----------
function probar4(source)
outputChatBox("#00ffff╚>#ffff00SΛÏЎAJIŇ#00ffff<╝", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[16], probar4 )
---------
function probar5(source)
outputChatBox("#550000Ω »#ffffffGᴏᴅOғWᴀʀ#550000« Ω", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[18], probar5 )
-----------
function probar6(source)
outputChatBox("#000000》»#00FFFFAᴘᴏᴄᴀ#00FF99ʟɪᴘꜱɪꜱ#000000«《", source, 255, 0, 0)
end

 addEventHandler ( "onClientGUIClick", GUIEditor.button[19], probar6 )

Try Now 

Link to comment

You're mixing server-side function with client functions. Try this:

GUIEditor = {
    button = {},
    window = {},
	label={}
}

addCommandHandler("onResourcestart", resourceRoot,
function()
 GUIEditor.window[1] =  guiCreateWindow(227, 127, 571, 514, "Panel de tags Apocalipsis Mundial", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
	  guiSetVisible( GUIEditor.window[1], false )

        GUIEditor.button[1] = guiCreateButton(17, 73, 155, 47, "【ИλŽÎ】", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(212, 73, 155, 47, "➳SparTan➹", false, GUIEditor.window[1])
        GUIEditor.button[3] = guiCreateButton(398, 73, 155, 47, "җΛҚĀTŠŨKÎҗ", false, GUIEditor.window[1])
        GUIEditor.button[4] = guiCreateButton(17, 181, 155, 47, "╚>SΛÏЎAJIŇ<╝", false, GUIEditor.window[1])
        GUIEditor.button[5] = guiCreateButton(212, 186, 155, 47, "Ω »GᴏᴅOғWᴀʀ« Ω", false, GUIEditor.window[1])
        GUIEditor.button[6] = guiCreateButton(398, 186, 155, 47, "[»Aᴘᴏᴄᴀʟɪᴘꜱɪꜱ«]", false, GUIEditor.window[1])
        GUIEditor.button[7] = guiCreateButton(17, 289, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[8] = guiCreateButton(212, 289, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[9] = guiCreateButton(398, 289, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[10] = guiCreateButton(17, 394, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[11] = guiCreateButton(212, 394, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[12] = guiCreateButton(398, 394, 155, 47, "Proximamente", false, GUIEditor.window[1])
        GUIEditor.button[13] = guiCreateButton(50, 136, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[14] = guiCreateButton(241, 136, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[15] = guiCreateButton(424, 136, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[16] = guiCreateButton(50, 248, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[17] = guiCreateButton(50, 351, 91, 24, "Probar", false, GUIEditor.window[1])
        GUIEditor.button[18] = guiCreateButton(244, 250, 91, 24, "Probar", false, GUIEditor.window[1])
        
        GUIEditor.label[1] = guiCreateLabel(50, 50, 92, 13, "$500,000", false, GUIEditor.window[1])
        GUIEditor.label[2] = guiCreateLabel(240, 47, 92, 13, "$600,000", false, GUIEditor.window[1])
        GUIEditor.label[3] = guiCreateLabel(438, 47, 92, 13, "$500,000", false, GUIEditor.window[1])
        GUIEditor.label[4] = guiCreateLabel(50, 163, 92, 13, "$600,000", false, GUIEditor.window[1])
        GUIEditor.label[5] = guiCreateLabel(244, 168, 92, 13, "$500,000", false, GUIEditor.window[1])
        GUIEditor.label[6] = guiCreateLabel(429, 166, 92, 13, "$200,000", false, GUIEditor.window[1])

end)

function guiToggleVisible ( )  
	guiSetVisible( GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1]) )
	showCursor( guiGetVisible(GUIEditor.window[1]) )
end
addCommandHandler ( "tags", guiToggleVisible )


addEventHandler ( "onClientGUIClick", guiRoot, 
	function()
		if source == GUIEditor.button[1] then
			if (getPlayerMoney(localPlayer) >= 500000) then
				triggerServerEvent("tag:onRequestBuyTag", localPlayer, "Nazi" )
			else
				outputChatBox("No tienes suficiente dinero", 255, 0, 0)
				guiSetVisible( GUIEditor.window[1], false )
				showCursor(false)
			end
		elseif source == GUIEditor.button[2] then
			if (getPlayerMoney(localPlayer) >= 600000) then
				triggerServerEvent("tag:onRequestBuyTag", localPlayer, "Spartan" )
			else
				outputChatBox("No tienes suficiente dinero", 255, 0, 0)
				guiSetVisible( GUIEditor.window[1], false )
				showCursor(false)
			end
		elseif source == GUIEditor.button[3] then
			if (getPlayerMoney(localPlayer) >= 500000) then
				triggerServerEvent("tag:onRequestBuyTag", localPlayer, "Akatsuki" )
			else
				outputChatBox("No tienes suficiente dinero", 255, 0, 0)
				guiSetVisible( GUIEditor.window[1], false )
				showCursor(false)
			end
		elseif source == GUIEditor.button[4] then
			if (getPlayerMoney(localPlayer) >= 600000) then
				triggerServerEvent("tag:onRequestBuyTag", localPlayer, "Saiyayin" )
			else
				outputChatBox("No tienes suficiente dinero", 255, 0, 0)
				guiSetVisible( GUIEditor.window[1], false )
				showCursor(false)
			end
		elseif source == GUIEditor.button[5] then
			if (getPlayerMoney(localPlayer) >= 500000) then
				triggerServerEvent("tag:onRequestBuyTag", localPlayer, "GodOfWar" )
			else
				outputChatBox("No tienes suficiente dinero", 255, 0, 0)
				guiSetVisible( GUIEditor.window[1], false )
				showCursor(false)
			end
		elseif source == GUIEditor.button[6] then
			if (getPlayerMoney(localPlayer) >= 200000) then
				triggerServerEvent("tag:onRequestBuyTag", localPlayer, "APC" )
			else
				outputChatBox("No tienes suficiente dinero", 255, 0, 0)
				guiSetVisible( GUIEditor.window[1], false )
				showCursor(false)
			end
		elseif source == GUIEditor.button[13] then
			outputChatBox("#101010【#660099ŇλŽĬ#101010】", 255, 0, 0)
		elseif source == GUIEditor.button[14] then
			outputChatBox("#FFCC00➳#222222SᴘᴀʀTᴀɴ#FFCC00➹", 255, 0, 0)
		elseif source == GUIEditor.button[15] then
			outputChatBox("#ff0000җ»#303030ΛҚĀTŠŬKÎ#ff0000«җ", 255, 0, 0)
		elseif source == GUIEditor.button[16] then
			outputChatBox("#00ffff╚>#ffff00SΛÏЎAJIŇ#00ffff<╝", 255, 0, 0)
		elseif source == GUIEditor.button[17] then
			outputChatBox("#550000Ω »#ffffffGᴏᴅOғWᴀʀ#550000« Ω", 255, 0, 0)
		elseif source == GUIEditor.button[18] then
			outputChatBox("#000000》»#00FFFFAᴘᴏᴄᴀ#00FF99ʟɪᴘꜱɪꜱ#000000«《", 255, 0, 0)
		end
	end
)

local Groups = { 
	["Nazi"] = 500000, ["Akatsuki"] = 500000, ["Quinx"] = 500000, ["GodOfWar"] = 500000,
	["Spartan"] = 600000, ["Saiyayin"] = 600000, ["APC"] = 200000
}
function onRequestBuyTag( tag )
	if not tag or not aclGetGroup(tag) then
		return
	end
	if isGuestAccount(getPlayerAccount(client)) then
		return outputChatBox("You're not logged in!", client, 255, 0, 0)
	end
	tag = tostring(tag)
	local accountName = getAccountName(getPlayerAccount(client))
	if isObjectInACLGroup( "user."..accountName, aclGetGroup(tag)) then
		outputChatBox("You're already in this group!", client, 255, 0, 0)
	else
		takePlayerMoney( client, Groups[tag] or 0 )
		outputChatBox("Has adquirido este tag", client, 255, 0, 0)
		removeFromOtherGroups( client )
		aclGroupAddObject (aclGetGroup(tag), "user."..accountName)
	end
end
addEvent( "tag:onRequestBuyTag", true )
addEventHandler( "tag:onRequestBuyTag", root, onRequestBuyTag )

function removeFromOtherGroups(player)
	local accName = getAccountName(getPlayerAccount(player))
	for gname in pairs(Groups) do
		if isObjectInACLGroup( "user."..accName, aclGetGroup(gname)) then
			aclGroupRemoveObject (aclGetGroup(gname), "user."..accName)
		end
	end
end

 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...