Jump to content

Some Help with My Level Systme


X-SHADOW

Recommended Posts

Hi all i have Made this

clinetSide ..

  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[1] = guiCreateWindow(484,199,553,326,"[@~Call OF Duty MW3 Settings @~]",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Image[1] = guiCreateStaticImage(9,20,535,194,"images/COD.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(386,256,158,43,"Yes, i Want",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"clear-normal") 
GUIEditor_Button[2] = guiCreateButton(9,251,159,46,"No, i Dont",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"clear-normal") 
GUIEditor_Label[1] = guiCreateLabel(111,221,364,16,"Do You Want To Show COD MW3 Level System And Exp ?",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"clear-normal") 
  
addEvent ( "playSound" , true ) 
addEventHandler ( "playSound" , root , 
function() 
playSound ( "sounds/levelup.wav" , false ) 
end) 
  
GUIEditor_Window = {} 
GUIEditor_Grid = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow( 423,220,477,311,"Level_System v3.0 ",false ) 
guiWindowSetMovable( GUIEditor_Window[1],false ) 
guiWindowSetSizable( GUIEditor_Window[1],false ) 
guiSetVisible( GUIEditor_Window[1],false ) 
GUIEditor_Grid[1] = guiCreateGridList( 9,21,264,281,false,GUIEditor_Window[1] ) 
guiGridListSetSelectionMode( GUIEditor_Grid[1],2 ) 
col = guiGridListAddColumn( GUIEditor_Grid[1],"Players",0.90 ) 
GUIEditor_Label[1] = guiCreateLabel( 286,43,144,23,"Level:",false,GUIEditor_Window[1] ) 
guiLabelSetColor( GUIEditor_Label[1],0,255,0 ) 
guiSetFont( GUIEditor_Label[1],"clear-normal" ) 
GUIEditor_Label[2] = guiCreateLabel( 284,95,102,21,"EXP:",false,GUIEditor_Window[1] ) 
guiLabelSetColor( GUIEditor_Label[2],0,0,255 ) 
guiSetFont( GUIEditor_Label[2],"clear-normal" ) 
GUIEditor_Image[1] = guiCreateStaticImage( 266,152,182,146,"images/mtalogo.png",false,GUIEditor_Window[1] ) 
  
if (col) then 
    for _, player in pairs( getElementsByType 'player' ) do 
        row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
        guiGridListSetItemText( GUIEditor_Grid[1],row,col,getPlayerName( player ),false,false ) 
    end 
end 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Grid[1]) then 
            local theRow, theCol = guiGridListGetSelectedItem( source ) 
            if (theRow and theCol and theRow ~= -1 and theCol ~= -1) then 
                local playerName = guiGridListGetItemText( source,theRow, theCol ) 
                local player = getPlayerFromName(playerName) 
                if (player and isElement(player)) then 
                    local theEXP = getElementData(player, "ExP") or 0 
                    local theLevel = getElementData(player, "Level") or 0 
                    guiSetText(GUIEditor_Label[1], "Level: ".. tostring(theLevel)) 
                    guiSetText(GUIEditor_Label[2], "EXP: ".. tostring(theEXP)) 
                else 
                    guiSetText(GUIEditor_Label[1], "Level:") 
                    guiSetText(GUIEditor_Label[2], "EXP:") 
                end 
            else 
                guiSetText(GUIEditor_Label[1], "Level:") 
                guiSetText(GUIEditor_Label[2], "EXP:") 
            end 
        end 
    end 
) 
  
bindKey( 'F7','down', 
    function( ) 
        guiSetVisible( GUIEditor_Window[1], not guiGetVisible( GUIEditor_Window[1] ) ) 
        showCursor( guiGetVisible( GUIEditor_Window[1] ) ) 
    end 
) 
  
function levelup () 
    local Exp = getElementData(localPlayer,"ExP") 
    local Level = getElementData(localPlayer,"Level") 
    if isElement(expLabel) then destroyElement(expLabel) end 
    expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"ExP gained: ??\nTotal ExP: ".. tostring(Exp) .."\nLevel: ".. tostring(Level),true) 
    guiLabelSetColor(expLabel,0,255,0) 
    guiLabelSetVerticalAlign(expLabel,"top") 
    guiLabelSetHorizontalAlign(expLabel,"left",false) 
    guiSetFont(expLabel,"clear-normal") 
    setTimer ( levelup, 2000, 1) 
end 
setTimer ( levelup, 2000, 1) 

serverSide..

exports.scoreboard:scoreboardAddColumn("EXP") 
exports.scoreboard:scoreboardAddColumn("Level") 
  
