Cerere modificare plugin

Cauți un plugin și nu găsești? Încearcă-ți norocul în această categorie!

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
mixatu
Membru, skill +2
Membru, skill +2
Posts: 661
Joined: 26 Apr 2012, 14:47
Detinator Steam: Da
Detinator server CS: ★ PLAY.USP.RO ★
SteamID: kzu1337
Reputatie: Membru Club eXtreamCS (1 luna)
Location: cstrike
Has thanked: 59 times
Been thanked: 28 times
Contact:

02 Mar 2020, 03:41

Salut! Se poate adauga la acest plugin sa pot da acces la sunete dintr-un fisier .txt sau .ini? De exemplu sanksounds_acces.ini din care sa setez accesul la sunete prin steamid? Ca de exemplu:
sanksounds_acces | Afiseaza codul
"STEAM:0_123456789"
Uitati aici si pluginul.
| Afiseaza codul
#include <sourcemod>
#include <emitsoundany>

#define PREFIX "\x01★ \x04[GO]\x01"

public Plugin:myinfo = 
{
    name = "Sank Sounds",
    author = "kzu1337",
    description = "Play a sound when someone type a word from the list below.",
    version = "2.0",
    url = ""
};

//new String: szSoundsList [ ] [ ] = 
{
	
};

new String: szSoundsKzu [ ] [ ] = 
{
    "kzu"
};
new bool: CountDown [ MAXPLAYERS + 1 ];
new bool: SoundsOff [ MAXPLAYERS + 1 ];
new bool: StopSounds [ MAXPLAYERS + 1 ];

public OnPluginStart ( ) 
{

    RegConsoleCmd ( "say", Command_Say );
    RegConsoleCmd ( "sm_soundson", CommandSoundsOn );
    RegConsoleCmd ( "sm_soundsoff", CommandSoundsOff );

    HookEvent ( "round_prestart", EventRoundPreStart );
    HookEvent ( "round_end", EventRoundEnd );
}

public OnClientPutInServer ( client ) 
{

    CountDown [ client ] = false;

}

public EventRoundPreStart ( Handle: hEvent, const String: szEventName [ ], bool: bDontBroadcast ) 
{

    for ( new j = 1; j <= MaxClients; j++)
    {
        if ( !IsClientInGame ( j ) || IsFakeClient( j ) )
            continue;

        StopSounds [ j ] = false;
    }

}

public Action: EventRoundEnd ( Handle: event, const String: name [ ], bool: dontBroadcast ) 
{

    for ( new j = 1; j <= MaxClients; j++)
    {
        if ( !IsClientInGame ( j ) || IsFakeClient( j ) )
            continue;

        StopSounds [ j ] = true;
    }

}

public OnMapStart ( ) 
{

    for ( new i = 0; i < sizeof ( szSoundsList ); i++ ) 
    {

        decl String: buffer [ 80 ], String: buffer2 [ 128 ];
        Format ( buffer2, sizeof ( buffer2 ), "kzusank/%s.mp3", szSoundsList [ i ] );
        PrecacheSoundAny ( buffer2, true );
        Format ( buffer, sizeof ( buffer ), "kzusank/%s.mp3", szSoundsList [ i ] );
        AddFileToDownloadsTable ( buffer );

    }
    for ( new i = 0; i < sizeof ( szSoundsKzu ); i++ ) 
    {

        decl String: buffer [ 80 ], String: buffer2 [ 128 ];
        Format ( buffer2, sizeof ( buffer2 ), "sunetejucatori/figuri.mp3", szSoundsKzu [ i ] );
        PrecacheSoundAny ( buffer2, true );
        Format ( buffer, sizeof ( buffer ), "sunetejucatori/figuri.mp3", szSoundsKzu [ i ] );
        AddFileToDownloadsTable ( buffer );

    }

}

