Jump to content

Problema con los 'end'


Alexs

Recommended Posts

Hola a Todos, tengo un problema rarisimo

547708_406777519367223_1929455324_n.jpg

Link: http://a4.sphotos.ak.fbcdn.net/hphotos-ak-ash3/547708_406777519367223_1929455324_n.jpg

El problema es que los end estan bien:

sw, sh = guiGetScreenSize() 
swm = sw - ( sw / 4 ) 
shm = sh - ( sh / 8 ) 
swk = sw - ( sw / 4.57 ) 
shk = sh - ( sh / 5.2 ) 
  
function render() 
  
local arma = getPedWeapon( localPlayer ) 
local vida = getElementHealth( localPlayer ) 
local vidar = math.floor(vida) 
local armor = getPedArmor( localPlayer ) 
local armors = math.floor(armor) 
local dinero = getPlayerMoney( ) 
local dineror = tostring(dinero)..'$ ' 
guiSetText(vidadata,vidar) 
guiSetText(armordata,armors) 
guiSetText(dinerodata,dineror) 
     if arma == 0 then 
dxDrawImage(swm,shm,swk,shk,"iconos/0.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) 
     if arma == 1 then 
dxDrawImage(swm,shm,swk,shk,"iconos/1.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) 
     if arma == 2 then 
dxDrawImage(swm,shm,swk,shk,"iconos/2.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) 
    end 
end 
addEventHandler("onClientRender",root,render) 

y la linea 69 es la ultima linea del script, eso es el ultimo cambio que hice, que esta mal?

Link to comment

Fijate que el error es logica. Cada if requiere de un end, porque la funcion va a pasar por ese if. En cambio si pones "elseif", no necesitara ya que es una condicion que se lee solo si el if principal no llega a ser certero (Capaz no me explique bien, pero la conclusion es que uses elseif).

Link to comment
  • Recently Browsing   0 members

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