function win(ammo, killer, weapon, bodypart) 
    local H = getElementData(killer, "EXP") 
    local S = getElementData(killer, "Level") 
    local killer1 = getPlayerName(killer) 
    local noob = getPlayerName(source) 
  
    if killer and killer ~= source then 
    setElementData(killer, "EXP", tonumber(H)+1) 
    if tonumber(H) == 50 then 
    setElementData(killer, "Level", "Lvl 1 !") 
     triggerClientEvent ( killer, "playSound" , killer ) 
    elseif tonumber(H) == 65 then 
    setElementData(killer, "Level", "Lvl 2 !") 
     triggerClientEvent ( killer, "playSound" , killer ) 
    elseif tonumber(H) == 75 then 
    setElementData(killer, "Level", "Lvl 3 !") 
    triggerClientEvent ( killer, "playSound" , killer ) 
    elseif tonumber(H) == 95 then 
    setElementData(killer, "Level", "Lvl 4 !") 
    triggerClientEvent ( killer, "playSound" , killer ) 
    elseif tonumber(H) == 120 then 
    setElementData(killer, "Level", "Lvl 5 !") 
    triggerClientEvent ( killer, "playSound" , killer ) 
    elseif tonumber(H) == 250 then 
    setElementData(killer, "Level", "Lvl 6 !") 
    triggerClientEvent ( killer, "playSound" , killer )   
    elseif tonumber(H) == 370 then 
    setElementData(killer, "Level", "Lvl 7 !") 
    triggerClientEvent ( killer, "playSound" , killer )   
    elseif tonumber(H) == 420 then 
    setElementData(killer, "Level", "Lvl 8 !") 
    triggerClientEvent ( killer, "playSound" , killer )   
    elseif tonumber(H) == 560 then 
    setElementData(killer, "Level", "Lvl 9 !") 
    triggerClientEvent ( killer, "playSound" , killer )   
    elseif tonumber(H) == 1000 then 
    triggerClientEvent ( killer, "playSound" , killer ) 
    setElementData(killer, "Level", "Lvl 10 !") 
    end 
    outputChatBox(killer1 .. " Killed " .. noob .. " and gained +1 ExP ", getRootElement(), 255, 255, 0, false) 
    end 
end 
addEventHandler( "onPlayerWasted", getRootElement(), win) 
  
function onLogin (_,account) 
        setElementData(source, "Level", getAccountData(account, "lvl") or "Level 0 !") 
        setElementData(source, "EXP", getAccountData(account, "exp") or "0") 
end 
addEventHandler ("onPlayerLogin", root, onLogin) 
  
function onQuit() 
local account = getPlayerAccount(source) 
if not account then return end 
  if not isGuestAccount(account) then 
        setAccountData (account, "lvl", getElementData(source, "Level")) 
        setAccountData (account, "exp", getElementData(source, "EXP")) 
    end 
end 
addEventHandler ("onPlayerQuit", root, onQuit) 

my point is if player press Y,i want Button then show to him all Level And Exp windows and lables and if he press No,i Dont the Hide all labels and msgs and EXP Cloumn and level Cloumn and Windows

* Hope No One Steal it :D

Link to comment
Hi all i have Made this

clinetSide ..

  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[1] = guiCreateWindow(484,199,553,326,"[@~Call OF Duty MW3 Settings @~]",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Image[1] = guiCreateStaticImage(9,20,535,194,"images/COD.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(386,256,158,43,"Yes, i Want",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"clear-normal") 
GUIEditor_Button[2] = guiCreateButton(9,251,159,46,"No, i Dont",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"clear-normal") 
GUIEditor_Label[1] = guiCreateLabel(111,221,364,16,"Do You Want To Show COD MW3 Level System And Exp ?",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"clear-normal") 
  
addEvent ( "playSound" , true ) 
addEventHandler ( "playSound" , root , 
function() 
playSound ( "sounds/levelup.wav" , false ) 
end) 
  
GUIEditor_Window = {} 
GUIEditor_Grid = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow( 423,220,477,311,"Level_System v3.0 ",false ) 
guiWindowSetMovable( GUIEditor_Window[1],false ) 
guiWindowSetSizable( GUIEditor_Window[1],false ) 
guiSetVisible( GUIEditor_Window[1],false ) 
GUIEditor_Grid[1] = guiCreateGridList( 9,21,264,281,false,GUIEditor_Window[1] ) 
guiGridListSetSelectionMode( GUIEditor_Grid[1],2 ) 
col = guiGridListAddColumn( GUIEditor_Grid[1],"Players",0.90 ) 
GUIEditor_Label[1] = guiCreateLabel( 286,43,144,23,"Level:",false,GUIEditor_Window[1] ) 
guiLabelSetColor( GUIEditor_Label[1],0,255,0 ) 
guiSetFont( GUIEditor_Label[1],"clear-normal" ) 
GUIEditor_Label[2] = guiCreateLabel( 284,95,102,21,"EXP:",false,GUIEditor_Window[1] ) 
guiLabelSetColor( GUIEditor_Label[2],0,0,255 ) 
guiSetFont( GUIEditor_Label[2],"clear-normal" ) 
GUIEditor_Image[1] = guiCreateStaticImage( 266,152,182,146,"images/mtalogo.png",false,GUIEditor_Window[1] ) 
  
if (col) then 
    for _, player in pairs( getElementsByType 'player' ) do 
        row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
        guiGridListSetItemText( GUIEditor_Grid[1],row,col,getPlayerName( player ),false,false ) 
    end 
end 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Grid[1]) then 
            local theRow, theCol = guiGridListGetSelectedItem( source ) 
            if (theRow and theCol and theRow ~= -1 and theCol ~= -1) then 
                local playerName = guiGridListGetItemText( source,theRow, theCol ) 
                local player = getPlayerFromName(playerName) 
                if (player and isElement(player)) then 
                    local theEXP = getElementData(player, "ExP") or 0 
                    local theLevel = getElementData(player, "Level") or 0 
                    guiSetText(GUIEditor_Label[1], "Level: ".. tostring(theLevel)) 
                    guiSetText(GUIEditor_Label[2], "EXP: ".. tostring(theEXP)) 
                else 
                    guiSetText(GUIEditor_Label[1], "Level:") 
                    guiSetText(GUIEditor_Label[2], "EXP:") 
                end 
            else 
                guiSetText(GUIEditor_Label[1], "Level:") 
                guiSetText(GUIEditor_Label[2], "EXP:") 
            end 
        end 
    end 
) 
  
