AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   edit a plugin text (https://forums.alliedmods.net/showthread.php?t=324635)

Ahmad111 05-21-2020 23:15

edit a plugin text
 
al salam alykom
hi guys

PHP Code:

#include < amxmodx >
#include < cstrike >
#include < ColorChat >

#pragma semicolon 1

#define SEMI_ACE 4


static const

    
PLUGIN[ ] =        "Ace_announcement",
    
VERSION[ ] =        "1.1",
    
AUTHOR[ ] =        "Rap^^",
    
    
TAG[ ] =        "[ACE ANNOUNCEMENT]";


new 
g_iFrags33 ];

new 
iForward;


public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
register_cvarPLUGINAUTHORFCVAR_SERVER );
    
    
register_event"HLTV""EventNewRound""a""1=0""2=0" );
    
register_event"DeathMsg""EventDeathMsg""a" );
    
    
register_logevent"LogEventRoundEnd"2"1=Round_End" );
    
    
iForward  CreateMultiForward"FwdPlayerDidAceOrSemi"ET_STOPFP_CELLFP_CELL );
}

public 
plugin_end( )
{
    
DestroyForwardiForward );
}

public 
client_connectid )
{
    
g_iFragsid ] = 0;
}

public 
EventNewRound( )
{
    
arraysetg_iFrags0sizeof g_iFrags );
}

public 
EventDeathMsg( )
{
    new 
iKiller read_data);
    new 
iVictim read_data);
    
    
CheckAceiVictim );
    
    if( !
iKiller || iKiller == iVictim || cs_get_user_teamiKiller ) == cs_get_user_teamiVictim ) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    
g_iFragsiKiller ]++;
    
    return 
PLUGIN_CONTINUE;
}

public 
LogEventRoundEnd( )
{
    new 
iPlayers32 ], iNumplayer;
    
    
get_playersiPlayersiNum"ch" );
    
    for( new 
0iNumi++ )
    {
        
player iPlayers];
        
        if( 
g_iFragsplayer ] >= SEMI_ACE )
        {
            
DidAceOrSemiplayer );
            
            if( 
g_iFragsplayer ] == SEMI_ACE )
            {
                return 
PLUGIN_CONTINUE;
            }
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
CheckAceid )
{
    if( 
g_iFragsid ] >= SEMI_ACE )
    {
        
DidAceOrSemiid );
    }
    
    
g_iFragsid ] = 0;
}

public 
DidAceOrSemiid )
{
    new 
iReturn PLUGIN_CONTINUE;
    
    
ExecuteForwardiForwardiReturnidg_iFragsid ] );
    
    if( 
iReturn == PLUGIN_HANDLED || iReturn == PLUGIN_HANDLED_MAIN )
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
szName32 ];
    
    
get_user_nameidszNamesizeof szName );
            
    
ColorChat0GREEN"%s^x03 %s^x01 made a%s ^x03%sACE ( 5 kills/+5kills)^x01.",
    
TAGszNameg_iFrags id ] == SEMI_ACE "" "n"g_iFrags id ] == SEMI_ACE "SEMI-" "" );
    
    
client_cmd0"spk vox/buzwarn" );
    
    return 
PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/ 

i have this plugin i try to edit the texts
when player kills 5 player its up player made ACE ( 5 kills/+5kills)
and 4 player player made SIME-ACE(4 kills)
but when the player kill 4 players its up made SIME-ACE(5 kills/+5kills)

how to fix it ?

instinctpt1 05-22-2020 03:00

Re: edit a plugin text
 
Now try
PHP Code:

#include < amxmodx >
#include < cstrike >
#include < ColorChat >

#pragma semicolon 1

#define SEMI_ACE 4


static const

    
PLUGIN[ ] =        "Ace_announcement",
    
VERSION[ ] =        "1.1",
    
AUTHOR[ ] =        "Rap^^",
    
    
TAG[ ] =        "[ACE ANNOUNCEMENT]";


new 
g_iFrags33 ];

new 
iForward;


public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
register_cvarPLUGINAUTHORFCVAR_SERVER );
    
    
register_event"HLTV""EventNewRound""a""1=0""2=0" );
    
register_event"DeathMsg""EventDeathMsg""a" );
    
    
register_logevent"LogEventRoundEnd"2"1=Round_End" );
    
    
iForward  CreateMultiForward"FwdPlayerDidAceOrSemi"ET_STOPFP_CELLFP_CELL );
}

public 
plugin_end( )
{
    
DestroyForwardiForward );
}

public 
client_connectid )
{
    
g_iFragsid ] = 0;
}

public 
EventNewRound( )
{
    
arraysetg_iFrags0sizeof g_iFrags );
}

public 
EventDeathMsg( )
{
    new 
iKiller read_data);
    new 
iVictim read_data);
    
    
CheckAceiVictim );
    
    if( !
iKiller || iKiller == iVictim || cs_get_user_teamiKiller ) == cs_get_user_teamiVictim ) )
    {
        return 
PLUGIN_CONTINUE;
    }
    
    
g_iFragsiKiller ]++;
    
    return 
PLUGIN_CONTINUE;
}

public 
LogEventRoundEnd( )
{
    new 
iPlayers32 ], iNumplayer;
    
    
get_playersiPlayersiNum"ch" );
    
    for( new 
0iNumi++ )
    {
        
player iPlayers];
        
        if( 
g_iFragsplayer ] >= SEMI_ACE )
        {
            
DidAceOrSemiplayer );
            
            if( 
g_iFragsplayer ] == SEMI_ACE )
            {
                return 
PLUGIN_CONTINUE;
            }
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
CheckAceid )
{
    if( 
g_iFragsid ] >= SEMI_ACE )
    {
        
DidAceOrSemiid );
    }
    
    
g_iFragsid ] = 0;
}

public 
DidAceOrSemiid )
{
    new 
iReturn PLUGIN_CONTINUE;
    
    
ExecuteForwardiForwardiReturnidg_iFragsid ] );
    
    if( 
iReturn == PLUGIN_HANDLED || iReturn == PLUGIN_HANDLED_MAIN )
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
szName32 ];
    
    
get_user_nameidszNamesizeof szName );
            
    
ColorChat0GREEN"%s^x03 %s^x01 made a%s ^x03%sACE ( %s )^x01.",
    
TAGszNameg_iFrags id ] == SEMI_ACE "" "n"g_iFrags id ] == SEMI_ACE "SEMI-" "" g_iFrags[id] == SEMI_ACE "4 kills/+4kills""5 kills/+5kills");
    
    
client_cmd0"spk vox/buzwarn" );
    
    return 
PLUGIN_HANDLED;




All times are GMT -4. The time now is 17:07.

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