boro Posted August 7, 2014 Posted August 7, 2014 Hi all i try make script for show team health but it dont work please help. function showteamhealth ( command, snipers ) local steam = getTeamFromName ( Snipers ) if ( steam ) then for i, player in ipairs(getPlayersInTeam(steam)) do health = health + getElementHealth(player) outputChatBox("Team Snipers have" .. health .. " %health", getRootElement(), 255, 255, 255, true) end end end addCommandHandler ( "snipers", showteamhealth ) I'll help When I Can.
joaosilva099 Posted August 7, 2014 Posted August 7, 2014 first error i detected... local steam = getTeamFromName ( Snipers ) must be local steam = getTeamFromName ( "Snipers" ) try that... or u type "/snipers [team name]" http://i.imgur.com/CSE28MJ.png Don't hesitate to contact me for anything! If I can help, I will for sure! Education is the most powerful weapon which you can use to change the world. - Castillo
[UCG]Mike Posted August 7, 2014 Posted August 7, 2014 Snipers = "Snipers" local steam = getTeamFromName ( Snipers ) or try that You are now in Mark Zone !!!
boro Posted August 7, 2014 Author Posted August 7, 2014 Still dont work message dont are showed function showteamhealth ( command, snipers ) Snipers = "Snipers" local steam = getTeamFromName ( Snipers ) if ( steam ) then for i, player in ipairs(getPlayersInTeam(steam)) do health = health + getElementHealth(player) outputChatBox("Team Snipers have" .. health .. " %health", getRootElement(), 255, 255, 255, true) end end end addCommandHandler ( "snipers", showteamhealth ) I'll help When I Can.
Et-win Posted August 7, 2014 Posted August 7, 2014 ...No, look to the function. It has to be snipers instead of Snipers local steam = getTeamFromName ( snipers ) ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Et-win Posted August 7, 2014 Posted August 7, 2014 function showteamhealth ( command, snipers ) local steam = getTeamFromName ( snipers ) if ( steam ) then health = 0 for i, player in ipairs(getPlayersInTeam(steam)) do health = health + getElementHealth(player) end outputChatBox("Team "..steam.." has " .. tostring(health) .. " %health", getRootElement(), 255, 255, 255, true) end end addCommandHandler ( "snipers", showteamhealth ) This should work. PS: This gets the team you have entered in the command. (e.g. /snipers teamname1) ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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