bindKey( 'F7','down', 
    function( ) 
        guiSetVisible( GUIEditor_Window[1], not guiGetVisible( GUIEditor_Window[1] ) ) 
        showCursor( guiGetVisible( GUIEditor_Window[1] ) ) 
    end 
) 
  
function levelup () 
    local Exp = getElementData(localPlayer,"ExP") 
    local Level = getElementData(localPlayer,"Level") 
    if isElement(expLabel) then destroyElement(expLabel) end 
    expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"ExP gained: ??\nTotal ExP: ".. tostring(Exp) .."\nLevel: ".. tostring(Level),true) 
    guiLabelSetColor(expLabel,0,255,0) 
    guiLabelSetVerticalAlign(expLabel,"top") 
    guiLabelSetHorizontalAlign(expLabel,"left",false) 
    guiSetFont(expLabel,"clear-normal") 
    setTimer ( levelup, 2000, 1) 
end 
setTimer ( levelup, 2000, 1) 

serverSide..

exports.scoreboard:scoreboardAddColumn("EXP") 
exports.scoreboard:scoreboardAddColumn("Level") 
  
function win(ammo, killer, weapon, bodypart) 
    local H = getElementData(killer, "EXP") 
    local S = getElementData(killer, "Level") 
    local killer1 = getPlayerName(killer) 
    local noob = getPlayerName(source) 
  
    if killer and killer ~= source then 
    setElementData(killer, "EXP", tonumber(H)+1) 
    if tonumber(H) == 50 then 
    setElementData(killer, "Level", "Lvl 1 !") 
     triggerClientEvent ( killer, "playSound" , killer ) 
    elseif tonumber(H) == 65 then 
    setElementData(killer, "Level", "Lvl 2 !") 
     triggerClientEvent ( killer, "playSound" , killer ) 
    elseif tonumber(H) == 75 then 
    setElementData(killer, "Level", "Lvl 3 !") 
    triggerClientEvent ( killer, "playSound" , killer ) 
    elseif tonumber(H) == 95 then 
    setElementData(killer, "Level", "Lvl 4 !") 
    triggerClientEvent ( killer, "playSound" , killer ) 
    elseif tonumber(H) == 120 then 
    setElementData(killer, "Level", "Lvl 5 !") 
    triggerClientEvent ( killer, "playSound" , killer ) 
    elseif tonumber(H) == 250 then 
    setElementData(killer, "Level", "Lvl 6 !") 
    triggerClientEvent ( killer, "playSound" , killer )   
    elseif tonumber(H) == 370 then 
    setElementData(killer, "Level", "Lvl 7 !") 
    triggerClientEvent ( killer, "playSound" , killer )   
    elseif tonumber(H) == 420 then 
    setElementData(killer, "Level", "Lvl 8 !") 
    triggerClientEvent ( killer, "playSound" , killer )   
    elseif tonumber(H) == 560 then 
    setElementData(killer, "Level", "Lvl 9 !") 
    triggerClientEvent ( killer, "playSound" , killer )   
    elseif tonumber(H) == 1000 then 
    triggerClientEvent ( killer, "playSound" , killer ) 
    setElementData(killer, "Level", "Lvl 10 !") 
    end 
    outputChatBox(killer1 .. " Killed " .. noob .. " and gained +1 ExP ", getRootElement(), 255, 255, 0, false) 
    end 
end 
addEventHandler( "onPlayerWasted", getRootElement(), win) 
  
function onLogin (_,account) 
        setElementData(source, "Level", getAccountData(account, "lvl") or "Level 0 !") 
        setElementData(source, "EXP", getAccountData(account, "exp") or "0") 
end 
addEventHandler ("onPlayerLogin", root, onLogin) 
  
function onQuit() 
local account = getPlayerAccount(source) 
if not account then return end 
  if not isGuestAccount(account) then 
        setAccountData (account, "lvl", getElementData(source, "Level")) 
        setAccountData (account, "exp", getElementData(source, "EXP")) 
    end 
