tim260 Posted September 24, 2011 Share Posted September 24, 2011 copVehicles = { [470]=true,[433]=true,[548]=true,[532]=true,[425]=true } copTeams = {["Police"]=true,["Cop"]=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 ) If i wanna make this for military vehicles what do i change ? do i do it like this ? : militaryVehicles = { [523]=true,[598]=true,[596]=true,[597]=true,[490]=true } copTeams = {["Military"]=true,["Naval"]=true} function copenterVehicle ( player, seat, jacked ) if ( militaryvehiclesVehicles[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 Military Officer , you mayn't drive this.", player ) --and tell the player why end end addEventHandler ( "onVehicleEnter", getRootElement(), copenterVehicle ) Link to comment
NotAvailable Posted September 24, 2011 Share Posted September 24, 2011 You should test the script first. Link to comment
tim260 Posted September 24, 2011 Author Share Posted September 24, 2011 Both didnt work can you help me ? Link to comment
CapY Posted September 24, 2011 Share Posted September 24, 2011 There is no need to change variables , try with cancelEvent handler. Link to comment
Castillo Posted September 24, 2011 Share Posted September 24, 2011 I would suggest using onVehicleStartEnter, then you can cancel the function before being executed. militaryVehicles = { [523]=true,[598]=true,[596]=true,[597]=true,[490]=true } copTeams = {["Military"]=true,["Naval"]=true} function copenterVehicle ( player, seat, jacked ) if ( militaryvehiclesVehicles[getElementModel ( source )] ) and ( not copTeams[getTeamName(getPlayerTeam( player ))] ) and ( seat == 0 ) then outputChatBox ( "You aren't a Military Officer , you mayn't drive this.", player ) --and tell the player why cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), copenterVehicle ) Link to comment
tim260 Posted September 24, 2011 Author Share Posted September 24, 2011 Hmm Solidsnake it doesnt work probably its me making a mistake here so now i will thake this oppertunity to show this : ( its also not working but i dont know why ) function replaceTXD() txd = engineLoadTXD("textures/billbrd01_lan.txd") engineImportTXD(txd, 4238) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceTXD) /\ thats my replacement for a billboard but it doesnt work, below my meta \/ type="script" version="1.0" author="tim"/> type="client" src="textures/billbrd01_lan.txd"/> Link to comment
Castillo Posted September 24, 2011 Share Posted September 24, 2011 Does that meta.xml even work? it's a mess o_O. <meta> <info type="script" version="1.0" author="tim"/> <file src="textures/billbrd01_lan.txd" type="client"/> </meta> type goes after src. Link to comment
tim260 Posted September 24, 2011 Author Share Posted September 24, 2011 Does that meta.xml even work? it's a mess o_O. <meta> <info type="script" version="1.0" author="tim"/> <file src="textures/billbrd01_lan.txd" type="client"/> </meta> type goes after src. LOL thats how it looks how you wrote it 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