Jump to content

Is this right?


Lloyd Logan

Recommended Posts

Posted

Hey, is this piece of code correct?

local health = getElementHealth( thePlayer ) 
    if (health=<50) then 

I am not sure about the second line? WHat the layout of that should be?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

Perfect! How would i get the health of a vehicle!

Thanks

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
Perfect! How would i get the health of a vehicle!

Thanks

getElementHealth: This function returns the current health for the specified element. This can be a player, a ped, or a vehicle.

CiTLh.png
Posted
Perfect! How would i get the health of a vehicle!

Thanks

getElementHealth: This function returns the current health for the specified element. This can be a player, a ped, or a vehicle.

I done this but it always says Your car is fine? even if my car is on fire.

function healthin( thePlayer ) 
    local vehiclee = getPedOccupiedVehicle( thePlayer ) 
    if vehiclee then 
    local health = getElementHealth( vehiclee ) 
    if (health<=50) then 
    outputChatBox("Time For a repair!", thePlayer) 
    else 
    outputChatBox("Your car is fine!", thePlayer) 
    end 
else 
    outputChatBox("You're not in a vehicle!", thePlayer) 
    end 
end 
addCommandHandler("carh", healthin) 

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
function healthin( thePlayer ) 
    local vehiclee = getPedOccupiedVehicle( thePlayer ) 
    if vehiclee then 
    local health = getElementHealth( vehiclee ) 
    if (health<=500) then 
    outputChatBox("Time For a repair!", thePlayer) 
    else 
    outputChatBox("Your car is fine!", thePlayer) 
    end 
else 
    outputChatBox("You're not in a vehicle!", thePlayer) 
    end 
end 
addCommandHandler("carh", healthin) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

Thanks, is health out of 1000?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

Max vehicle health is 1000%.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Max vehicle health is 1000%.

Is there anyway to change the health value to 100 instead of 1000, so it would be /setcarhp 100?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
Max vehicle health is 1000%.

Is there anyway to change the health value to 100 instead of 1000, so it would be /setcarhp 100?

With math you can do it: 10*100 will do the job.

CiTLh.png
Posted
Max vehicle health is 1000%.

Is there anyway to change the health value to 100 instead of 1000, so it would be /setcarhp 100?

With math you can do it: 10*100 will do the job.

So, calculate in my script, that if a player enters /setcarhp 100, just multiply the 100 by 10?, and if so, how would I do this?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

Yes, that's right.

setElementHealth ( theVehicle, amount * 10 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...