LucasBaker Posted May 18, 2013 Share Posted May 18, 2013 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 Link to comment
K4stic Posted May 18, 2013 Share Posted May 18, 2013 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 Link to comment
Castillo Posted May 18, 2013 Share Posted May 18, 2013 To get all players around you, you can calculate their distance with: getDistanceBetweenPoints3D or: getDistanceBetweenPoints2D Or you can also use colshapes: createColTube getElementsWithinColShape Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now