Jump to content

esto esta bien?


Plate

Recommended Posts

Posted
function dxsetText() 
local UP = exports ["exp_system"]:getPlayerLevel(source) 
if UP >= 1 then 
 dxDrawText("110" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 2 then 
dxDrawText("160" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 3 then 
dxDrawText("240" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 4 then 
dxDrawText("500" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 5 then 
dxDrawText("2000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 6 then 
dxDrawText("4000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 7 then 
dxDrawText("8000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 8 then 
dxDrawText("12000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 9 then 
dxDrawText("16000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 10 then 
dxDrawText("20000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
end 
end 
addEventHandler("onChangeLevel",getRootElement(),dxsetText) 
addEventHandler("onClientRender",getRootElement(),dxsetText) 
  

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

No, la funcion getPlayerLevel es solo server side.

function dxsetText ( ) 
local UP = tonumber ( getElementData ( localPlayer, "level" ) ) or 0 
if UP >= 1 then 
 dxDrawText("110" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 2 then 
dxDrawText("160" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 3 then 
dxDrawText("240" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 4 then 
dxDrawText("500" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 5 then 
dxDrawText("2000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 6 then 
dxDrawText("4000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 7 then 
dxDrawText("8000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 8 then 
dxDrawText("12000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 9 then 
dxDrawText("16000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
elseif UP >= 10 then 
dxDrawText("20000" ,676.0,193.0,721.0,203.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) 
end 
end 
addEventHandler("onClientRender",getRootElement(),dxsetText) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Fuciona pero no se cambia el texto tampoco se dibuja otro

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
function dxsetText ( ) 
    local text = "" 
    local UP = tonumber ( getElementData ( localPlayer, "level" ) ) or 0 
    if ( UP == 1 ) then 
        text = "110" 
    elseif ( UP == 2 ) then 
        text = "160" 
    elseif ( UP == 3 ) then 
        text = "240" 
    elseif ( UP == 4 ) then 
        text = "500" 
    elseif ( UP == 5 ) then 
        text = "2000" 
    elseif ( UP == 6 ) then 
        text = "4000" 
    elseif ( UP == 7 ) then 
        text = "8000" 
    elseif ( UP == 8 ) then 
        text = "12000" 
    elseif ( UP == 9 ) then 
        text = "16000" 
    elseif ( UP == 10 ) then 
        text = "20000" 
    end 
    dxDrawText ( text, 676, 193, 721, 203, tocolor ( 255, 255, 255, 255 ), 1.0, "default", "left", "top", false, false, false ) 
end 
addEventHandler ( "onClientRender", root, dxsetText ) 

Eso funciona.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Loading script failed:levelup/main_c.lua:29:"("expected near dxsetText 

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

No es de este script, ya que lo probe antes de postearlo.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Ya encontre el error, lo que pasa es que vos estabas comparando si el nivel era: mayor o igual que 1, pero como 2 es mayor que 1, entonces iva a seguir poniendo "110", asi que tenias que comparar si era igual a 1, 2, 3, 4, etc...

Copia el ultimo codigo.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

De nada.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Nose si lo respondistes esto ya o no me quedo grabado pero se le puede poner una bazoka a un bot como lo puedo hacer y si no se puede por lo menos puedo finjir dandole una bazoka y luego ceando el projectil

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

  • Recently Browsing   0 members

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