xArgonx Posted July 8, 2009 Share Posted July 8, 2009 I want to make a system that player avoid from using every car, the problem is, that i want that this system only works for the door 0 (driver seat) so a player who should not be allowed to enter on the driver's sead atlhought he can enter on the other seats here is the code i tried it out: ambulanceVehicles = { [416]=true } ambulanceSkins = {[274]=true, [276]=true} doors = {[0]=true} function enterAmbulanceVehicle ( player, seat, jacked, door ) if ( ambulanceVehicles[getVehicleID ( source )] ) and ( not ambulanceSkins[getPlayerSkin ( player )] ) and if (doors[ then [color=#BF0000]if door == 0[/color] cancelEvent() outputChatBox ( "Du darfst dieses vehicle nicht benutzen!", player, 255, 255, 255, true) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterAmbulanceVehicle ) Link to comment
50p Posted July 8, 2009 Share Posted July 8, 2009 Why don't you check if you get any errors? At line 7, the code doesn't seem to be finished or messed up. Make sure you don't get any errors. Line 8 also doesn't seem to be done. It will work if you'll keep an eye on all these brackets and "if ... then" not just "if ... ". Link to comment
xArgonx Posted July 8, 2009 Author Share Posted July 8, 2009 i know, i said that i don't know how to do it, that the reason for that line 7 and 8 are not finished, sry i should have explained that before Link to comment
50p Posted July 8, 2009 Share Posted July 8, 2009 ambulanceVehicles = { [416]=true } ambulanceSkins = {[274]=true, [276]=true} function enterAmbulanceVehicle ( player, seat, jacked, door ) if ( ( ambulanceVehicles[getVehicleID ( source )] ) and ( not ambulanceSkins[getPlayerSkin ( player )] ) and ( door == 0 ) ) then cancelEvent() outputChatBox ( "Du darfst dieses vehicle nicht benutzen!", player, 255, 255, 255, true) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterAmbulanceVehicle ) Link to comment
xArgonx Posted July 8, 2009 Author Share Posted July 8, 2009 thanks very much to u it works perfektly i try to think better while srcipting.. 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