Jump to content

Level System Images


Recommended Posts

I made a level system with images, let me explain what it does is that when you go to the next level, an image is put, that's all, the problem is that I can't find the way to see the image when I log in or start the code. I hope I have explained I am using the google translator. Help me please

I'm a scrippting newbe

spacer.png

 

Spoiler



----------------- STATS--------------------------
stat = 
{10,
60,
70,
80, 
90, 
100, 
110,
120,
125,
200,
210,
220, 
230, 
240, 
250, 
260, 
270, 
280, 
290, 
300, 
310, 
320,
330, 
340,
350,
360,
370,
380,
390,
400,
410,
420,
430}

-------------------------------------------------------
--setElementData(root, "Zo. Kills", 0)
--setElementData(root, "lev", 0)
-------------------------------------------------------
--local playerName = getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x","") 
--local player = getPlayerFromName(localPlayer)
local playerMoney = getPlayerMoney ( localPlayer )
--local team = getTeamName (localPlayer)
--------------------------------------------------------------------------------------------------------------------  TEXT/GUI STUFF
 function resourceStart ()
  bindKey ("F3", "down", menuShow)
end
addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart)
--
function menuShow ()
	visableornot = guiGetVisible (venta)
	if (visableornot == true) then
		guiSetVisible (venta, false)
		--showCursor (false)
	end
	if (visableornot == false) then
		guiSetVisible (venta, true)
		--showCursor (true)
	end
end
--:zombiestat/
local screenSizex, screenSizey = guiGetScreenSize()
local screenW, screenH = guiGetScreenSize()
        venta = guiCreateStaticImage(10, (screenH - 277) / 2, 175, 277, ":Login/images/background_news.png", false)
