Jump to content

Please help me to set player healt


xXNemesiSXx

Recommended Posts

setElementHealth 

so... this is my first script... the markers appear, but they don't give me the healt..

the script:

--Markers degli ospedali-- 
local ospsf = createMarker( -2655.0173339844, 639.79187011719, 13.404554367065, 'cylinder', 1.5, 255, 0, 0, 150 ) 
local ospls = createMarker( 2025.3673095703, -1402.7464599609, 16.185314178467, 'cylinder', 1.5, 255, 0, 0, 150 ) 
local osplv = createMarker( 1610.2142333984, 1819.5577392578, 9.7780055999756, 'cylinder', 1.5, 255, 0, 0, 150 ) 
-------------------------- 
  
--Ripristino della salute a Los Santos-- 
function Salutels( hitPlayer ) 
  
local localPlayer = getLocalPlayer() 
        setElementHealth ( localPlayer, 100 ) 
end 
  
addEventHandler( "onMarkerHit", ospls, Salutels ) 
---------------------------------------- 
  
--Ripristino della salute a San Fierro-- 
function Salutesf( hitPlayer ) 
  
local localPlayer = getLocalPlayer() 
        setElementHealth ( localPlayer, 100 ) 
end 
  
addEventHandler( "onMarkerHit", ospsf, Salutesf ) 
---------------------------------------- 
  
--Ripristino della salute a Las Venturas-- 
function Salutelv( hitPlayer ) 
  
local localPlayer = getLocalPlayer() 
        setElementHealth ( localPlayer, 100 ) 
end 
  
addEventHandler( "onMarkerHit", osplv, Salutelv ) 
------------------------------------------ 

where I went wrong? :x

sorry, i'm an italian noob... :|

Edited by Guest
Link to comment

thanks a lot... :) will it work now ?

--Markers degli ospedali-- 
local ospsf = createMarker( -2655.0173339844, 639.79187011719, 13.404554367065, 'cylinder', 1.5, 255, 0, 0, 150 ) 
local ospls = createMarker( 2025.3673095703, -1402.7464599609, 16.185314178467, 'cylinder', 1.5, 255, 0, 0, 150 ) 
local osplv = createMarker( 1610.2142333984, 1819.5577392578, 9.7780055999756, 'cylinder', 1.5, 255, 0, 0, 150 ) 
-------------------------- 
  
--Ripristino della salute a Los Santos-- 
function Salutesf ( hitPlayer, matchingDimension ) 
  
local localPlayer = getLocalPlayer() 
         
    setElementHealth ( localPlayer, 100 ) 
end 
  
addEventHandler( "onClientMarkerHit", ospls, Salutels ) 
---------------------------------------- 
  
--Ripristino della salute a San Fierro-- 
function Salutesf ( hitPlayer, matchingDimension ) 
  
local localPlayer = getLocalPlayer() 
         
    setElementHealth ( localPlayer, 100 ) 
end 
  
addEventHandler( "onClientMarkerHit", ospsf, Salutesf ) 
---------------------------------------- 
  
--Ripristino della salute a Las Venturas-- 
function Salutelv ( hitPlayer, matchingDimension ) 
  
local localPlayer = getLocalPlayer() 
         
    setElementHealth ( localPlayer, 100 ) 
end 
  
addEventHandler( "onClientMarkerHit", osplv, Salutelv ) 
------------------------------------------ 

Edited by Guest
Link to comment

*sigh* have you added this script to meta.xml as client type?

PS: you have 2 functions with the same name (Salutesf), and event handler with function Salutels, which doesnt exist.

i suppose the first function should be called Salutels.

you know you can fix your typos by yourself. use /debugscript 3 if you dont see them.

Link to comment
*sigh* have you added this script to meta.xml as client type?

PS: you have 2 functions with the same name (Salutesf), and event handler with function Salutels, which doesnt exist.

i suppose the first function should be called Salutels.

you know you can fix your typos by yourself. use /debugscript 3 if you dont see them.

-.- -.- -.- !! i'm very stupid !! -.- -.- -.-

:lol::lol: now it works, you are the best !! :lol::lol:

Link to comment

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