Jump to content

[Duda] ¿Como puedo agregar una exepcion a cancelEvent?


depato123

Recommended Posts

hola, tengo un problema con este script

local vehroleq = createVehicle ( 436, -1323.3212890625, 2702.109375, 49.833282470703 ) 
 setElementRotation ( vehroleq, 0,0,210 ) 
  
  
function lice(player) 
    if getElementData( player, "carLicence" ) then 
        outputChatBox ( "Si Ves esto funciona",  player, 255, 193, 37, true )      
    else 
        outputChatBox ( "No Tienes Licencia de Autos",  player, 255, 193, 37, true ) 
        cancelEvent ( )   
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), lice ) 

¿Como puedo hacer que un user no pueda entrar a ningun vehiculo a exepcion del vehiculo "vehroleq"?

osea que un user no pueda entrar a ningun vehiculo pero al vehiculo vehroleq si pueda

Link to comment

así?

  
function lice(player) 
    if getElementData( player, "carLicence" ) then 
        outputChatBox ( "Si Ves esto funciona",  player, 255, 193, 37, true )      
    else 
        if source == vehroleq then 
        return 
        end 
        outputChatBox ( "No Tienes Licencia de Autos",  player, 255, 193, 37, true ) 
        cancelEvent ( )   
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), lice ) 

o así?

function lice(player) 
    if getElementData( player, "carLicence" ) then 
        outputChatBox ( "Si Ves esto funciona",  player, 255, 193, 37, true )      
    else 
        if source == vehroleq then return end 
        outputChatBox ( "No Tienes Licencia de Autos",  player, 255, 193, 37, true ) 
        cancelEvent ( )   
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), lice ) 

perdon, es que nunca use eso

Link to comment
local vehroleq = createVehicle ( 436, -1323.3212890625, 2702.109375, 49.833282470703 ) 
 setElementRotation ( vehroleq, 0,0,210 ) 
  
  
function lice( player ) 
    if source == vehroleq then return end 
    if getElementData( player, "carLicence" ) then 
        outputChatBox ( "Si Ves esto funciona",  player, 255, 193, 37, true )     
    else 
        outputChatBox ( "No Tienes Licencia de Autos",  player, 255, 193, 37, true ) 
        cancelEvent ( )  
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), lice ) 

Link to comment
  • Recently Browsing   0 members

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