end 
addEventHandler ("onPlayerQuit", root, onQuit) 

my point is if player press Y,i want Button then show to him all Level And Exp windows and lables and if he press No,i Dont the Hide all labels and msgs and EXP Cloumn and level Cloumn and Windows

* Hope No One Steal it :D

You made this? and you don't know how to hide the window? nice joke :lol:

https://forum.multitheftauto.com/viewtopic.php?f=91&t=40112

Link to comment
lol tapolah iam evil-Cod3r and dev-point but i dont know how to hide labls and windows and cloumns and let the sound dont work

so we catch you, you are using multiple names lol

hide window? so what this code is doing in the script? :o

bindKey( 'F7','down', 
    function( ) 
        guiSetVisible( GUIEditor_Window[1], not guiGetVisible( GUIEditor_Window[1] ) ) 
        showCursor( guiGetVisible( GUIEditor_Window[1] ) ) 
    end 
) 

Link to comment

so it well be like this

  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[1] = guiCreateWindow(484,199,553,326,"[@~Call OF Duty MW3 Settings @~]",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Image[1] = guiCreateStaticImage(9,20,535,194,"images/COD.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(386,256,158,43,"Yes, i Want",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"clear-normal") 
GUIEditor_Button[2] = guiCreateButton(9,251,159,46,"No, i Dont",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"clear-normal") 
GUIEditor_Label[1] = guiCreateLabel(111,221,364,16,"Do You Want To Show COD MW3 Level System And Exp ?",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"clear-normal") 
  
addEvent ( "playSound" , true ) 
addEventHandler ( "playSound" , root , 
function() 
playSound ( "sounds/levelup.wav" , false ) 
end) 
  
GUIEditor_Window = {} 
GUIEditor_Grid = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[2] = guiCreateWindow( 423,220,477,311,"Level_System v3.0 ",false ) 
guiWindowSetMovable( GUIEditor_Window[2],false ) 
guiWindowSetSizable( GUIEditor_Window[2],false ) 
guiSetVisible( GUIEditor_Window[2],false ) 
GUIEditor_Grid[1] = guiCreateGridList( 9,21,264,281,false,GUIEditor_Window[2] ) 
guiGridListSetSelectionMode( GUIEditor_Grid[1],2 ) 
col = guiGridListAddColumn( GUIEditor_Grid[1],"Players",0.90 ) 
GUIEditor_Label[1] = guiCreateLabel( 286,43,144,23,"Level:",false,GUIEditor_Window[2] ) 
guiLabelSetColor( GUIEditor_Label[1],0,255,0 ) 
guiSetFont( GUIEditor_Label[1],"clear-normal" ) 
GUIEditor_Label[2] = guiCreateLabel( 284,95,102,21,"EXP:",false,GUIEditor_Window[2] ) 
guiLabelSetColor( GUIEditor_Label[2],0,0,255 ) 
guiSetFont( GUIEditor_Label[2],"clear-normal" ) 
GUIEditor_Image[1] = guiCreateStaticImage( 266,152,182,146,"images/mtalogo.png",false,GUIEditor_Window[2] ) 
  
if (col) then 
    for _, player in pairs( getElementsByType 'player' ) do 
        row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
        guiGridListSetItemText( GUIEditor_Grid[1],row,col,getPlayerName( player ),false,false ) 
    end 
end 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Grid[1]) then 
            local theRow, theCol = guiGridListGetSelectedItem( source ) 
            if (theRow and theCol and theRow ~= -1 and theCol ~= -1) then 
                local playerName = guiGridListGetItemText( source,theRow, theCol ) 
                local player = getPlayerFromName(playerName) 
                if (player and isElement(player)) then 
                    local theEXP = getElementData(player, "ExP") or 0 
                    local theLevel = getElementData(player, "Level") or 0 
                    guiSetText(GUIEditor_Label[1], "Level: ".. tostring(theLevel)) 
                    guiSetText(GUIEditor_Label[2], "EXP: ".. tostring(theEXP)) 
                else 
                    guiSetText(GUIEditor_Label[1], "Level:") 
                    guiSetText(GUIEditor_Label[2], "EXP:") 
                end 
            else 
                guiSetText(GUIEditor_Label[1], "Level:") 
                guiSetText(GUIEditor_Label[2], "EXP:") 
            end 
        end 
    end 
) 
  
function levelup () 
    local Exp = getElementData(localPlayer,"ExP") 
    local Level = getElementData(localPlayer,"Level") 
    if isElement(expLabel) then destroyElement(expLabel) end 
    expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"ExP gained: ??\nTotal ExP: ".. tostring(Exp) .."\nLevel: ".. tostring(Level),true) 
    guiLabelSetColor(expLabel,0,255,0) 
    guiLabelSetVerticalAlign(expLabel,"top") 
    guiLabelSetHorizontalAlign(expLabel,"left",false) 
    guiSetFont(expLabel,"clear-normal") 
    setTimer ( levelup, 2000, 1) 
