UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Problem with damaging players in coop.

broken avatar :(
Created 10 years ago
by Ege115
0 Members and 1 Guest are viewing this topic.
1,112 views
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
If I use a for loop for the players and then use radiusdamage, then it will double the damage when there are more players ingame. I don't want that, how can I make so it does as much damage in coop as it does on solo?
Code Snippet
Plaintext
      players = get_players();
for(i=0;i<players.size;i++)
        {
    if( distance( players[i].origin, trap_model.origin) <= 90 && !players[i] maps\_laststand::player_is_in_laststand())
            {

RadiusDamage(players[i].origin, 30, 30, 30);
    }
}
Thanks in advance.
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 3 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Community Mapper Elite
My Groups
More
My Contact & Social Links
More
Signature
Overrun
Lockdown
Overrun (Black Ops Mod)
Snowglobe
Leviathan
Abandoned School
Ski Resort
Leviathan Redux
×
JBird632's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
The way the code is setup should do the same damage for both coop and solo.
There must be something that is allowing the script to loop through again while in coop.
Marked as best answer by Ege115 10 years ago
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
The way the code is setup should do the same damage for both coop and solo.
There must be something that is allowing the script to loop through again while in coop.
Oh, ye I forgot. I have a while loop for this as well.
Code Snippet
Plaintext
cutting_players(trap_model)
{

secs = 0;
while(secs <= 120)
{
secs++;

        players = get_players();
        for(i=0;i<players.size;i++)
                {
if( distance( players[i].origin, trap_model.origin) <= 90 && !players[i] maps\_laststand::player_is_in_laststand())
                        {
                 RadiusDamage(players[i].origin, 30, 30, 30);
                        }
}
wait .5;
}
}

Post Merge: July 31, 2014, 06:40:37 pm
Nevermind, it got solved. n123q45 helped me with this by doing it like this and it worked.
Code Snippet
Plaintext
cutting_players(trap_model)
{

secs = 0;
while(secs <= 120)
{
secs++;

players = get_players();
for(i=0;i<players.size;i++)
{
if( distance( players[i].origin, trap_model.origin) <= 90 ||  distance( players[i].origin, trap_model.origin) <= 90 && players.size > 1 && !players[i] maps\_laststand::player_is_in_laststand())
{
if(players[i].health > 45)
                               {
players[i] DoDamage(30,(0,0,0));
}
else
                                {
RadiusDamage(players[i].origin, 30, 30, 30);
}
}
}
wait .5;
}
}
Last Edit: July 31, 2014, 06:40:37 pm by Ege115

 
Loading ...