guiSetVisible(venta, false)  
        ima = guiCreateStaticImage(46, 25, 91, 77, "Rank_00.png", false, venta)
		guiSetVisible(ima, false)  
		--
		ima1 = guiCreateStaticImage(46, 25, 91, 77, "Rank_01.png", false, venta)
		guiSetVisible(ima1, false)  
		--
		ima2 = guiCreateStaticImage(46, 25, 91, 77, "Rank_02.png", false, venta)
		guiSetVisible(ima2, false)
		--
		ima3 = guiCreateStaticImage(46, 25, 91, 77, "Rank_03.png", false, venta)
		guiSetVisible(ima3, false)
		--
		ima4 = guiCreateStaticImage(46, 25, 91, 77, "Rank_04.png", false, venta)
		guiSetVisible(ima4, false)  
		--
		ima5 = guiCreateStaticImage(46, 25, 91, 77, "Rank_05.png", false, venta)
		guiSetVisible(ima5, false)
		--
		ima6 = guiCreateStaticImage(46, 25, 91, 77, "Rank_06.png", false, venta)
		guiSetVisible(ima6, false)
        --		
		ima7 = guiCreateStaticImage(46, 25, 91, 77, "Rank_07.png", false, venta)
		guiSetVisible(ima7, false)  
		--
		ima8 = guiCreateStaticImage(46, 25, 91, 77, "Rank_08.png", false, venta)
		guiSetVisible(ima8, false)
		--
		ima9 = guiCreateStaticImage(46, 25, 91, 77, "Rank_09.png", false, venta)
		guiSetVisible(ima9, false) 
		--
		
		ima10 = guiCreateStaticImage(46, 25, 91, 77, "10.png", false, venta)
		guiSetVisible(ima10, false) 
		--
		ima11 = guiCreateStaticImage(46, 25, 91, 77, "11.png", false, venta)
		guiSetVisible(ima11, false) 
		--
		ima12 = guiCreateStaticImage(46, 25, 91, 77, "12.png", false, venta)
		guiSetVisible(ima12, false) 
		--
		ima13 = guiCreateStaticImage(46, 25, 91, 77, "13.png", false, venta)
		guiSetVisible(ima13, false) 
		--
		ima14 = guiCreateStaticImage(46, 25, 91, 77, "14.png", false, venta)
		guiSetVisible(ima14, false) 
		--
		ima15 = guiCreateStaticImage(46, 25, 91, 77, "15.png", false, venta)
		guiSetVisible(ima15, false) 
		--
		ima16 = guiCreateStaticImage(46, 25, 91, 77, "16.png", false, venta)
		guiSetVisible(ima16, false) 
		--
		ima17 = guiCreateStaticImage(46, 25, 91, 77, "17.png", false, venta)
		guiSetVisible(ima17, false) 
		--
		ima18 = guiCreateStaticImage(46, 25, 91, 77, "18.png", false, venta)
		guiSetVisible(ima18, false) 
		--
		ima19 = guiCreateStaticImage(46, 25, 91, 77, "19.png", false, venta)
		guiSetVisible(ima19, false) 
		--
		ima20 = guiCreateStaticImage(46, 25, 91, 77, "20.png", false, venta)
		guiSetVisible(ima20, false) 
		--
		ima21 = guiCreateStaticImage(46, 25, 91, 77, "21.png", false, venta)
		guiSetVisible(ima21, false) 
		--
		ima22 = guiCreateStaticImage(46, 25, 91, 77, "22.png", false, venta)
		guiSetVisible(ima22, false) 
		--
		ima23 = guiCreateStaticImage(46, 25, 91, 77, "23.png", false, venta)
		guiSetVisible(ima23, false) 
		--
		ima24 = guiCreateStaticImage(46, 25, 91, 77, "24.png", false, venta)
		guiSetVisible(ima24, false) 
		--
		ima25 = guiCreateStaticImage(46, 25, 91, 77, "25.png", false, venta)
		guiSetVisible(ima25, false) 
		--
		ima26 = guiCreateStaticImage(46, 25, 91, 77, "26.png", false, venta)
		guiSetVisible(ima26, false) 
		--
		ima27 = guiCreateStaticImage(46, 25, 91, 77, "27.png", false, venta)
		guiSetVisible(ima27, false) 
		--
		ima28 = guiCreateStaticImage(46, 25, 91, 77, "28.png", false, venta)
		guiSetVisible(ima28, false) 
		--
		ima29 = guiCreateStaticImage(46, 25, 91, 77, "29.png", false, venta)
		guiSetVisible(ima29, false) 
		--
		ima30 = guiCreateStaticImage(46, 25, 91, 77, "30.png", false, venta)
		guiSetVisible(ima30, false) 
		--
		ima31 = guiCreateStaticImage(46, 25, 91, 77, "31.png", false, venta)
		guiSetVisible(ima31, false) 
		--
		ima32 = guiCreateStaticImage(46, 25, 91, 77, "32.png", false, venta)
		guiSetVisible(ima32, false) 
		--
		ima33 = guiCreateStaticImage(46, 25, 91, 77, "33.png", false, venta)
		guiSetVisible(ima33, false) 
		--
        label1 = guiCreateLabel(10, 171, 155, 15, "Zombie Kills: "..getElementData(localPlayer, "Zo. Kills"), false, venta)
        guiSetFont(label1, "default-bold-small")
        guiLabelSetColor(label1, 241, 216, 13)
		--
        label2 = guiCreateLabel(10, 102, 62, 20, "Nivel: "..getElementData(localPlayer, "lev"), false, venta)
        guiSetFont(label2, "default-bold-small")
        guiLabelSetColor(label2, 254, 0, 0)
		--
        label3 = guiCreateLabel(10, 146, 110, 15, "Nombre:",false, venta)
        guiSetFont(label3, "default-bold-small")
		--
        label4 = guiCreateLabel(10, 196, 155, 15, "Player Kills:",false, venta)
        guiSetFont(label4, "default-bold-small")
        guiLabelSetColor(label4, 0, 191, 253)
		--
        label5 = guiCreateLabel(10, 122, 155, 14, "Money:", false, venta)
        guiSetFont(label5, "default-bold-small")
        guiLabelSetColor(label5, 0, 255, 0)
		
		label7 = guiCreateLabel(10, 220, 155, 14, "Clan: ", false, venta)
        guiSetFont(label7, "default-bold-small")
        guiLabelSetColor(label7, 255, 0, 0)
		--getTeamName
        label6 = guiCreateLabel(54, 0, 73, 15, "Stat Jugador", false, venta)
        guiSetFont(label6, "default-bold-small")
        guiLabelSetColor(label6, 251, 231, 0)  
--------
font2 = guiCreateFont("font.otf", 25)
--font = guiCreateFont("font.otf", 15)
ups = guiCreateLabel(0.4*screenSizex-110,0.5*screenSizey-81.9,500,500, "", false)
--lab = guiCreateLabel(0.9*screenSizex-110,0.9*screenSizey-81.5,300,200, "Zombies Killed: "..getElementData(localPlayer, "zombiesKilled").."\n\nLevel: "..getElementData(localPlayer, "lev"), false,venta)   
--guiSetFont(lab, font)
--guiLabelSetColor(lab, 255,0,0)
guiSetFont(ups, font2)
guiSetVisible(ups, false) 
--
name = function() 
  if guiGetVisible(label3, true) then
    guiSetText(label3, "Nombre: "  ..  getPlayerName(getLocalPlayer()):gsub( "#%x%x%x%x%x%x", "" ))
  else
    guiSetText(label3, "Nombre: N/A")
  end