end 
setTimer ( levelup, 2000, 1) 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Button[1]) then 
        outputChatBox("All Settings Are Enabled",source,255,255,0) 
end) 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Button[2]) then 
        guiSetVisible( GUIEditor_Window[1],false) 
        guiSetVisible( GUIEditor_Window[2],false) 
        destroyElement(expLabel) 
        outputChatBox("All Settings Are Disabled",source,255,255,0) 
        stopSound("levelup.wav") 
end) 

Link to comment
so it well be like this
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[1] = guiCreateWindow(484,199,553,326,"[@~Call OF Duty MW3 Settings @~]",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Image[1] = guiCreateStaticImage(9,20,535,194,"images/COD.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(386,256,158,43,"Yes, i Want",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"clear-normal") 
GUIEditor_Button[2] = guiCreateButton(9,251,159,46,"No, i Dont",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"clear-normal") 
GUIEditor_Label[1] = guiCreateLabel(111,221,364,16,"Do You Want To Show COD MW3 Level System And Exp ?",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"clear-normal") 
  
addEvent ( "playSound" , true ) 
addEventHandler ( "playSound" , root , 
function() 
playSound ( "sounds/levelup.wav" , false ) 
end) 
  
GUIEditor_Window = {} 
GUIEditor_Grid = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[2] = guiCreateWindow( 423,220,477,311,"Level_System v3.0 ",false ) 
guiWindowSetMovable( GUIEditor_Window[2],false ) 
guiWindowSetSizable( GUIEditor_Window[2],false ) 
guiSetVisible( GUIEditor_Window[2],false ) 
GUIEditor_Grid[1] = guiCreateGridList( 9,21,264,281,false,GUIEditor_Window[2] ) 
guiGridListSetSelectionMode( GUIEditor_Grid[1],2 ) 
col = guiGridListAddColumn( GUIEditor_Grid[1],"Players",0.90 ) 
GUIEditor_Label[1] = guiCreateLabel( 286,43,144,23,"Level:",false,GUIEditor_Window[2] ) 
guiLabelSetColor( GUIEditor_Label[1],0,255,0 ) 
guiSetFont( GUIEditor_Label[1],"clear-normal" ) 
GUIEditor_Label[2] = guiCreateLabel( 284,95,102,21,"EXP:",false,GUIEditor_Window[2] ) 
guiLabelSetColor( GUIEditor_Label[2],0,0,255 ) 
guiSetFont( GUIEditor_Label[2],"clear-normal" ) 
GUIEditor_Image[1] = guiCreateStaticImage( 266,152,182,146,"images/mtalogo.png",false,GUIEditor_Window[2] ) 
  
if (col) then 
    for _, player in pairs( getElementsByType 'player' ) do 
        row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
        guiGridListSetItemText( GUIEditor_Grid[1],row,col,getPlayerName( player ),false,false ) 
    end 
end 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Grid[1]) then 
            local theRow, theCol = guiGridListGetSelectedItem( source ) 
            if (theRow and theCol and theRow ~= -1 and theCol ~= -1) then 
                local playerName = guiGridListGetItemText( source,theRow, theCol ) 
                local player = getPlayerFromName(playerName) 
                if (player and isElement(player)) then 
                    local theEXP = getElementData(player, "ExP") or 0 
                    local theLevel = getElementData(player, "Level") or 0 
                    guiSetText(GUIEditor_Label[1], "Level: ".. tostring(theLevel)) 
                    guiSetText(GUIEditor_Label[2], "EXP: ".. tostring(theEXP)) 
                else 
                    guiSetText(GUIEditor_Label[1], "Level:") 
                    guiSetText(GUIEditor_Label[2], "EXP:") 
                end 
            else 
                guiSetText(GUIEditor_Label[1], "Level:") 
                guiSetText(GUIEditor_Label[2], "EXP:") 
            end 
        end 
    end 
) 
  
function levelup () 
    local Exp = getElementData(localPlayer,"ExP") 
    local Level = getElementData(localPlayer,"Level") 
    if isElement(expLabel) then destroyElement(expLabel) end 
    expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"ExP gained: ??\nTotal ExP: ".. tostring(Exp) .."\nLevel: ".. tostring(Level),true) 
    guiLabelSetColor(expLabel,0,255,0) 
    guiLabelSetVerticalAlign(expLabel,"top") 
    guiLabelSetHorizontalAlign(expLabel,"left",false) 
    guiSetFont(expLabel,"clear-normal") 
    setTimer ( levelup, 2000, 1) 
end 
setTimer ( levelup, 2000, 1) 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Button[1]) then 
        outputChatBox("All Settings Are Enabled",source,255,255,0) 
end) 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Button[2]) then 
        guiSetVisible( GUIEditor_Window[1],false) 
        guiSetVisible( GUIEditor_Window[2],false) 
        destroyElement(expLabel) 
        outputChatBox("All Settings Are Disabled",source,255,255,0) 
        stopSound("levelup.wav") 
end) 

