Jump to content

Otro error :/


AlvareZ_

Recommended Posts

No se por que no me quiere agarrar, en el debug me dice: Attempt to contatemate global 'Exp' (a bpolean value)

Client-Side:

  
Exp = "-" 
  
function hideIt(myExp) 
     Exp = myExp 
end 
addEvent("watafaka",true) 
addEventHandler("watafaka",root,hideIt) 
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("#878787Exp : #FF7700"..Exp, 0, 195, 183, 351, tocolor(0, 255, 251, 255), 1,"pricedown", "left", "center", false, false, true, true, false) 
    end 
) 
  

Server-Side:

function onZombieWasted(_,killer) 
    if (killer) then 
        if (getElementType(killer) == "player") and (getElementType(source) == "ped") then 
            if (getElementData(source, "zombie") == true) then 
                local account = getPlayerAccount(killer) 
                if account and not isGuestAccount(account) then 
                    local myExp = exports.exp_system:getPlayerLevel ( thePlayer ) 
                    triggerClientEvent(killer,"watafaka",killer,myExp) 
                end 
            end 
        end 
    end 
end 
addEventHandler("onPedWasted", root, onZombieWasted) 

Link to comment
donde estas obteniendo Exp?

seria

local myExp = exports.exp_system:getPlayerLevel ( thePlayer ) 
Exp = tostring (myExp) 

O

Exp = myExp 

Proba poniendo eso Server-Side

Usa:

getElementData ( localPlayer, "exp" ) 

addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("#878787Exp : #FF7700".. tostring ( getElementData ( localPlayer, "exp" ) ), 0, 195, 183, 351, tocolor(0, 255, 251, 255), 1,"pricedown", "left", "center", false, false, true, true, false) 
    end 
) 

Link to comment
  • Recently Browsing   0 members

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