depato123 Posted May 16, 2013 Share Posted May 16, 2013 Necesito ayuda, estoy creando un resource de licencia de conducir desde 0 y estoy pensando en hacer esto (el gamemode es roleplay) al iniciar el juego darle a todos el skin 201 y a ese skin no le dejaria entrar a ningun auto hasta que haga un "examen" y cuando finalize ese examen cambiarle de skin y no dejarle usar el skin 201 y yo pense en esto: -- bloqueos ejVehicles = { [409]=false } ejSkins = { [201]=false } function ejenterVehicle ( player, seat, jacked ) if ( ejVehicles[getElementModel ( source )] ) and ( not ejSkins[getElementModel ( player )] ) and ( seat == 0 ) then removePedFromVehicle ( player )--force the player out of the vehicle outputChatBox ( "debes pasar la prueba de conducir.", player ) --and tell the player why end end addEventHandler ( "onVehicleEnter", getRootElement(), ejenterVehicle ) eso es lo que tenia planeado bueno si me pueden ayudar gracias Link to comment
Castillo Posted May 16, 2013 Share Posted May 16, 2013 function enterVehicle ( player, seat ) if ( getElementModel ( player ) == 201 and seat == 0 ) then outputChatBox ( "debes pasar la prueba de conducir.", player ) cancelEvent ( ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Probalo. Link to comment
depato123 Posted May 16, 2013 Author Share Posted May 16, 2013 (edited) function enterVehicle ( player, seat ) if ( getElementModel ( player ) == 201 and seat == 0 ) then outputChatBox ( "debes pasar la prueba de conducir.", player ) cancelEvent ( ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Probalo. ¿Osea que con eso cualquier el skin 201 no puede entrar a ningún auto pero cualquier otro si? Edited May 16, 2013 by Guest Link to comment
Castillo Posted May 16, 2013 Share Posted May 16, 2013 Copia el codigo de nuevo, me habia olvidado de algo. Link to comment
depato123 Posted May 29, 2013 Author Share Posted May 29, 2013 function enterVehicle ( player, seat ) if ( getElementModel ( player ) == 201 and seat == 0 ) then outputChatBox ( "debes pasar la prueba de conducir.", player ) cancelEvent ( ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Probalo. Tengo otra pregunta. ¿Se pueden agregar skins bloqueados? por ejemplo si yo quiero bloquear el 201,23 y 25 ¿se puede? Link to comment
StanMarsh Posted May 29, 2013 Share Posted May 29, 2013 function enterVehicle ( player, seat ) if ( getElementModel ( player ) == 201 and seat == 0 ) then outputChatBox ( "debes pasar la prueba de conducir.", player ) cancelEvent ( ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Probalo. Tengo otra pregunta. ¿Se pueden agregar skins bloqueados? por ejemplo si yo quiero bloquear el 201,23 y 25 ¿se puede? Sí. Link to comment
PhantomDamn Posted May 30, 2013 Share Posted May 30, 2013 agregalo todos los que quieras en la linea getElementModel... sino sabes como dale click a esto : getElementModel Link to comment
depato123 Posted May 30, 2013 Author Share Posted May 30, 2013 agregalo todos los que quieras en la linea getElementModel... sino sabes como dale click a esto :getElementModel ¿Puedo hacer esto? --> if ( getElementModel ( player ) == 201 , 23 , 25 and seat == 0 ) then ¿o sin espacios? if ( getElementModel ( player ) == 201,23,25 and seat == 0 ) then Link to comment
PhantomDamn Posted May 30, 2013 Share Posted May 30, 2013 no revisaste lo que te mande mira esto es un ejemplo de la wiki .. sencillo if id == 519 or id == 577 then Link to comment
depato123 Posted May 30, 2013 Author Share Posted May 30, 2013 no revisaste lo que te mande miraesto es un ejemplo de la wiki .. sencillo if id == 519 or id == 577 then Ha conque era eso... yo entendí otra cosa, pero igual ya lo solucione. Gracias igual Link to comment
Recommended Posts