public Action: Command_Say ( client, args ) 
{

    if ( !IsValidClient ( client ) )
        return Plugin_Handled;


    if ((GetAdminFlag ( GetUserAdmin ( client ), Admin_Root ) ) || ( GetAdminFlag ( GetUserAdmin ( client ), Admin_Custom6 ) ) ) 
    {
        if ( !CountDown [ client ] && !StopSounds [ client ] ) 
        {

            decl String:text [ 192 ];
            GetCmdArgString ( text, sizeof ( text ) );

            for ( new i = 0; i < sizeof ( szSoundsList ); i++ ) 
            {

                if ( StrContains ( text, szSoundsList [ i ], false ) != -1 ) 
                {

                    for ( new j = 1; j <= MaxClients; j++)
                    {
                        if ( !IsClientInGame ( j ) || IsFakeClient( j ) || SoundsOff [ j ] )
                            continue;

                        new String: szSound [ 256 ];
                        FormatEx ( szSound, sizeof ( szSound ), "kzusank/%s.mp3", szSoundsList [ i ] );
                        EmitSoundToClientAny ( j, szSound, _, _, _, _, 1.0 );

                    }


                    decl String: gAuth [ 21 ];
                    GetClientAuthString ( client, gAuth, sizeof( gAuth ) );

                    if ( GetAdminFlag ( GetUserAdmin ( client ), Admin_Root ) || StrEqual ( gAuth, "STEAM_0:0:176251290" ) || StrEqual ( gAuth, "STEAM_0:1:68348751" ) || StrEqual ( gAuth, "STEAM_0:1:176919247" ) )
                        CountDown [ client ] = false;
                    else 
                    {

                        CountDown [ client ] = true;
                        CreateTimer ( 9.0, Remove_CountDown, GetClientUserId ( client ) );

                    }

                }
            }
            for ( new i = 0; i < sizeof ( szSoundsKzu ); i++ ) {

                if ( StrContains ( text, szSoundsKzu [ i ], false ) != -1 ) 
                {

                    for ( new j = 1; j <= MaxClients; j++)
                    {
                        if ( !IsClientInGame ( j ) || IsFakeClient( j ) || SoundsOff [ j ] )
                            continue;

                        new String: szSound [ 256 ];
                        FormatEx ( szSound, sizeof ( szSound ), "sunetejucatori/figuri.mp3", szSoundsKzu [ i ] );
                        EmitSoundToClientAny ( j, szSound, _, _, _, _, 1.0 );

                    }


                    decl String: gAuth [ 21 ];
                    GetClientAuthString ( client, gAuth, sizeof( gAuth ) );

                    if ( GetAdminFlag ( GetUserAdmin ( client ), Admin_Root ) || StrEqual ( gAuth, "STEAM_0:0:176251290" ) || StrEqual ( gAuth, "STEAM_0:1:68348751" ) || StrEqual ( gAuth, "STEAM_0:1:176919247" ) )
                        CountDown [ client ] = false;
                    else 
                    {

                        CountDown [ client ] = true;
                        CreateTimer ( 9.0, Remove_CountDown, GetClientUserId ( client ) );

                    }

                }
            }
        }

    }


    return Plugin_Continue;
}

public Action: CommandSoundsOn ( client, args ) 
{

    if ( !SoundsOff [ client ] ) 
    {

        PrintToChat ( client, "%s You have already sounds \x04on\x01 !", PREFIX );
        return Plugin_Handled;

    }

    SoundsOff [ client ] = false;

    PrintToChat ( client, "%s Sounds \x04On\x01 !", PREFIX );
    return Plugin_Handled;

}

public Action: CommandSoundsOff ( client, args ) 
{

    if ( SoundsOff [ client ] ) 
    {

        PrintToChat ( client, "%s You have already sounds \x02off\x01 !", PREFIX );
        return Plugin_Handled;

    }

    SoundsOff [ client ] = true;

    PrintToChat ( client, "%s Sounds \x02Off \x01!", PREFIX );
    return Plugin_Handled;

}

public Action: Remove_CountDown ( Handle:timer, any:user_index ) 
{

    new client = GetClientOfUserId ( user_index );
    if ( !client )
        return;

    CountDown [ client ] = false;

}

stock IsValidClient ( client ) 
{

    if ( !( 1 <= client <= MaxClients ) || !IsClientInGame ( client ) )
        return false;

    return true;
} 
ImageImage
Fondator: ★ PLAY.USP.RO ★ Competitive CS:GO Server [!ws !gloves !knife FREEVIP!]
eXtreamSHOP
User avatar
1aurwtf
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 43
Joined: 18 Dec 2019, 05:12
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Utilizator neserios (tepar)
Fond eXtream: 0
Has thanked: 1 time

02 Mar 2020, 20:09

author = "kzu1337"

poti contacta autorul pluginului :-??
originalu ;)
Ai 2 variante, sa nu cumva s-o alegi pe a 3-a c-o sa dai de mine !!!
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests