Jump to content

LimoN>w<

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by LimoN>w<

  1. Quisiera saber si alguien podría ayudarme a poner un background en mi menú de freeroam

    Ya he probado agregando el siguiente texto en el archivo GUI y no ha funcionado, por favor si alguien podría ayudarme me vendría muy bien, gracias!  :D

    guiSetEnabled(guiCreateStaticImage(0, 0, wnd.width, wnd.height, 'background.jpg', true, elem), false)

     

  2. On 11/4/2018 at 15:56, kowixd said:

    @LimoN>w< si tienes el recurso "heligrab" el bind de "blackspace" se debe a eso ya que tiene un bind con "drop" ese recurso

            for key, state in pairs(getBoundKeys("jump")) do
                bindKey(key, "down", "grab")
            end
            --bindKey("lshift", "down", "grab", "")
            
            bindKey("backspace", "down", "drop", "")
        end

    gracias bro!!! Muchísimas gracias!!! Ya lo encontré y lo saque!! 

     

  3. 14 minutes ago, Simple01 said:

    Lo que pasa es que el evento de 'OnResourceStop' no esta controlado. Algo por el estilo debería valerte.

    
    local function turn_off()
    	local players = getElementsByType( 'player' )
      
      	for player_id = 1, #players do
        	local player = players[ player_id ]
        
        	local player_account = getPlayerAccount( player )
        
        	if ( ( player_account ) and not ( isGuestAccount( player_account ) ) ) then
          		local time_data = getElementData( player, 'Online' )
          		local online_keys = { { 'hour', 'Online-hour' }, { 'min', 'Online-min' }, { 'sec', 'Online-sec' }, 'Online' }
          		for i = 1, #online_keys do
            		if ( i == #online_keys ) then
              			setAccountData( player_account, online_keys[ i ], time_data )
              		else
              			setAccountData( player_account, online_keys[ i ][ 2 ], time_data[ i ][ 1 ] or 0 )
              		end
            	end
          	end
      	end
    end
    addEventHandler( "onResourceStop", resourceRoot, turn_off )
    

     

    Eso lo agrego despues de la ultima linea del lua del resource original?

  4. Buenas, yo tengo el resource de tiempo en el servidor, el cual guarda el tiempo total que el jugador tiene en el servidor (se haya desconectado o no)

    el problema es cuando se trata de darle stop o restart al resource, ya que el mismo una vez parado el resource o reiniciado borra todos los datos y se pierden

    Obviamente el stop lo he hecho porque he tenido problemas con el scoreboard ya que se ha bugeado y el tiempo en el servidor no aparecía y tenia que reiniciar el resource ocasionando que las horas de los jugadores se perdieran

    Si alguien me puede ayudar le agredeceria muchísimo!

    Dejo el codigo lua debajo

    exports.scoreboard:addScoreboardColumn('Online')
    
    local t = { }
     
    function checkValues( source,arg1,arg2)
        if (arg2 >= 60) then
            t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1
            t[ source ][ 'sec' ] = 0
        end
        if (arg1 >= 60) then
            t[ source ][ 'min' ] = 0
            t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1
        end
        return arg1, arg2
    end
         
    setTimer(
        function( )
            for _, v in pairs( getElementsByType( "player" ) ) do
                if (not t[ v ]) then
                    t[ v ] = {
                                ["hour"] = 0,
                                 ["min"] = 0,
                                 ["sec"] = 0
                                }
                end
     
                t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1
                local min,sec = checkValues (
                        v,
                        t[ v ][ 'min' ] or 0,
                        t[ v ][ 'sec' ] or 0
    						)  
    	local hour = tonumber( t[ v ][ 'hour' ] or 0 )
    
                setElementData(
                    v,
                    "Online",
                    tostring( hour )..':'..tostring( min )..':'..tostring( sec )
                )
            end
        end,
        1000, 0
    )
       
    function onPlayerQuit ( )
        local playeraccount = getPlayerAccount ( source )
        if ( playeraccount ) and not isGuestAccount ( playeraccount ) then
            local sValue = getElementData( source,'Online' )
    	local hour = tonumber( t[ source ][ 'hour' ] or 0 )
    	local min = tonumber( t[ source ][ 'min' ] or 0 )
    	local sec = tonumber( t[ source ][ 'sec' ] or 0 )
            setAccountData ( playeraccount, "Online-hour", tostring(hour) )
            setAccountData ( playeraccount, "Online-min", tostring(min) )
            setAccountData ( playeraccount, "Online-sec", tostring(sec) )
            setAccountData ( playeraccount, "Online", tostring(sValue) )
    
        end
        t[ source ] = nil
    end
     
    function onPlayerLogin (_, playeraccount )
        if ( playeraccount ) then
            local time = getAccountData ( playeraccount, "Online" )
    	local hou = getAccountData ( playeraccount, "Online-hour")
    	local min = getAccountData ( playeraccount, "Online-min")
    	local sec = getAccountData ( playeraccount, "Online-sec")
            if ( time ) then
                setElementData ( source, "Online", time )
    
                                 t[ source ]["hour"] = tonumber(hou)
                                 t[ source ]["min"] = tonumber(min)
                                 t[ source ]["sec"] = tonumber(sec)
                    else
                setElementData ( source, "Online",0 )
                setAccountData ( playeraccount, "Online",0 )
            end
        end
    end
    addEventHandler ( "onPlayerQuit", root, onPlayerQuit )
    addEventHandler ( "onPlayerLogin", root, onPlayerLogin )

  5. On 31/3/2018 at 14:28, aka Blue said:

    Creo que ésto debería ya funcionarte sin problemas.

    
    local pos = {
    
    	{ 1497.5999755859, -1853.0999755859, 2516 },
        { 1493.3000488281, -1829.8000488281, 2516 },
        { 1509.1999511719, -1827.3000488281, 2516 },	
    
    }
    
    local limitador = { }
    
    function dropPlayer( player )
    	if not limitador[player] then
    		local azar = math.random( 1, #pos )
    		local veh = getPedOccupiedVehicle( player )
    		if veh then
    			setElementPosition(veh, unpack ( pos [ azar ] ) )
    		else
    			setElementPosition(player, unpack ( pos [ azar ] ) )
    		end
    		outputChatBox ( "#FFFFFF[#00FF00Tele#FFFFFF] ".. getPlayerName(thePlayer) .." #FFFFFFFue para drop! (#00FF00/drop#FFFFFF)", root, 0, 255, 0, true )
    		limitador[player] = setTimer( function( ) limitador[player] = nil end, 5000, 1 )
    	else
    		local restante, _, _ = getTimerDetails(limitador[player])
    		outputChatBox( "Podras usar el comando en "..math.floor(restante).." segundos.", player, 255, 0, 0 )
    	end
    end
    addCommandHandler( "drop", dropPlayer )
    
    addEventHandler( "onPlayerJoin", getRootElement( ),
    	function( )
    		bindKey( source, "backspace", "down", dropPlayer )
    	end
    )
    
    addEventHandler( "onResourceStart", resourceRoot,
    	function( )
    		local jugadores = getElementsByType( 'player' )
    		for i=1, #jugadores do 
    			local jug = jugadores[i]
    			bindKey( jug, "backspace", "down", dropPlayer )
    		end
    	end
    )
    

     

    Pues ahora no aparece el texto de teleport cuando el jugador lo hace

  6. Buenas, les quería comentar que recientemente he intentado poner un timer sin exito para el drop, lo que yo quiero es que al poner el comando /drop en say, automáticamente se active un timer para que por si el jugador vuelve a tipear el comando deba esperar 5 segundos para volver a hacerlo, de esa manera no me harían un masivo floodeo con el comando, y ademas de eso el comando /drop queda bindeado con la tecla de "backspace" he buscado si en el archivo del teleport estaba la linea del bind pero no la encontré y a la hora de escribir o hacer ciertas cosas con otros resources se vuelve molesto apretar la tecla y que te mande a drop, sin mas que decir dejo la linea del teleport grcias!

     

    Aqui la linea del teleport : 

    local posicoes =
        {
            { 1497.5999755859, -1853.0999755859, 2516 },
            { 1493.3000488281, -1829.8000488281, 2516 },
            { 1509.1999511719, -1827.3000488281, 2516 },
        }
    	
    function PosicaoPlayer ( thePlayer, command )
        local azar = math.random ( #posicoes )
    	local veh = getPedOccupiedVehicle(thePlayer)
    		if (veh) then
    			setElementPosition(veh, unpack ( posicoes [ azar ] ) )
    		else
    			setElementPosition(thePlayer, unpack ( posicoes [ azar ] ) )
    		end	
    			outputChatBox ( "#FFFFFF[#00FF00Tele#FFFFFF] ".. getPlayerName(thePlayer) .." #FFFFFFFue para drop! (#00FF00/drop#FFFFFF)", root, 0, 255, 0, true )
    end
    addCommandHandler ( "drop", PosicaoPlayer  )

     

×
×
  • Create New...