Raised This Month: $ Target: $400
 0% 

[HELP]Save Group Damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Depresie
Veteran Member
Join Date: Nov 2013
Old 10-18-2015 , 08:15   Re: [HELP]Save Group Damage
Reply With Quote #12

The way i got it partialy working was using an Array like this , with the multi dimensional array i couldn't get anything done...

PHP Code:
new g_PartyDamage[33
Then i made a loop inside take damage and i store all the damage into g_PartyDamage[33] like this

PHP Code:
new Players[32], user
        get_party_index
(attackerPlayers)
        for(new 
ig_PartyData[attacker][Amount_In_Party]; i++)
        {
            
user Players[i]
            if(
is_user_alive(attacker) && !zp_get_user_zombie(attacker))
            {
                
g_PartyDamage[user] += floatround(damage)
           
                if(
g_PartyDamage[user] >= get_pcvar_num(cvar_damage_reward))
                {
                    
zp_set_user_ammo_packs(userzp_get_user_ammo_packs(user) + get_pcvar_num(cvar_ammo_reward))
                    
g_PartyDamage[user] -= g_PartyDamage[user]
                    
                }
            }
        } 
Everything worked fine, the damage of the players within the group was stored togheter inside g_PartyDamage[33]

But when a new player joined, for him the PartyDamage displayed on the hud was 0 ...

I tried multi dimensional arrays, normal arrays, anything i could of seen and think off for 3-4 days... then i felt like i wanted to kill myself and came here...

Last edited by Depresie; 10-18-2015 at 08:19.
Depresie is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode