Jump to content

setPedStat problem


|H|TiTanium

Recommended Posts

I have already created the Ped, using slothbot and an argument like this

local cachorro2 = blablablabla

setPedStat( cachorro2, 24, 999 ) 

So basically I'm trying to increase Ped's health using setPedStat, so ID is 247 and max_health should be set to 999 ( As I think it's the maximum ... )

But it doesn't work, it's the same ease to kill the Ped ;(((. Please may someone teach me how do I do it ?

Link to comment

What is better ? Making Ped invencible ( making a setTimer function to increase Ped's health every x seconds ) or making him with a big life ?

Also , I was trying to add what you told me to. I got no result, I don't know if I'm making it rightly.

I tested on server-side, no result:

addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), 
    function() 
        exports [ "extra_health" ]:setElementExtraHealth  ( cachorro2, 999 ) 
    end 
) 

Also tried on Client-side, but doesn't work at all. please teach me how.

Link to comment

Ped is created on server-side, so I thought it should be also created on server-side.

local cachorro2 = call (getResourceFromName("slothbot"), "spawnBot", x+3, y+1, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) 
else 
outputChatBox("Você não tem dinheiro para criar um PET", thePlayer, 225, 0, 0) 
    end  
end 
addCommandHandler( "cachorro2", petCao) 
  
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), 
    function() 
        exports [ "extra_health" ]:setElementExtraHealth  ( cachorro2, 999 ) 
    end 
) 

All arguments are already created, so it's not needed to show them all

Link to comment
local cachorro2 = call (getResourceFromName("slothbot"), "spawnBot", x+3, y+1, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) 
exports [ "extra_health" ]:setElementExtraHealth  ( cachorro2, 999 ) 
else 
outputChatBox("Você não tem dinheiro para criar um PET", thePlayer, 225, 0, 0) 
    end 
end 
addCommandHandler( "cachorro2", petCao) 

By the way, if you want to make it invulnerable, then you can use this function from my "extra_health":

exports [ "extra_health" ]:setElementInvulnerable ( cachorro2, true ) 

Link to comment

Is it possible to add your script to mine, because they will already have to download slothbot, and so it could look like this:

local tigre1 = call (getResourceFromName("slothbot"), "spawnBot", x+3, y+1, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) 
setElementData ( tigre1, "pet", cachorro ) 
setElementExtraHealth  ( tigre1, 999 ) 
else 
outputChatBox("Você não tem dinheiro para criar um PET", thePlayer, 225, 0, 0) 
    end 
end 
addCommandHandler( "tigre", petTigre ) 

I'm getting an error, which says the client side couldn't be found...

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