Jump to content

giveHealth problem


Recommended Posts

Posted

Well I'm trying to create a script that when I write / givehealth, make him give life to those who are in my area .. eg first I tried to create with getZoneName, most did not work someone help me?

Script:

function giveHealth(source) 
    accountname = getAccountName (getPlayerAccount(source)) 
    if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
        for i,player in ipairs(getElementsByType("player")) do 
            setElementHealth(player, 200) 
        end 
        setTimer(outputChatBox,50,1,"#00FFFF[#00FFFFSERVER#00FFFF] #00FFFF"..getPlayerName (source) .. " #00FFFFDeu Vida Para todos os Jogadores",getRootElement(),171,205,239,true) 
    else 
        outputChatBox("#ABCDEF* Você não é um Administrador.",source,171,205,239,true) 
    end 
end 
addCommandHandler("darvida",giveHealth) 

I'm trying to use, it would be right?

GetZoneName 

Posted

to do players life 200

their Health stat must be 1000

so Try this:

function giveHealth(source) 
    local accountname = getAccountName (getPlayerAccount(source)) 
    if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
        for i,player in ipairs(getElementsByType("player")) do 
            setPlayerStat ( player, 24, 1000 ) 
            setElementHealth(player, 200) 
        end 
        setTimer(outputChatBox,50,1,"#00FFFF[#00FFFFSERVER#00FFFF] #00FFFF"..getPlayerName (source) .. " #00FFFFDeu Vida Para todos os Jogadores",getRootElement(),171,205,239,true) 
    else 
        outputChatBox("#ABCDEF* Você não é um Administrador.",source,171,205,239,true) 
    end 
end 
addCommandHandler("darvida",giveHealth) 

I'm trying to use, it would be right?

GetZoneName 

it would be right or no by how you will make it

Giving a Fuck? Nope, That isn't in My Skill Set

castie11.png

Posted

To get all players around you, you can calculate their distance with:

getDistanceBetweenPoints3D 

or:

getDistanceBetweenPoints2D 

Or you can also use colshapes:

createColTube 
getElementsWithinColShape 

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

You're welcome.

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