Jump to content

detectar level


Recommended Posts

Posted

Buenas, necesito una pequeña ayuda

Me cranie la cabeza como 1 hora.

Aun no me entra bien el tema del > o el <

no me digan > es mayor y el < es menor, porq eso lo tengo claro

El problema es este

function privatizar( thePlayer ) 
id = getElementModel(source) 
cLevel = getElementData( thePlayer, "Level" ) 
  
if id == 487 or id == 497 or id == 488 then  
if cLevel > "1" and cLevel < "5" then 
         exports.errorwindow: show ( thePlayer, "error", "You need #ff0000Level 5 #ffffffto enter this vehicle.", 2000, "Error",false) 
        cancelEvent() 
        end 
    end 
end 
addEventHandler("onVehicleStartEnter", getRootElement(), privatizar) 

Solo el que tiene exactamente el nivel 5 puede subir, El resto no.

Gracias

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

Intentá asi. PD Edité el post.

function privatizar( thePlayer ) 
 --Ni no te sirve thePlayer, usá localPlayer. 
local id = getElementModel(thePlayer) 
local cLevel = getElementData( thePlayer, "Level" ) 
  
if id == 487 or id == 497 or id == 488 then 
if ( cLevel >= 1 ) and ( cLevel <= 5 )then 
         exports.errorwindow: show ( thePlayer, "error", "You need #ff0000Level 5 #ffffffto enter this vehicle.", 2000, "Error",false) 
        cancelEvent() 
        end 
    end 
end 
addEventHandler("onVehicleStartEnter", getRootElement(), privatizar) 

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted

no man, no me funciona. y estoy usando the player como primer argumento de vehiclestart

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted (edited)
no man, no me funciona. y estoy usando the player como primer argumento de vehiclestart

Pero te aparece algun error o algo? O simplemente no pasa nada? Estás seguro de que el export es asi?

Probáste con onClientVehicleStartEnter?

Edited by Guest

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted

noo, ya encontre el errror, muchas gracias por tu tiempo man.

Mala redaccion mia, lo tube que leer como 20 veces el codigo jajaja

gracias :D

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted

me estaba enrredando con los >= <= al final era asi

if id == 487 or id == 497 or id == 488 then

if (getElementData( thePlayer, "Level" ) <= "4") then

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted
me estaba enrredando con los >= <= al final era asi

if id == 487 or id == 497 or id == 488 then

if (getElementData( thePlayer, "Level" ) <= "4") then

:mrgreen: Me alegro de que se te haya resuelto.

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

  • Recently Browsing   0 members

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