Jump to content

simple clientside script not working


Pierce

Recommended Posts

Posted
function warnPlayersOfDamage(vehicle)
local pveh = getPedOccupiedVehicle (localPlayer)
local vhealth = getElementHealth(pveh)
  if vhealth < 260 then
     outputChatBox("Your vehicle is highly damaged. It may explode.",localPlayer,255,0,0)
  end
end
addEventHandler("onClientVehicleEnter",localPlayer,warnPlayersOfDamage)

im just doing this because im bored but this thing doesnt even react.no errors,nothing.

please help

Posted
function warnPlayersOfDamage(thePlayer, seat) 
local vhealth = getElementHealth(source) 
if vhealth < 260 then 
outputChatBox("Your vehicle is highly damaged. It may explode.", 255, 0, 0) 
end 
end 
addEventHandler("onClientVehicleEnter", root, warnPlayersOfDamage) 

The source of onClientVehicleEnter is the vehicle that the player entered.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...