Mike269 Posted August 16, 2014 Share Posted August 16, 2014 addEventHandler ( "onVehicleStartEnter", root, function ( thePlayer ) -- we should first check if it's a private vehicle. if ( vehicleTable [ source ] ) then -- if it's a private vehicle, get the player's team. local team = getPlayerTeam ( thePlayer ) -- if the player has a team, continue. Else, stop the function and avoid the player from entering the vehicle. if ( team ) then -- the player has a team, we should check if it's the right team! if ( team == getTeamFromName ( "Violet Killers MC" ) -- the team from the player matches the required team, he can enter now! outputChatBox ( "Welcome to the vehicle of '".. getTeamName ( team ) .."'", thePlayer, 0, 255, 0, true ) else -- the player is not in the right team, so cancel the event again! outputChatBox ( "This is a private vehicle, you can't enter it.", thePlayer, 255, 0, 0, true ) cancelEvent() end else outputChatBox ( "This is a private vehicle, you can't enter it.", thePlayer, 255, 0, 0, true ) cancelEvent() end end end ) Guys whats wrong here? Can anyone tell me debugscript says: https://fbcdn-sphotos-h-a.akamaihd.net/ ... 2543e26caa Link to comment
Saml1er Posted August 16, 2014 Share Posted August 16, 2014 This line: if team == getTeamFromName ( "Violet Killers MC" ) then Link to comment
Mike269 Posted August 16, 2014 Author Share Posted August 16, 2014 another debug: ERROR: vkmc\vkmc.lua:13: attempt to index field '?' (a nil value) Whats wrong there? Link to comment
Saml1er Posted August 16, 2014 Share Posted August 16, 2014 Which one is line thirteen? Link to comment
Mike269 Posted August 16, 2014 Author Share Posted August 16, 2014 outputChatBox ( "Welcome to the vehicle of '".. getTeamName ( team ) .."'", Link to comment
Mike269 Posted August 16, 2014 Author Share Posted August 16, 2014 oh its that local v = createVehicle ( vehicles [ i ] [ 1 ], vehicles [ i ] [ 2 ], vehicles [ i ] [ 3 ], vehicles [ i ] [ 4 ] ) Link to comment
Et-win Posted August 17, 2014 Share Posted August 17, 2014 The message says it all.... You forgot ')' to close something. (outputChatBox I suppose) 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