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

Compensation [v0.4]


Post New Thread Reply   
 
Thread Tools Display Modes
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 11-24-2016 , 17:08   Re: Compensation [v0.3]
Reply With Quote #11

Quote:
Originally Posted by EFFx View Post
Like csgo, an enemy will receive the bonus every disconnect. But i dont recommend it for public server, this plugin is good for pug servers. But if you guys want him for public server, who is me for be against?
Yea yea is nice don't worry, personaly i like it.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-24-2016 , 17:15   Re: Compensation [v0.3]
Reply With Quote #12

Thank you, i appreciate it.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 11-24-2016 , 20:08   Re: Compensation [v0.3]
Reply With Quote #13

And here I thinking there is nothing new to do for the AMXX. Seems cool install it on my server.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-24-2016 , 21:15   Re: Compensation [v0.3]
Reply With Quote #14

Quote:
Originally Posted by addons_zz View Post
And here I thinking there is nothing new to do for the AMXX. Seems cool install it on my server.
I appreciate it.

Has so much thing for do on amxx, just open your mind for think in one.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 11-24-2016 at 21:19.
EFFx is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-29-2016 , 08:46   Re: Compensation [v0.3]
Reply With Quote #15

Well, looks mostly fine. Few things I would suggest:
-add ML
-Is HasTeam check really needed in Event_DeathMsg? I don't think so.
-Remove "public" from GiveCompensation, not everything has to be public. You would use that for functions that may be called from other plugin/modules. Your function can be private.
-You are using way too many (). For example:
PHP Code:
if ( ( iPlayers] != iCompensatePlayer ) )
if ( ( 
iKiller == iVictim ) && ( HasTeamiKiller ) ) ) 
And with the addition spaces your code becomes harder to read.
-In your two loops don't reindex the iPlayers array.
__________________
HamletEagle is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-29-2016 , 15:51   Re: Compensation [v0.3]
Reply With Quote #16

All things added, just:

What you mean with "reindex the iPlayers array"?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 12-29-2016 , 16:41   Re: Compensation [v0.4]
Reply With Quote #17

I think it is this:
Code:
    for( new index = 0; index < playersCount; index++ )     {         server_print( "I am indexing the player %d, for the fist time", players[ index ] )         server_print( "I am re-indexing the player %d, for the second time", players[ index ] )     }
Versus this:
Code:
    new player_id;     for( new index = 0; index < playersCount; index++ )     {         player_id = players[ index ];         server_print( "I am indexing the player %d, for the fist time", player_id )         server_print( "I am still indexing the player %d, for the first time", player_id )     }

When you access an array more than one time, cache its value on a variable, otherwise you will to spend CPU time recalculating the array index each time.
When you do `players[ index ]`, the computer does:
Code:
players array base address + index
After it it finally access the index you want to. However, if you cache the value, this calculation is performed only only time for that index, saving CPU cycles.
__________________
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:22. Reason: misspelling
addons_zz is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-29-2016 , 17:14   Re: Compensation [v0.4]
Reply With Quote #18

I have two loopings, the first is for give a message for the compensate player's team. And the other is for give a message for the enemy team of the compensate player. How you suggest to edit there?
__________________
• 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:16.
EFFx is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 12-29-2016 , 17:20   Re: Compensation [v0.4]
Reply With Quote #19

Hey, if you understood what I said, you already know were it is.

Update: I checked you code, it is there on both your loops, and it is looking for you, just waiting for you to see it.
__________________
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:24. Reason: Update
addons_zz is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-29-2016 , 17:24   Re: Compensation [v0.4]
Reply With Quote #20

Yes, I understand what you said, but both loopings is for different teams.

PHP Code:
        new PlayersID

        
for(new 0;iNumPlayers;i++) 
        { 
            
PlayersID szPlayers[i]

            if(
PlayersID != iCompensatePlayer
            { 
                
compensation_chatcolor(szPlayers] , "%s %L",szPrefix,szPlayers[i],"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(szPlayers[i],"%s %L",szPrefix,szPlayers[i],"ENEMY_COMPENSATE_MESSAGE",iRandom <= iMoneyBonus_First iMoneyBonus_Second,szDeadName
        } 
This?
__________________
• 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:24.
EFFx 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 14:09.


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