LucasBaker Posted May 12, 2013 Share Posted May 12, 2013 I wish instead of skins were team, someone could help me? this script makes players who are not the team, do not enter the vehicle policeVehicles = { [598]=true,[596]=true,[597]=true,[599]=true } policeSkins = { [280]=true,[281]=true,[282]=true,[283]=true,[284]=true,[285]=true,[286]=true } function enterVehicle ( player, seat, jacked ) --when a player enters a vehicle if ( policeVehicles[getElementModel(source)] ) and ( not policeSkins[getElementModel(player)] ) then cancelEvent() outputChatBox ('#F08080[AVISO] #FF0000Este veículo pertence a Gang LEI!',getRootElement(),255,255,255,true) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) Link to comment
PaiN^ Posted May 12, 2013 Share Posted May 12, 2013 It's a wiki example -_-" Put i'll help you : teams = { 'team1', 'team2' } cars = { 240, 320 } function checkTeam( player ) for k,v in ipairs( teams ) do if getTeamName( getPlayerTeam( player ) ) == v then return true end end return false end addEventHandler( 'onVehicleStartEnter', root, function( player ) for k,v in ipairs( cars ) do if getElementModel( source ) == v then local check = checkTeam( player ) if not check then cancelEvent( ) outputChatBox( '#F08080[AVISO] #FF0000Este veículo pertence a Gang LEI!', root, 255, 255, 255, true ) end end end end ) Link to comment
LucasBaker Posted May 12, 2013 Author Share Posted May 12, 2013 yes wiki example , thanks 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