Baseplate Posted September 9, 2011 Share Posted September 9, 2011 well I wanna change this code from using Skins ID to Teams Names copVehicles = { [523]=true,[598]=true,[596]=true,[597]=true,[599]=true } copSkins = { [280]=true,[281]=true,[282]=true,[283]=true,[284]=true,[288]=true } function copenterVehicle ( player, seat, jacked ) if ( copVehicles[getElementModel ( source )] ) and ( not copSkins[getElementModel ( player )] ) and ( seat == 0 ) then removePedFromVehicle ( player )--force the player out of the vehicle outputChatBox ( "You aren't a Police Officer , you mayn't drive this.", player ) --and tell the player why end end addEventHandler ( "onVehicleEnter", getRootElement(), copenterVehicle ) Link to comment
audi868 Posted September 9, 2011 Share Posted September 9, 2011 create a table for teams. e.g copTeams = {["Team"]=true,["Team2"]=true} replace copSkins[getElementModel ( player )] ) with copTeams[getTeamName(getPlayerTeam( player ))] Link to comment
Baseplate Posted September 9, 2011 Author Share Posted September 9, 2011 can u give me the hole code please Link to comment
bandi94 Posted September 9, 2011 Share Posted September 9, 2011 (edited) copVehicles = { [523]=true,[598]=true,[596]=true,[597]=true,[599]=true } copTeam= { ["TeamName"]=true } function copenterVehicle ( player, seat, jacked ) local team = getPlayerTeam(player) if ( copVehicles[getElementModel ( source )] ) and ( not copTeam[getTeamName ( team )] ) and ( seat == 0 ) then removePedFromVehicle ( player )--force the player out of the vehicle outputChatBox ( "You aren't a Police Officer , you mayn't drive this.", player ) --and tell the player why end end addEventHandler ( "onVehicleEnter", getRootElement(), copenterVehicle ) not tested but sould work Edited September 9, 2011 by Guest Link to comment
Castillo Posted September 9, 2011 Share Posted September 9, 2011 copVehicles = { [523]=true,[598]=true,[596]=true,[597]=true,[599]=true } copTeams = {["Team"]=true,["Team2"]=true} function copenterVehicle ( player, seat, jacked ) if ( copVehicles[getElementModel ( source )] ) and ( not copTeams[getTeamName(getPlayerTeam( player ))] ) and ( seat == 0 ) then removePedFromVehicle ( player )--force the player out of the vehicle outputChatBox ( "You aren't a Police Officer , you mayn't drive this.", player ) --and tell the player why end end addEventHandler ( "onVehicleEnter", getRootElement(), copenterVehicle ) Link to comment
Baseplate Posted September 9, 2011 Author Share Posted September 9, 2011 well is there anyway to make it in place of get in the car and get jacked out of it to if he press Enter he can't get in it and show him at a GUI You aren't a Police Officer , you mayn't drive this. Link to comment
Baseplate Posted September 9, 2011 Author Share Posted September 9, 2011 guys any help? Link to comment
bandi94 Posted September 9, 2011 Share Posted September 9, 2011 (edited) use addEventHandler ( "onVehicleStartEnter", getRootElement(), copenterVehicle ) and guiCreateWindow guiCreateLabel guiCreateButton guiSetVisible showCursor "onClientGUIClick" Edited September 9, 2011 by Guest 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