tim260 Posted September 24, 2011 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 )
CapY Posted September 24, 2011 Posted September 24, 2011 There is no need to change variables , try with cancelEvent handler.
Castillo Posted September 24, 2011 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
tim260 Posted September 24, 2011 Author 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"/>
Castillo Posted September 24, 2011 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
tim260 Posted September 24, 2011 Author 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
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