Mike269 Posted August 16, 2014 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
Saml1er Posted August 16, 2014 Posted August 16, 2014 This line: if team == getTeamFromName ( "Violet Killers MC" ) then
Mike269 Posted August 16, 2014 Author Posted August 16, 2014 another debug: ERROR: vkmc\vkmc.lua:13: attempt to index field '?' (a nil value) Whats wrong there?
Mike269 Posted August 16, 2014 Author Posted August 16, 2014 outputChatBox ( "Welcome to the vehicle of '".. getTeamName ( team ) .."'",
Mike269 Posted August 16, 2014 Author Posted August 16, 2014 oh its that local v = createVehicle ( vehicles [ i ] [ 1 ], vehicles [ i ] [ 2 ], vehicles [ i ] [ 3 ], vehicles [ i ] [ 4 ] )
Et-win Posted August 17, 2014 Posted August 17, 2014 The message says it all.... You forgot ')' to close something. (outputChatBox I suppose)
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