Jump to content

que esta mal en esta funcion ?


iFoReX

Recommended Posts

que esta malo ? la verdad no recuerdo como usar unpack :$

addEventHandler("onClientRender",root, 
    function() 
    local table = {{255,0,0},{0,255,0},{0,0,255},{255,255,0},{0,255,255},{255,255,0},{0,0,0}} 
        dxDrawText("http://bhzserver.tuars.com",0.0,571.0,198.0,599.0,tocolor(setTimer(unpack[math.random(#table)],2000,0)),0.5,"bankgothic","left","top",false,false,false) 
        dxDrawText("Visit :",0.0,549.0,60.0,572.0,tocolor(255,255,255,255),0.7,"pricedown","left","top",false,false,false) 
    end 
) 

Link to comment

El unpack esta bien, pero el setTimer no tiene sentido.

local colores = 
    { 
        { 255, 0, 0 }, 
        { 0, 255, 0 }, 
        { 0, 0, 255 }, 
        { 255, 255, 0 }, 
        { 0, 255, 255 }, 
        { 255, 255, 0 }, 
        { 0, 0, 0 } 
    } 
  
setTimer ( 
    function ( ) 
        r, g, b = unpack ( colores [ math.random ( #colores ) ] ) 
    end 
    ,2000, 0 
) 
  
addEventHandler ( "onClientRender",root, 
    function ( ) 
        dxDrawText ( "http://bhzserver.tuars.com",0.0,571.0,198.0,599.0,tocolor(r,g,b,255),0.5,"bankgothic","left","top",false,false,false) 
        dxDrawText ( "Visit :",0.0,549.0,60.0,572.0,tocolor(255,255,255,255),0.7,"pricedown","left","top",false,false,false) 
    end 
) 

Link to comment

Muchas gracias solid funciona 100% :)

me ayudarias con esto ?, no me aparece el rango en el scoreboard :/

exports.scoreboard:addScoreboardColumn('Rango') 
  
setTimer( function () 
for p,v in ipairs ( getElementsByType("player") ) do 
local zK = getElementData(v,"Zombie Kills") 
if 'zK' >= '10' and 'zK' <= '50' then 
local novicio = setElementData(v,"Rango","Novicio") 
elseif 'zK' > '50' and 'zK' <= '100' then 
local amateur = setElementData(v,"Rango","Amateur") 
elseif 'zK' > '100' and 'zK' <= '150' then 
local kN = setElementData(v,"Rango","Killer Novicio") 
elseif 'zK' > '150' and 'zK' <= '200' then 
local kA = setElementData(v,"Rango","Killer Amateur") 
elseif 'zK' > '200' and 'zK' <= '250' then 
local k = setElementData(v,"Rango","Killer") 
end  
end 
end,1000,0) 

Link to comment

ahora, que esta mal en esto ?

exports.scoreboard:addScoreboardColumn('Clan') 
  
addEventHandler("onPlayerSpawn",root,function(thePlayer) 
local account = getPlayerAccount(thePlayer) 
local accName = getAccountName ( account ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then 
setAccountData(account,"Clan","BKZ Clan") 
elseif not isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then 
setAccountData(account,"Clan","Civil") 
end 
end 
) 

Link to comment

Nada, pero la Scoreboard usa Element Data no account Data:

exports.scoreboard:addScoreboardColumn('Clan') 
  
addEventHandler("onPlayerSpawn",root,function(thePlayer) 
local account = getPlayerAccount(thePlayer) 
local accName = getAccountName ( account ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then 
setAccountData(account,"Clan","BKZ Clan") 
setElementData(source,"Clan","BKZ Clan") 
elseif not isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then 
setAccountData(account,"Clan","Civil") 
setElementData(source,"Clan","Civil") 
end 
end 
) 

Link to comment
  • Recently Browsing   0 members

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