roddydennvor Posted March 20, 2015 Share Posted March 20, 2015 Hii anyone , how to change this script , so when seatbelt is on , then the player can't get out from vehicle and when seatbelt on then cancelEvent 'crashThrowPlayerFromVehicle' function seatbelton ( player ) local check = isPedInVehicle ( player ) if ( check ) then local state = ( not getElementData ( player, "seatbelt" ) ) setElementData ( player, "seatbelt", state ) exports.global:sendLocalMeAction ( player, "takes their seatbelt ".. ( state and "on" or "off" ) ) else outputChatBox ( "You are not in a car!", player, 255, 0, 0 ) end end addCommandHandler ( "seatbelt", seatbelton ) Link to comment
HUNGRY:3 Posted March 20, 2015 Share Posted March 20, 2015 function seatbelton ( player ) if isPedInVehicle ( player ) then if getElementData ( player, "seatbelt" ) ) then cancelEvent () end addEventHandler ( "onVehicleStartExit", getRootElement(), seatbelton ) not tested dunno if it will work Link to comment
ALw7sH Posted March 20, 2015 Share Posted March 20, 2015 function seatbelton ( player ) if isPedInVehicle ( player ) then if getElementData ( player, "seatbelt" ) ) then cancelEvent () end addEventHandler ( "onVehicleStartExit", getRootElement(), seatbelton ) not tested dunno if it will work function seatbelton ( player ) if isPedInVehicle ( player ) then if getElementData ( player, "seatbelt" ) ) then cancelEvent () end end end addEventHandler ( "onVehicleStartExit", getRootElement(), seatbelton ) you missed 2 end Link to comment
roddydennvor Posted March 20, 2015 Author Share Posted March 20, 2015 so i must to add new event ? Link to comment
roddydennvor Posted March 20, 2015 Author Share Posted March 20, 2015 Just add event with this function ?? function seatbelton ( player ) if isPedInVehicle ( player ) then if getElementData ( player, "seatbelt" ) ) then cancelEvent () end end end addEventHandler ( "onVehicleStartExit", getRootElement(), seatbelton ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now