Raised This Month: $ Target: $400
 0% 

[error] duplication EventTeamScore


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Michell
Member
Join Date: Oct 2015
Old 10-26-2015 , 16:46   [error] duplication EventTeamScore
Reply With Quote #1

is having spoofing of events, how to fix?

PHP Code:
register_event("TeamScore""EventTeamScore""a"

PHP Code:
public EventTeamScore(){
        new 
team[32];
        
read_data(1,team,31);
       
        if (
equal(team,"CT"))
        {
                
iPonto] = read_data(2);
        }
        else if (
equal(team,"TERRORIST"))
        {
                
iPonto] = read_data(2);
        }
       
        if(
iLive){
               
                new 
SomaTempo iPonto] + iPonto]
                new 
SomaWinner iPonto] + iPrim]
                new 
SomaWinner2 iPonto] + iPrim]
                new 
SomaOverTime iPonto] + iOver]
                new 
SomaOverTime2 iPonto] + iOver]
               
               
                if(
iNorT){
                       
                        if(
SomaTempo  == 15){
                                
//troca time normal
                                //SomaTotalNormal()
                               
                                
FragMeio Frager();    
                                
MaisFraguer1 get_user_frags(FragMeio)
                               
                                
SomaPriTempo()
                               
                                
Tempo++
                                
set_task(3.0,"TrocaLado")
                               
                        }
                        if(
SomaWinner  == 16){
                                
//Aviso de Ganhador
                                //SomaTotalNormal()
                               
                                
FragFinal Frager();
                                
MaisFraguer2 get_user_frags(FragFinal)
                               
                                
//CT WIN
                                
CTWins()
                                
Resultado()
                                
set_task(3.0,"Fun")
                                
set_task(5.0,"MaisFrg")
                                
set_task(15.0,"ServerVoteMap")
                               
                        }
                        if(
SomaWinner2  == 16){
                                
//Aviso de Ganhador
                                //SomaTotalNormal()
                               
                                
FragFinal Frager();
                                
MaisFraguer2 get_user_frags(FragFinal)
                               
                                
//TR WIN
                                
TRWins()
                                
Resultado()
                                
set_task(3.0,"Fun")
                                
set_task(5.0,"MaisFrg")
                                
set_task(15.0,"ServerVoteMap")
                        }
                        if(
SomaWinner == 15 && SomaWinner2 == 15){
                                
//TrocaLado()
                                //SomaTotalNormal()
                               
                                
if(get_pcvar_num(VarMD3) == 1){
                                       
                                        
FragFinal Frager()
                                        
MaisFraguer2 get_user_frags(FragFinal)
                                       
                                        
EmpateFinal()
                                        
set_task(3.0,"Fun")
                                        
set_task(5.0,"MaisFrg")
                                        
set_task(15.0,"ServerVoteMap")
                                       
                                       
                                }
                                else if(
get_pcvar_num(VarMD3) != 1){
                                       
                                        
FragFinal Frager()
                                        
MaisFraguer2 get_user_frags(FragFinal)
                                       
                                        
SomaPriSegTempo()
                                        
Empate()
                                        
OverTime()
                                        
set_task(3.0,"TrocaLado")
                                }
                               
                        }
                }
                if(
iOvT){
                        if(
SomaTempo == 3){
                                
//troca time Over
                                //SomaTotalNormal()
                               
                                
FragMeioOver Frager();
                                
MaisFraguerOT2 get_user_frags(FragMeioOver)
                               
                                
SomaPriOver()
                               
                                
Tempo++
                                
set_task(3.0,"TrocaLado")
                        }
                        if(
SomaOverTime == 4){
                                
//aviso do ganhador
                                //SomaTotalNormal()
                               
                                
FragFinalOver Frager();
                                
MaisFraguerOT1  get_user_frags(FragFinalOver)
                               
                                
//CT WIN
                                
CTWinsOT()
                                
ResultadoOT()
                                
set_task(3.0,"Fun")
                                
set_task(5.0,"MaisFrg")
                                
set_task(5.0,"MaisFrgOT")
                                
set_task(15.0,"ServerVoteMap")
                        }
                        if(
SomaOverTime2 == 4){
                                
//Aviso do Ganhador
                                //SomaTotalNormal()
                               
                                
FragFinalOver Frager();
                                
MaisFraguerOT1  get_user_frags(FragFinalOver)
                               
                                
//TR WIN
                                
TRWinsOT()
                                
ResultadoOT()
                                
set_task(3.0,"Fun")
                                
set_task(5.0,"MaisFrg")
                                
set_task(5.0,"MaisFrgOT")
                                
set_task(15.0,"ServerVoteMap")
                        }
                        if(
SomaOverTime == && SomaOverTime2 == 3){
                                
//empate
                                //SomaTotalNormal()
                               
                                
FragFinalOver Frager();
                                
MaisFraguerOT1  get_user_frags(FragFinalOver)
                               
                                
// EMPATE      
                                
EmpateOT()
                                
ResultadoOT()
                                
set_task(3.0,"Fun")
                                
set_task(5.0,"MaisFrg")
                                
set_task(5.0,"MaisFrgOT")
                                
set_task(15.0,"ServerVoteMap")
                               
                        }
                }
        }

