Raised This Month: $75 Target: $400
 18% 

Solved [CSGO] Sank Sounds Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PorcusorulMagic
Member
Join Date: Dec 2018
Location: Romania
Old 05-28-2019 , 07:14   [CSGO] Sank Sounds Plugin
Reply With Quote #1

Hello! Recently i semi-finished(with some help from 1 guy) a sank sounds plugin but i had 2 warnings.
PHP Code:
//// USPsunete.sp
//
// USPsunete.sp(177) : warning 234: symbol "GetClientAuthString" is marked as deprecated: Use GetClientAuthId
//
// USPsunete.sp(209) : warning 234: symbol "GetClientAuthString" is marked as deprecated: Use GetClientAuthId
//
// Code size:             8752 bytes
// Data size:             4312 bytes
// Stack/heap size:      16384 bytes
// Total requirements:   29448 bytes 
This is the source:
PHP Code:
#include <sourcemod>
#include <emitsoundany>

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

public Plugin:myinfo 
{
    
name "Sank Sounds",
    
author "PorcusorulMagic",
    
description "Play a sound when someone type a word from the list below.",
    
version "1.0",
    
url "https://forums.alliedmods.net/"
};

new 
StringszSoundsList [ ] [ ] = 
{
    
"mici",
    
"futem",
    
"bagamias",
    
"kaboom",
    
"dume",
    
"sictir",
    
"yey",
    
"wtf",
    
"noroc",
    
"cf",
    
"boieru"
};

new 
StringszSoundsPorc [ ] [ ] = 
{
    
"porc"
};
new 
boolCountDown MAXPLAYERS ];
new 
boolSoundsOff MAXPLAYERS ];
new 
boolStopSounds MAXPLAYERS ];

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 HandlehEvent, const StringszEventName [ ], boolbDontBroadcast 
{

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

        
StopSounds ] = false;
    }

}

public 
ActionEventRoundEnd Handleevent, const Stringname [ ], booldontBroadcast 
{

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

        
StopSounds ] = true;
    }

}

public 
OnMapStart ( ) 
{

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

        
decl Stringbuffer 80 ], Stringbuffer2 128 ];
        
Format buffer2sizeof buffer2 ), "sunetecustom/%s.mp3"szSoundsList ] );
        
PrecacheSoundAny buffer2true );
        
Format buffersizeof buffer ), "sound/sunetecustom/%s.mp3"szSoundsList ] );
        
AddFileToDownloadsTable buffer );

    }
    for ( new 
0sizeof szSoundsPorc ); i++ ) 
    {

        
decl Stringbuffer 80 ], Stringbuffer2 128 ];
        
Format buffer2sizeof buffer2 ), "sunetejucatori/porcfiguri.mp3"szSoundsPorc ] );
        
PrecacheSoundAny buffer2true );
        
Format buffersizeof buffer ), "sunetejucatori/porcfiguri.mp3"szSoundsPorc ] );
        
AddFileToDownloadsTable buffer );

    }

}

public 
ActionCommand_Say clientargs 
{

    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 textsizeof text ) );

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

                if ( 
StrContains textszSoundsList ], false ) != -
                {

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

                        new 
StringszSound 256 ];
                        
FormatEx szSoundsizeof szSound ), "sunetecustom/%s.mp3"szSoundsList ] );
                        
EmitSoundToClientAny jszSound____1.0 );

                    }


                    
decl StringgAuth 21 ];
                    
GetClientAuthString clientgAuthsizeofgAuth ) );

                    if ( 
GetAdminFlag GetUserAdmin client ), Admin_Root ) || StrEqual gAuth"STEAM_1:1:105711459" ) || StrEqual gAuth"STEAM_1:1:128735333" ) || StrEqual gAuth"STEAM_1:0:144864954" ) )
                        
CountDown client ] = false;
                    else 
                    {

                        
CountDown client ] = true;
                        
CreateTimer 9.0Remove_CountDownGetClientUserId client ) );

                    }

                }
            }
            for ( new 
0sizeof szSoundsPorc ); i++ ) {

                if ( 
StrContains textszSoundsPorc ], false ) != -
                {

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

                        new 
StringszSound 256 ];
                        
FormatEx szSoundsizeof szSound ), "sunetejucatori/porcfiguri.mp3"szSoundsPorc ] );
                        
EmitSoundToClientAny jszSound____1.0 );

                    }


                    
decl StringgAuth 21 ];
                    
GetClientAuthString clientgAuthsizeofgAuth ) );

                    if ( 
GetAdminFlag GetUserAdmin client ), Admin_Root ) || StrEqual gAuth"STEAM_1:1:105711459" ) || StrEqual gAuth"STEAM_1:1:128735333" ) || StrEqual gAuth"STEAM_1:0:144864954" ) )
                        
CountDown client ] = false;
                    else 
                    {

                        
CountDown client ] = true;
                        
CreateTimer 9.0Remove_CountDownGetClientUserId client ) );

                    }

                }
            }
        }

    }


    return 
Plugin_Continue;
}

public 
ActionCommandSoundsOn clientargs 
{

    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 
ActionCommandSoundsOff clientargs 
{

    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 
ActionRemove_CountDown Handle:timerany:user_index 
{

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

    
CountDown client ] = false;

}

stock IsValidClient client 
{

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

    return 
true;

And if someone can do an config for sounds , like this:

PHP Code:
"Sounds"
{
    
"soundname"
    
{
        
"path" "sound/sunetecustom/name.mp3"
    
}

Contact me.
__________________
Steam - https://steamcommunity.com/id/porcusorulmagic2
Discord - PorcusorulMagic#4908

Last edited by PorcusorulMagic; 05-28-2019 at 09:40. Reason: solved warnings
PorcusorulMagic is offline
Muhlex
Junior Member
Join Date: Mar 2019
Old 05-28-2019 , 08:46   Re: [CSGO] Sank Sounds Plugin
Reply With Quote #2

You should be able to just replace
PHP Code:
GetClientAuthString(clientauthsizeof(auth)); 
with
PHP Code:
GetClientAuthId(clientAuthId_Engineauthsizeof(auth)); 
to get rid of your warnings. They will result in the same string.
Muhlex is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 05-28-2019 , 09:13   Re: [CSGO] Sank Sounds Plugin
Reply With Quote #3

GetClientAuthId is boolean btw.
farawayf is offline
Nexd
Senior Member
Join Date: Dec 2013
Location: Hungary
Old 05-28-2019 , 09:29   Re: [CSGO] Sank Sounds Plugin
Reply With Quote #4

Solved already.
__________________
Taking private paid requests in PM

No more FREE requests.
Discord: KillStr3aK#9143
Nexd is offline
PorcusorulMagic
Member
Join Date: Dec 2018
Location: Romania
Old 05-28-2019 , 09:39   Re: [CSGO] Sank Sounds Plugin
Reply With Quote #5

Solved warnings , thank you all
__________________
Steam - https://steamcommunity.com/id/porcusorulmagic2
Discord - PorcusorulMagic#4908
PorcusorulMagic is offline
eliteroyal
AlliedModders Donor
Join Date: Dec 2016
Location: Moldova
Old 07-06-2019 , 05:11   Re: [CSGO] Sank Sounds Plugin
Reply With Quote #6

Could you post it as a plugin to get more info? I really wanted this plugin on my server because saysounds dont work.
Thank you.
__________________
PEACE FROM MOLDOVA

Last edited by eliteroyal; 07-06-2019 at 05:11.
eliteroyal is offline
Reply


Thread Tools
Display Modes

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 23:35.


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