First: you don't need to hide or destroy the labels, if you hide the window the lable will hiding with the window -_-

Secondly: outputChatBox in client side does not need player element -_-

Thirdly: stopSound function require sound element not sound path -_-

Link to comment

i made this is it correct ?

  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[1] = guiCreateWindow(484,199,553,326,"[@~Call OF Duty MW3 Settings @~]",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Image[1] = guiCreateStaticImage(9,20,535,194,"images/COD.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(386,256,158,43,"Yes, i Want",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"clear-normal") 
GUIEditor_Button[2] = guiCreateButton(9,251,159,46,"No, i Dont",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"clear-normal") 
GUIEditor_Label[1] = guiCreateLabel(111,221,364,16,"Do You Want To Show COD MW3 Level System And Exp ?",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"clear-normal") 
  
addEvent ( "playSound" , true ) 
addEventHandler ( "playSound" , root , 
function() 
playSound ( "sounds/levelup.wav" , false ) 
end) 
  
GUIEditor_Window = {} 
GUIEditor_Grid = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[2] = guiCreateWindow( 423,220,477,311,"Level_System v3.0 ",false ) 
guiWindowSetMovable( GUIEditor_Window[2],false ) 
guiWindowSetSizable( GUIEditor_Window[2],false ) 
guiSetVisible( GUIEditor_Window[2],false ) 
GUIEditor_Grid[1] = guiCreateGridList( 9,21,264,281,false,GUIEditor_Window[2] ) 
guiGridListSetSelectionMode( GUIEditor_Grid[1],2 ) 
col = guiGridListAddColumn( GUIEditor_Grid[1],"Players",0.90 ) 
GUIEditor_Label[1] = guiCreateLabel( 286,43,144,23,"Level:",false,GUIEditor_Window[2] ) 
guiLabelSetColor( GUIEditor_Label[1],0,255,0 ) 
guiSetFont( GUIEditor_Label[1],"clear-normal" ) 
GUIEditor_Label[2] = guiCreateLabel( 284,95,102,21,"EXP:",false,GUIEditor_Window[2] ) 
guiLabelSetColor( GUIEditor_Label[2],0,0,255 ) 
guiSetFont( GUIEditor_Label[2],"clear-normal" ) 
GUIEditor_Image[1] = guiCreateStaticImage( 266,152,182,146,"images/mtalogo.png",false,GUIEditor_Window[2] ) 
  
if (col) then 
    for _, player in pairs( getElementsByType 'player' ) do 
        row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
        guiGridListSetItemText( GUIEditor_Grid[1],row,col,getPlayerName( player ),false,false ) 
    end 
end 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Grid[1]) then 
            local theRow, theCol = guiGridListGetSelectedItem( source ) 
            if (theRow and theCol and theRow ~= -1 and theCol ~= -1) then 
                local playerName = guiGridListGetItemText( source,theRow, theCol ) 
                local player = getPlayerFromName(playerName) 
                if (player and isElement(player)) then 
                    local theEXP = getElementData(player, "ExP") or 0 
                    local theLevel = getElementData(player, "Level") or 0 
                    guiSetText(GUIEditor_Label[1], "Level: ".. tostring(theLevel)) 
                    guiSetText(GUIEditor_Label[2], "EXP: ".. tostring(theEXP)) 
                else 
                    guiSetText(GUIEditor_Label[1], "Level:") 
                    guiSetText(GUIEditor_Label[2], "EXP:") 
                end 
            else 
                guiSetText(GUIEditor_Label[1], "Level:") 
                guiSetText(GUIEditor_Label[2], "EXP:") 
            end 
        end 
    end 
) 
  
function levelup () 
    local Exp = getElementData(localPlayer,"ExP") 
    local Level = getElementData(localPlayer,"Level") 
    if isElement(expLabel) then destroyElement(expLabel) end 
    expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"ExP gained: ??\nTotal ExP: ".. tostring(Exp) .."\nLevel: ".. tostring(Level),true) 
    guiLabelSetColor(expLabel,0,255,0) 
    guiLabelSetVerticalAlign(expLabel,"top") 
    guiLabelSetHorizontalAlign(expLabel,"left",false) 
    guiSetFont(expLabel,"clear-normal") 
    setTimer ( levelup, 2000, 1) 
end 
setTimer ( levelup, 2000, 1) 
  
addEventHandler( 'onClientGUIClick',root, 
    function() 
        if (source == GUIEditor_Button[1]) then 
        outputChatBox("All Settings Are Enabled",source,255,255,0) 
        elseif (source == GUIEditor_Button[2] then 
        call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "EXP") 
        call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "Level") 
        guiSetVisible ( GUIEditor_Window[1], false ) 
        guiSetVisible ( GUIEditor_Window[2], false ) 
        outputChatBox("All Sestings Are Disbled",255,255,0) 
end 

Link to comment

