Jump to content

Problema con funcion


di3g0

Recommended Posts

Hola a todos

tengo un problema con un script , de comprar bebidas... compro la bebida y todo va bien ,no puedo comprar otra mientras tenga esa en la mano

y la elimino apretando la tecla b(con bindkey) , pero despues quiero comprar bebida de nuevo y me muestra el ultimo mensaje , ese que dice: Ya tengo una bebida

 

y ahì ya no se como hacerle xD

 

animTimers={}

function buyDrink()

--si el dinero es 35 y no tienes activada la funciòn animation2 , activa animation2

    local money = getPlayerMoney( source )
    if (money >= 35 and not animTimers[source]) then
        setPedAnimation( source,"VENDING","VEND_Use", -1, false, true, true, false)
        animTimers[source] = setTimer(animation2,2500,1,source) 
        takePlayerMoney( source, 35 )


    --si es menor a 35 nada
    elseif money<35 then
    setPedAnimation( source,"ped","facsurpm", 0, false, true, false, true)
    outputChatBox( "No me alcanza el dinero...",source,200,0,0)
    else

--si dinero es 35 y tengo la funcion mostrar mensaje
    if money>=35 and animTimers[source] then
    outputChatBox( "Ya tengo una bebida...",source,200,0,0)
    end
    end
end

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...