Raised This Month: $51 Target: $400
 12% 

Compensation [v0.4]


Post New Thread Reply   
 
Thread Tools Display Modes
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 12-29-2016 , 17:26   Re: Compensation [v0.4]
Reply With Quote #21

No:
Code:
            PlayersID = szPlayers[i]             if(PlayersID != iDeadPlayer)                 compensation_chatcolor(szPlayers[i],"%s %L",szPrefix,szPlayers[i],"ENEMY_COMPENSATE_MESSAGE",iRandom <= 4 ? iMoneyBonus_First : iMoneyBonus_Second,szDeadName)

There is not point in caching it to avoid re-indexing, if you keep re-indexing it on `compensation_chatcolor`.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 12-29-2016 at 17:27.
addons_zz is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-29-2016 , 17:36   Re: Compensation [v0.4]
Reply With Quote #22

I'm reading this - https://wiki.alliedmods.net/Optimizi...s_Save_Results

And what I understand is for I use an variable for take the szPlayers[i] ammount.

Don't think i don't know how to write a plugin, I just because I have a bad english for write and understand too. Thats the reason for I don't undertand handred percent of your explainament.

So, the solution will be this?

PHP Code:
        new PlayersID
    
        
for(new 0;iNumPlayers;i++) 
        { 
            
PlayersID szPlayers[i]
            
            if(
PlayersID != iCompensatePlayer
            { 
                
compensation_chatcolor(PlayersID,"%s %L",szPrefix,PlayersID,"TEAM_COMPENSATE_PLAYER_MESSAGE",szCompensateName,iRandom <= iMoneyBonus_First iMoneyBonus_Second,szDeadName
            } 
        } 

        
get_players(szPlayers,iNumPlayers,"eh",szOppositeTeams[cs_get_user_team(iCompensatePlayer)]) 
        for(new 
0;iNumPlayers;i++) 
        { 
            
PlayersID szPlayers[i]
            
            if(
PlayersID != iDeadPlayer)
                
compensation_chatcolor(PlayersID,"%s %L",szPrefix,PlayersID,"ENEMY_COMPENSATE_MESSAGE",iRandom <= iMoneyBonus_First iMoneyBonus_Second,szDeadName
        } 
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 12-29-2016 at 17:37.
EFFx is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 12-29-2016 , 17:42   Re: Compensation [v0.4]
Reply With Quote #23

Yes, it is it.

I asked if you understood what was re-indexing a array and you said yes.
However now you say you do not understood what I explained.

___

Off topic: Naming:

Do not name something in plural, if it is not a resemble many. For example:
`new playersId` should be `new playerId` and `new playerId[32]` should be `new playersId[32]` or may be `new playerIds[32]`

If are using Hungarian Notation, do not prefix an Array with sz, which is used for null terminated strings.
May be ar, should resemble better. `new szPlayersId[]` versus `new arPlayersId[32]`. However on this case, seems not useful using the notation as the name in plural itself seems very clear about what it is.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 12-29-2016 at 17:55. Reason: Off topic: Naming
addons_zz is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-29-2016 , 17:45   Re: Compensation [v0.4]
Reply With Quote #24

I was confused, I was talking about the loop, but after I read the tutorial I seen that was the check and said no. My bad.

Edit: Plugin updated, waiting approvers check again...
Edit2:

Quote:
When you do `players[ index ]`, the computer does:
I'm dumb...

Edit3: About off-topic, okay. I got it
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 12-29-2016 at 18:16.
EFFx is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-30-2016 , 06:08   Re: Compensation [v0.4]
Reply With Quote #25

Try to apply what you learn everywhere, that's more important than getting the plugin approver.
In compensation_chatcolor you still reindex szPlayers(also sz is not a proper prefix, it's not a string)

Also, instead of always doing iRandom <= 4 ? iMoneyBonus_First : iMoneyBonus_Second just save this into a var, something like:
PHP Code:
new Reward iRandom <= iMoneyBonus_First iMoneyBonus_Second 
And use that.

Be consistent with { }, for example:
PHP Code:
if(PlayerID != iCompensatePlayer
            { 
                
compensation_chatcolor(PlayerID,"%L",PlayerID,"TEAM_COMPENSATE_PLAYER_MESSAGE",szCompensateName,Reward,szDeadName
            } 


            if(
PlayerID != iDeadPlayer)
                
compensation_chatcolor(PlayerID,"%L",PlayerID,"ENEMY_COMPENSATE_MESSAGE",iRandom <= iMoneyBonus_First iMoneyBonus_Second,szDeadName
Two different styles, pick one and use it everywhere.
__________________

Last edited by HamletEagle; 12-30-2016 at 06:10.
HamletEagle is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-30-2016 , 16:40   Re: Compensation [v0.4]
Reply With Quote #26

All things are done, waiting your answer...
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 12-30-2016 at 16:42.
EFFx is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-02-2017 , 05:15   Re: Compensation [v0.4]
Reply With Quote #27

Looks decent, hope I did not miss anything.
Approved.
__________________
HamletEagle is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-11-2017 , 12:33   Re: Compensation [v0.4]
Reply With Quote #28

Languages updated.
Added German language, thanks for Godofwar.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-16-2017 , 11:19   Re: Compensation [v0.3]
Reply With Quote #29

Quote:
Originally Posted by EFFx View Post
When you disconnect or you suicide, a player from enemy team receive an ammount
What's the point ?
__________________
edon1337 is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 01-16-2017 , 13:06   Re: Compensation [v0.4]
Reply With Quote #30

Win mo money
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz 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 08:30.


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