BorderLine Posted June 12, 2013 Share Posted June 12, 2013 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 Link to comment
NodZen Posted June 12, 2013 Share Posted June 12, 2013 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) Link to comment
BorderLine Posted June 13, 2013 Author Share Posted June 13, 2013 no man, no me funciona. y estoy usando the player como primer argumento de vehiclestart Link to comment
NodZen Posted June 13, 2013 Share Posted June 13, 2013 (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 June 13, 2013 by Guest Link to comment
BorderLine Posted June 13, 2013 Author Share Posted June 13, 2013 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 Link to comment
NodZen Posted June 13, 2013 Share Posted June 13, 2013 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 Cual era el problema? Link to comment
BorderLine Posted June 13, 2013 Author Share Posted June 13, 2013 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 Link to comment
NodZen Posted June 13, 2013 Share Posted June 13, 2013 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 Me alegro de que se te haya resuelto. Link to comment
Bc# Posted June 13, 2013 Share Posted June 13, 2013 Con un: if (getElementData( thePlayer, "Level" ) < "5") then Hubiese sido suficiente, matemáticas everywhere. Link to comment
Recommended Posts