end
addEventHandler("onClientRender", getRootElement(), name)
--
money = function()
  if guiGetVisible(label5, true) then
    guiSetText(label5, "Money: "  ..  getPlayerMoney(getLocalPlayer()) .. "$")
  else
    guiSetText(label5, "Money: N/A")
  end
end

addEventHandler("onClientRender", getRootElement(), money)
--[[
pla = function()
  if guiGetVisible(label4, true) then
    guiSetText(label4, "Player Kills: "   ..  getElementData(localPlayer, "Oldurme") .. "")
  else
    guiSetText(label4, "Player Kills: N/A")
  end
end
]]
--addEventHandler("onClientRender", getRootElement(), pla)
--
pla2 = function()
  if ( getPlayerTeam ( localPlayer ) )  then  guiSetText ( label7, "Clan: "..getTeamName ( getPlayerTeam ( localPlayer ) ) )
  else
    guiSetText(label7, "Clan: N/A")
  end
end

addEventHandler("onClientRender", getRootElement(), pla2)
--------------------------------------------------------------------------------------------------------------------
function pedStat(attacker) 
        local dat = getElementData(localPlayer, "Zo. Kills")
      if getElementData (source, "zombie") == true and attacker == localPlayer then
        setElementData(localPlayer, "Zo. Kills", dat+1)
        guiSetText(label1, "Zombie Kills: "..getElementData(localPlayer, "Zo. Kills"))
		guiSetText(label2, "Nivel: "..getElementData(localPlayer, "lev"))
		--guiSetVisible(ima, true)  
  end