you have syntax errors

  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[1] = guiCreateWindow(484,199,553,326,"[@~Call OF Duty MW3 Settings @~]",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Image[1] = guiCreateStaticImage(9,20,535,194,"images/COD.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(386,256,158,43,"Yes, i Want",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"clear-normal") 
GUIEditor_Button[2] = guiCreateButton(9,251,159,46,"No, i Dont",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"clear-normal") 
GUIEditor_Label[1] = guiCreateLabel(111,221,364,16,"Do You Want To Show COD MW3 Level System And Exp ?",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"clear-normal") 
  
addEvent ( "playSound" , true ) 
addEventHandler ( "playSound" , root , 
function() 
playSound ( "sounds/levelup.wav" , false ) 
end) 
  
GUIEditor_Window = {} 
GUIEditor_Grid = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[2] = guiCreateWindow( 423,220,477,311,"Level_System v3.0 ",false ) 
guiWindowSetMovable( GUIEditor_Window[2],false ) 
guiWindowSetSizable( GUIEditor_Window[2],false ) 
guiSetVisible( GUIEditor_Window[2],false ) 
GUIEditor_Grid[1] = guiCreateGridList( 9,21,264,281,false,GUIEditor_Window[2] ) 
guiGridListSetSelectionMode( GUIEditor_Grid[1],2 ) 
col = guiGridListAddColumn( GUIEditor_Grid[1],"Players",0.90 ) 
GUIEditor_Label[1] = guiCreateLabel( 286,43,144,23,"Level:",false,GUIEditor_Window[2] ) 
guiLabelSetColor( GUIEditor_Label[1],0,255,0 ) 
guiSetFont( GUIEditor_Label[1],"clear-normal" ) 
GUIEditor_Label[2] = guiCreateLabel( 284,95,102,21,"EXP:",false,GUIEditor_Window[2] ) 
guiLabelSetColor( GUIEditor_Label[2],0,0,255 ) 
guiSetFont( GUIEditor_Label[2],"clear-normal" ) 
GUIEditor_Image[1] = guiCreateStaticImage( 266,152,182,146,"images/mtalogo.png",false,GUIEditor_Window[2] ) 
  
if (col) then 
    for _, player in pairs( getElementsByType 'player' ) do 
        row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
        guiGridListSetItemText( GUIEditor_Grid[1],row,col,getPlayerName( player ),false,false ) 
    end 
end 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Grid[1]) then 
            local theRow, theCol = guiGridListGetSelectedItem( source ) 
            if (theRow and theCol and theRow ~= -1 and theCol ~= -1) then 
                local playerName = guiGridListGetItemText( source,theRow, theCol ) 
                local player = getPlayerFromName(playerName) 
                if (player and isElement(player)) then 
                    local theEXP = getElementData(player, "ExP") or 0 
                    local theLevel = getElementData(player, "Level") or 0 
                    guiSetText(GUIEditor_Label[1], "Level: ".. tostring(theLevel)) 
                    guiSetText(GUIEditor_Label[2], "EXP: ".. tostring(theEXP)) 
                else 
                    guiSetText(GUIEditor_Label[1], "Level:") 
                    guiSetText(GUIEditor_Label[2], "EXP:") 
                end 
            else 
                guiSetText(GUIEditor_Label[1], "Level:") 
                guiSetText(GUIEditor_Label[2], "EXP:") 
            end 
        end 
    end 
) 
  
function levelup () 
    local Exp = getElementData(localPlayer,"ExP") 
    local Level = getElementData(localPlayer,"Level") 
    if isElement(expLabel) then destroyElement(expLabel) end 
    expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"ExP gained: ??\nTotal ExP: ".. tostring(Exp) .."\nLevel: ".. tostring(Level),true) 
    guiLabelSetColor(expLabel,0,255,0) 
    guiLabelSetVerticalAlign(expLabel,"top") 
    guiLabelSetHorizontalAlign(expLabel,"left",false) 
    guiSetFont(expLabel,"clear-normal") 
    setTimer ( levelup, 2000, 1) 
end 
setTimer ( levelup, 2000, 1) 
  
addEventHandler( 'onClientGUIClick',root, 
    function() 
        if (source == GUIEditor_Button[1]) then 
        outputChatBox("All Settings Are Enabled",source,255,255,0) 
        elseif (source == GUIEditor_Button[2]) then 
        call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "EXP") 
        call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "Level") 
        guiSetVisible ( GUIEditor_Window[1], false ) 
        guiSetVisible ( GUIEditor_Window[2], false ) 
        outputChatBox("All Sestings Are Disbled",255,255,0) 
    end 
end 
) 

Link to comment

its say

client 94: call failed to call 'scoreboard:removeScoreboardCloumn'

client 95: call failed to call 'scoreboard:removeScoreboardCloumn'

client.lua:96: Bad argumnet @ 'guiSetVisble' [Expected gui-element at argument 1, got nill]

  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[1] = guiCreateWindow(484,199,553,326,"[@~Call OF Duty MW3 Settings @~]",false) 
