Braedon Posted January 21, 2010 Share Posted January 21, 2010 i don't know if you can trigger a /me command from outputChatBox but however you can i would be interested to find out how. i have been working on a script that contains all the car commands like /lock, /engine, /lights and so on... i have these all sorted but with each of these commands i want a /me command to be entered for example: outputChatBox ( "/me turns his vehicles lights on." ) .This is not the only function that i have tried, but no matter what i try to get it to work i just cant. here is the script. any help would be appreciated. (this is an extremely un-finnished script, it is just the base.) (i am new to lua scripting and most of this was made from trial and error.) function currentvehicle ( ) playervehicle = getPedOccupiedVehicle (source) end addEventHandler("onPlayerVehicleEnter", getRootElement(), currentvehicle) function vehiclelock ( player ) if isVehicleLocked ( playervehicle ) then setVehicleLocked ( playervehicle, false ) outputChatBox ( "Vehicle Unlocked." ) else setVehicleLocked ( playervehicle, true ) outputChatBox ( "Vehicle Locked." ) if isVehicleLocked ( playervehicle ) == ( false ) then outputChatBox ( "Vehicle can not be Locked!" ) end end end addCommandHandler("lock", vehiclelock) function iscarlocked ( player ) if isVehicleLocked (playervehicle) then outputChatBox ("event triggered.") setVehicleEngineState ( playervehicle, false ) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), iscarlocked ) function showVehicleName ( player ) local vehicleName = getVehicleName ( playervehicle ) outputChatBox ( "Vehicle name: " .. vehicleName, thePlayer ) end addCommandHandler ( "vehiclename", showVehicleName ) function engine ( ) if getVehicleEngineState ( playervehicle ) then setVehicleEngineState ( playervehicle, false ) outputChatBox ( "Vehicle Engine Off." ) else setVehicleEngineState ( playervehicle, true ) outputChatBox ( "Vehicle Engine On." ) end end addCommandHandler("engine", engine) function checkvehiclelights ( ) if ( getVehicleOverrideLights ( playervehicle ) == 0 ) then setVehicleOverrideLights ( playervehicle, 1 ) outputChatBox ( "Vehicle Lights Set to Default" ) end end addEventHandler( "onPlayerVehicleEnter", getRootElement(), checkvehiclelights ) function vehiclelights ( ) if ( getVehicleOverrideLights ( playervehicle ) == 1) then setVehicleOverrideLights ( playervehicle, 2 ) outputChatBox ( "Vehicle Lights On" ) -- here is where i would put a command such as outputChatBox ( "/me turns his vehicles lights on" ) else setVehicleOverrideLights ( playervehicle, 1 ) outputChatBox ( "Vehicle Lights Off" ) -- here also but turning lights off. end end addCommandHandler( "lights", vehiclelights ) Link to comment
Braedon Posted January 21, 2010 Author Share Posted January 21, 2010 i don't know if you can trigger a /me command from outputChatBox but however you can i would be interested to find out how. i have been working on a script that contains all the car commands like /lock, /engine, /lights and so on... i have these all sorted but with each of these commands i want a /me command to be entered for example: outputChatBox ( "/me turns his vehicles lights on." ) .This is not the only function that i have tried, but no matter what i try to get it to work i just cant. here is the script. any help would be appreciated. (this is an extremely un-finnished script, it is just the base.) (i am new to lua scripting and most of this was made from trial and error.) function currentvehicle ( ) playervehicle = getPedOccupiedVehicle (source)endaddEventHandler("onPlayerVehicleEnter", getRootElement(), currentvehicle) function vehiclelock ( player ) if isVehicleLocked ( playervehicle ) then setVehicleLocked ( playervehicle, false ) outputChatBox ( "Vehicle Unlocked." ) else setVehicleLocked ( playervehicle, true ) outputChatBox ( "Vehicle Locked." ) if isVehicleLocked ( playervehicle ) == ( false ) then outputChatBox ( "Vehicle can not be Locked!" ) end endendaddCommandHandler("lock", vehiclelock) function iscarlocked ( player ) if isVehicleLocked (playervehicle) then outputChatBox ("event triggered.") setVehicleEngineState ( playervehicle, false ) endend addEventHandler ( "onPlayerVehicleEnter", getRootElement(), iscarlocked ) function showVehicleName ( player ) local vehicleName = getVehicleName ( playervehicle ) outputChatBox ( "Vehicle name: " .. vehicleName, thePlayer )endaddCommandHandler ( "vehiclename", showVehicleName ) function engine ( ) if getVehicleEngineState ( playervehicle ) then setVehicleEngineState ( playervehicle, false ) outputChatBox ( "Vehicle Engine Off." ) else setVehicleEngineState ( playervehicle, true ) outputChatBox ( "Vehicle Engine On." ) endendaddCommandHandler("engine", engine) function checkvehiclelights ( ) if ( getVehicleOverrideLights ( playervehicle ) == 0 ) then setVehicleOverrideLights ( playervehicle, 1 ) outputChatBox ( "Vehicle Lights Set to Default" ) endendaddEventHandler( "onPlayerVehicleEnter", getRootElement(), checkvehiclelights ) function vehiclelights ( ) if ( getVehicleOverrideLights ( playervehicle ) == 1) then setVehicleOverrideLights ( playervehicle, 2 ) outputChatBox ( "Vehicle Lights On" ) -- here is where i would put a command such as outputChatBox ( "/me turns his vehicles lights on" ) else setVehicleOverrideLights ( playervehicle, 1 ) outputChatBox ( "Vehicle Lights Off" ) -- here also but turning lights off. endendaddCommandHandler( "lights", vehiclelights ) Link to comment
Wojak Posted January 21, 2010 Share Posted January 21, 2010 i don't know if you can trigger a /me command from outputChatBox but however you can i would be interested to find out how.(...) i want a /me command to be entered for example: outputChatBox ( "/me turns his vehicles lights on." ) why? function vehiclelights (player ) -- The player who triggered the command local aName = getPlayerName(player) if ( getVehicleOverrideLights ( playervehicle ) == 1) then setVehicleOverrideLights ( playervehicle, 2 ) outputChatBox ( "Vehicle Lights On" ) outputChatBox (aName.. " turns his vehicles lights on",getRootElement(), 194, 103, 181) -- = /me turns his vehicles lights on. else setVehicleOverrideLights ( playervehicle, 1 ) outputChatBox ( "Vehicle Lights Off" ) outputChatBox (aName.. " turns his vehicles lights off",getRootElement(), 194, 103, 181) -- = /me turns his vehicles lights off. end end addCommandHandler( "lights", vehiclelights ) Link to comment
Wojak Posted January 21, 2010 Share Posted January 21, 2010 i don't know if you can trigger a /me command from outputChatBox but however you can i would be interested to find out how.(...) i want a /me command to be entered for example: outputChatBox ( "/me turns his vehicles lights on." ) why? function vehiclelights (player ) -- The player who triggered the command local aName = getPlayerName(player) if ( getVehicleOverrideLights ( playervehicle ) == 1) then setVehicleOverrideLights ( playervehicle, 2 ) outputChatBox ( "Vehicle Lights On" ) outputChatBox (aName.. " turns his vehicles lights on",getRootElement(), 194, 103, 181) -- = /me turns his vehicles lights on. else setVehicleOverrideLights ( playervehicle, 1 ) outputChatBox ( "Vehicle Lights Off" ) outputChatBox (aName.. " turns his vehicles lights off",getRootElement(), 194, 103, 181) -- = /me turns his vehicles lights off. end end addCommandHandler( "lights", vehiclelights ) 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