--
    if dat == stat[1] then  
        guiSetVisible(ups, true)     
         setTimer(guiSetVisible, 5000, 1, ups, false)
         setElementData(localPlayer, "lev", 1)
       guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
	   guiSetVisible(ima1, true) 
	   --
    elseif dat == stat[2] then
        guiSetVisible(ups, true)    
         setTimer(guiSetVisible, 5000, 1, ups, false)
         setElementData(localPlayer, "lev", 2)
       guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
	   guiSetVisible(ima2, true) 
	 guiSetVisible(ima1, false) 
	 
	   --
    elseif dat == stat[3] then
 
        guiSetVisible(ups, true)    
         setTimer(guiSetVisible, 5000, 1, ups, false)
         setElementData(localPlayer, "lev", 3)
       guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
	   guiSetVisible(ima3, true) 
	     guiSetVisible(ima2, false) 

    elseif dat == stat[4] then
        guiSetVisible(ups, true)   		 
         setTimer(guiSetVisible, 5000, 1, ups, false)
         setElementData(localPlayer, "lev", 4)
       guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
	   guiSetVisible(ima4, true) 
	   guiSetVisible(ima3, false) 
    elseif dat == stat[5]  then
        guiSetVisible(ups, true)   		 
         setTimer(guiSetVisible, 5000, 1, ups, false)
         setElementData(localPlayer, "lev", 5)
       guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
	   guiSetVisible(ima5, true) 
	      guiSetVisible(ima4, false) 
    elseif dat == stat[6]  then
        guiSetVisible(ups, true)    
         setTimer(guiSetVisible, 5000, 1, ups, false)
         setElementData(localPlayer, "lev", 6)
       guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
	   guiSetVisible(ima6, true) 
	      guiSetVisible(ima5, false) 
	   --
    elseif dat ==   stat[7]  then
       guiSetVisible(ups, true)     
	    --guiSetVisible(ima, false)  		 
         setTimer(guiSetVisible, 5000, 1, ups, false)
          setElementData(localPlayer, "lev", 7)
       guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
       guiSetVisible(ima7, true)  
	      guiSetVisible(ima6, false) 
    elseif dat ==   stat[8]  then
       guiSetVisible(ups, true)      
	    --guiSetVisible(ima, false)  
         setTimer(guiSetVisible, 5000, 1, ups, false)
         setElementData(localPlayer, "lev", 8)
       guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
	   guiSetVisible(ima8, true) 
   guiSetVisible(ima7, false) 	   
    elseif dat ==     stat[9]  then
       guiSetVisible(ups, true)      
         setTimer(guiSetVisible, 5000, 1, ups, false)
         setElementData(localPlayer, "lev", 9)
       guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
	   guiSetVisible(ima9, true)  
	      guiSetVisible(ima8, false) 
       --
    elseif dat ==    stat[10]  then
       guiSetVisible(ups, true)     
        setTimer(guiSetVisible, 5000, 1, ups, false)
        setElementData(localPlayer, "lev", 10)
       guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
	   guiSetVisible(ima10, true) 
	   guiSetVisible(ima9, false) 
    elseif dat ==   stat[11]  then
       guiSetVisible(ups, true)      
         setTimer(guiSetVisible, 5000, 1, ups, false)
         setElementData(localPlayer, "lev", 11)
        guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
		guiSetVisible(ima11, true) 
		  guiSetVisible(ima10, false) 
    elseif dat ==   stat[12] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 12)
                 guiSetText(ups,"Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima12, true) 
				   guiSetVisible(ima11, false) 
    elseif dat ==  stat[13]  then
       guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 13)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima13, true) 
				   guiSetVisible(ima12, false) 
    elseif dat == stat[14] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 14)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima14, true) 
				   guiSetVisible(ima13, false) 
    elseif dat ==stat[15]  then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 15)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima15, true) 
				   guiSetVisible(ima14, false) 
				
    elseif dat == stat[16] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 16)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima16, true) 
				   guiSetVisible(ima15, false) 
				
    elseif dat ==  stat[17]  then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 17)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 	 guiSetVisible(ima17, true) 
				   guiSetVisible(ima16, false) 
				
    elseif dat ==  stat[18] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 18)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 	 guiSetVisible(ima18, true) 
				   guiSetVisible(ima17, false) 
    elseif dat ==  stat[19] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 19)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 	 guiSetVisible(ima19, true) 
				   guiSetVisible(ima18, false) 
    elseif dat ==  stat[20] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 20)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 	 guiSetVisible(ima20, true) 
				   guiSetVisible(ima19, false) 
    elseif dat ==  stat[21]  then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 21)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 	 guiSetVisible(ima21, true) 
				   guiSetVisible(ima20, false) 
    elseif dat == stat[22]  then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 22)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 	 guiSetVisible(ima22, true) 
				   guiSetVisible(ima21, false) 
    elseif dat == stat[23] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 23)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 	 guiSetVisible(ima23, true) 
				   guiSetVisible(ima22, false) 
    elseif dat == stat[24] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 24)
                 guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 	 guiSetVisible(ima24, true) 
				   guiSetVisible(ima23, false) 
    elseif dat == stat[25] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 25)
                guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
					 guiSetVisible(ima25, true) 
				   guiSetVisible(ima24, false) 
    elseif dat == stat[26] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 26)
                guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima26, true) 
				   guiSetVisible(ima25, false) 
				
    elseif dat == stat[27] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 27)
                guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima27, true) 
				   guiSetVisible(ima26, false) 
	elseif dat == stat[28] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 28)
                guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima28, true) 
				   guiSetVisible(ima27, false) 
	elseif dat == stat[29] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 29)
                guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima29, true) 
				   guiSetVisible(ima28, false) 
	elseif dat == stat[30] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 30)
                guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima30, true) 
				   guiSetVisible(ima29, false) 
	elseif dat == stat[31] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 31)
                guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima31, true) 
				   guiSetVisible(ima30, false) 
	elseif dat == stat[32] then
         guiSetVisible(ups, true)      
               setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 32)
                guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))
				 guiSetVisible(ima32, true) 
				   guiSetVisible(ima31, false) 
	elseif dat == stat[33] then
      guiSetVisible(ups, true)      
       setTimer(guiSetVisible, 5000, 1, ups, false)
                setElementData(localPlayer, "lev", 33)
                guiSetText(ups, "Has subido de Nivel! "..getElementData(localPlayer, "lev"))		
                 guiSetVisible(ima33, true) 
				   guiSetVisible(ima32, false) 				
   end
 end

addEventHandler("onClientPedWasted", root, pedStat)
addEventHandler("onClientResourceStart", root, pedStat)
--
--------------------- start actualizar
function serverData()
   guiSetText(label1, "Zombie Kills: "..getElementData(localPlayer, "Zo. Kills"))
  guiSetText (label2, "nivel: "..getElementData(localPlayer, "lev"))
 end

 

 

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