Raised This Month: $ Target: $400
 0% 

[HELP]Save Group Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 10-18-2015 , 03:09   Re: [HELP]Save Group Damage
Reply With Quote #1

as i said, i have tried with a bool before and i saved values in the bool via user in the loop, but when a player joined the group the group damage for him was 0 instead of the damage done by the group before he joined.

Last time i tried with arrays, i didnt know what the heck im doing, and the result code is above...
btw, total inflicted damage is what im looking for

If anyone can show me the way, that would be great, im trying to figure it out for 3 days...

@chihuahuax

That is a variable, if i will use that to store the values, it will store inside the damage done by all the players on the server, i need to store only for a specific group, also there could be more groups created

Last edited by Depresie; 10-18-2015 at 03:40.
Depresie is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 10-18-2015 , 06:54   Re: [HELP]Save Group Damage
Reply With Quote #2

Quote:
Originally Posted by Depresie View Post
as i said, i have tried with a bool before and i saved values in the bool via user in the loop, but when a player joined the group the group damage for him was 0 instead of the damage done by the group before he joined.
That's not true, because a bool is either true or false. You can't store anything in them.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-18-2015 , 12:14   Re: [HELP]Save Group Damage
Reply With Quote #3

Quote:
Originally Posted by wickedd View Post
That's not true, because a bool is either true or false. You can't store anything in them.
You can store numbers in a bool, but you will get a tag mismatch. The same thing is for floats. This are just tags. Of course bool should only be used with true/false, but your afirmation could create confusions.
__________________

Last edited by HamletEagle; 10-18-2015 at 12:17.
HamletEagle is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-18-2015 , 12:56   Re: [HELP]Save Group Damage
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
You can store numbers in a bool, but you will get a tag mismatch. The same thing is for floats. This are just tags. Of course bool should only be used with true/false, but your afirmation could create confusions.
That's only because we are in Pawn here and there is only a signed long integer data-type. Other languages that have a true (no pun intended) boolean data-type would make a bigger stink out of it. May as well set him straight here.
__________________

Last edited by Bugsy; 10-18-2015 at 12:57.
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-18-2015 , 07:01   Re: [HELP]Save Group Damage
Reply With Quote #5

Quote:
Originally Posted by Depresie View Post
as i said, i have tried with a bool before and i saved values in the bool via user in the loop, but when a player joined the group the group damage for him was 0 instead of the damage done by the group before he joined.

Last time i tried with arrays, i didnt know what the heck im doing, and the result code is above...
btw, total inflicted damage is what im looking for
You sound like you have no idea what you're talking about. Again, a bool means true or false, those are the only 2 possible values. What you are actually using, whether you want to accept it or not, is an array of integers (numbers).

You are defining an array type of Array: Party_Ids[33] but are not using any of the cellarray natives. If you are not using the cellarray natives, just define an array simply as Party_Ids[33] with no 'Array:' tag.

You need to provide more code if you want help--providing a piece of code that can be compiled is always preferred so the code can be troubleshooted. You left out the get_party_index() function which could be the part of your code that is broken. How many parties are there? Not enough info to know what is going on.

I see you have:
PHP Code:
g_PartyData[Damage_In_Party
then you have
PHP Code:
g_PartyData[attacker][Damage_In_Party
This is 2 dimensional array, you can't just give it 1 index and expect it to know what you are trying to do. The code is only as smart as you tell it to be, it cannot read you mind.

You need to re-think your data handling and be consistent with it. What I would do is use a bit-field for each group, and assign players to it. Then use a separate variable to keep track of how much damage is associated with that group.
__________________

Last edited by Bugsy; 10-18-2015 at 07:26.
Bugsy is offline
Reply



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