guiWindowSetMovable(GUIEditor_Window[1],false) 
guiWindowSetSizable(GUIEditor_Window[1],false) 
GUIEditor_Image[1] = guiCreateStaticImage(9,20,535,194,"images/COD.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(386,256,158,43,"Yes, i Want",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[1],"clear-normal") 
GUIEditor_Button[2] = guiCreateButton(9,251,159,46,"No, i Dont",false,GUIEditor_Window[1]) 
guiSetFont(GUIEditor_Button[2],"clear-normal") 
GUIEditor_Label[1] = guiCreateLabel(111,221,364,16,"Do You Want To Show COD MW3 Level System And Exp ?",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,0) 
guiSetFont(GUIEditor_Label[1],"clear-normal") 
showCursor ( true ) 
  
addEvent ( "playSound" , true ) 
addEventHandler ( "playSound" , root , 
function() 
playSound ( "sounds/levelup.wav" , false ) 
end) 
  
GUIEditor_Window = {} 
GUIEditor_Grid = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
GUIEditor_Window[2] = guiCreateWindow( 423,220,477,311,"Level_System v3.0 ",false ) 
guiWindowSetMovable( GUIEditor_Window[2],false ) 
guiWindowSetSizable( GUIEditor_Window[2],false ) 
guiSetVisible( GUIEditor_Window[2],false ) 
GUIEditor_Grid[1] = guiCreateGridList( 9,21,264,281,false,GUIEditor_Window[2] ) 
guiGridListSetSelectionMode( GUIEditor_Grid[1],2 ) 
col = guiGridListAddColumn( GUIEditor_Grid[1],"Players",0.90 ) 
GUIEditor_Label[1] = guiCreateLabel( 286,43,144,23,"Level:",false,GUIEditor_Window[2] ) 
guiLabelSetColor( GUIEditor_Label[1],0,255,0 ) 
guiSetFont( GUIEditor_Label[1],"clear-normal" ) 
GUIEditor_Label[2] = guiCreateLabel( 284,95,102,21,"EXP:",false,GUIEditor_Window[2] ) 
guiLabelSetColor( GUIEditor_Label[2],0,0,255 ) 
guiSetFont( GUIEditor_Label[2],"clear-normal" ) 
GUIEditor_Image[1] = guiCreateStaticImage( 266,152,182,146,"images/mtalogo.png",false,GUIEditor_Window[2] ) 
  
if (col) then 
    for _, player in pairs( getElementsByType 'player' ) do 
        row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
        guiGridListSetItemText( GUIEditor_Grid[1],row,col,getPlayerName( player ),false,false ) 
    end 
end 
  
addEventHandler( 'onClientGUIClick',root, 
    function( ) 
        if (source == GUIEditor_Grid[1]) then 
            local theRow, theCol = guiGridListGetSelectedItem( source ) 
            if (theRow and theCol and theRow ~= -1 and theCol ~= -1) then 
                local playerName = guiGridListGetItemText( source,theRow, theCol ) 
                local player = getPlayerFromName(playerName) 
                if (player and isElement(player)) then 
                    local theEXP = getElementData(player, "ExP") or 0 
                    local theLevel = getElementData(player, "Level") or 0 
                    guiSetText(GUIEditor_Label[1], "Level: ".. tostring(theLevel)) 
                    guiSetText(GUIEditor_Label[2], "EXP: ".. tostring(theEXP)) 
                else 
                    guiSetText(GUIEditor_Label[1], "Level:") 
                    guiSetText(GUIEditor_Label[2], "EXP:") 
                end 
            else 
                guiSetText(GUIEditor_Label[1], "Level:") 
                guiSetText(GUIEditor_Label[2], "EXP:") 
            end 
        end 
    end 
) 
  
function levelup () 
    local Exp = getElementData(localPlayer,"ExP") 
    local Level = getElementData(localPlayer,"Level") 
    if isElement(expLabel) then destroyElement(expLabel) end 
    expLabel = guiCreateLabel(0.777,0.22,0.1708,0.0963,"ExP gained: ??\nTotal ExP: ".. tostring(Exp) .."\nLevel: ".. tostring(Level),true) 
    guiLabelSetColor(expLabel,0,255,0) 
    guiLabelSetVerticalAlign(expLabel,"top") 
    guiLabelSetHorizontalAlign(expLabel,"left",false) 
    guiSetFont(expLabel,"clear-normal") 
    setTimer ( levelup, 2000, 1) 
end 
setTimer ( levelup, 2000, 1) 
  
addEventHandler( 'onClientGUIClick',root, 
    function() 
        if (source == GUIEditor_Button[1]) then 
        outputChatBox("All Settings Are Enabled",source,255,255,0) 
        elseif (source == GUIEditor_Button[2]) then 
        showCursor ( false ) 
        call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "EXP") 
        call(getResourceFromName("scoreboard"), "removeScoreboardColumn", "Level") 
        guiSetVisible ( GUIEditor_Window[1], false ) 
        guiSetVisible ( GUIEditor_Window[2], false ) 
        outputChatBox("All Sestings Are Disbled",255,255,0) 
    end 
end 
) 

Edited by Guest
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...