Michell is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-26-2015 , 18:13   Re: [error] duplication EventTeamScore
Reply With Quote #2

Are you sure you do not have 2 of the same plugins running? Maybe a test version and another version? Check your plugins.ini to be sure. If you want faster help, post code that I can paste in an IDE and compile without having to create a list of variables and things.

In the past I've spent time wondering why something wasn't working only to find out I either didn't enable the plugin in plugins.ini, or I had something else running that counteracted it.
__________________
Bugsy is offline
Michell
Member
Join Date: Oct 2015
Old 10-26-2015 , 18:17   Re: [error] duplication EventTeamScore
Reply With Quote #3

not have two plugins in plugins.ini
the original code and this.

Last edited by Michell; 10-27-2015 at 19:12.
Michell is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-26-2015 , 18:41   Re: [error] duplication EventTeamScore
Reply With Quote #4

The message is sent two times, one time for each team. Doing a simple test you could figure this out yourself.
PHP Code:
public EventTeamScore(){
    new 
team[32];
    
read_data(1,team,31);
    
server_print"TEAMSCORE=%s"team ); 
Output
Code:
TEAMSCORE=CT
TEAMSCORE=TERRORIST
__________________
Bugsy is offline
Michell
Member
Join Date: Oct 2015
Old 10-27-2015 , 19:13   Re: [error] duplication EventTeamScore
Reply With Quote #5

thank you...
Michell is offline
Michell
Member
Join Date: Oct 2015
Old 10-27-2015 , 21:11   Re: [error] duplication EventTeamScore
Reply With Quote #6

still there is duplication ...
Michell is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-27-2015 , 21:21   Re: [error] duplication EventTeamScore
Reply With Quote #7

You can do something like this, which will make it only fire your code once. Just be aware that you will not get the other teams score info. Whichever team the message is sent for first is the only one you will get.
PHP Code:
new g_LastTeamScoreCall;

public 
EventTeamScore()
{
    new 
iSysTime;
    
    if ( ( ( 
iSysTime get_systime() ) - g_LastTeamScoreCall ) < )
        return;
        
    new 
szTeam];
    
read_dataszTeam charsmaxszTeam ) );
    
    
//Code goes here

    
g_LastTeamScoreCall iSysTime;

I imagine that is not what you want since you are using both teams scores.

Try something like this. In this case, the code where you see '//Code for CT ' and '//Code for T' will only be fired one time. Anything outside of the switch statement will run twice.
PHP Code:
public EventTeamScore()
{
    new 
szTeam] , iScore;
    
    
read_dataszTeam charsmaxszTeam ) );
    
iScore read_data);
    
    switch ( 
szTeam] )
    {
        case 
'C':
        {
            
//Code for CT 
        
}
        case 
'T':
        {
            
//Code for T
        
}
    }

__________________

Last edited by Bugsy; 10-27-2015 at 21:23.
Bugsy is offline
Michell
Member
Join Date: Oct 2015
Old 10-27-2015 , 21:36   Re: [error] duplication EventTeamScore
Reply With Quote #8

sometimes it runs right, but when changing map, there begins another mix and mix it at the end of the this error.
I will test this other code.
Michell 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 17:55.


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