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 )