MP3 Stream for all? (+REP)
#1

Hey, title says it all

/globalMP3 (For Admins) [Link]
Reply
#2

Help with this too:

https://sampforum.blast.hk/showthread.php?tid=243421
Reply
#3

I hope this script i've done for you will be useful

ZCMD Link: https://sampforum.blast.hk/showthread.php?tid=91354
SSCANF Link: https://sampforum.blast.hk/showthread.php?tid=120356

pawn Код:
CMD:globalMP3( playerid, params[ ] )
{
    // ( Check Link )
    new lsMP3Link[ 56 ];
    if ( sscanf( params, "s[256]", lsMP3Link ) )
        return SendClientMessage( playerid, ~1, "USAGE: {33CCFF}/globalMP3 [MP3-Link]" );
       
    // ( Check Player Admin )
    if( !IsPlayerAdmin( playerid ) )
        return SendClientMessage( playerid, ~1, "{ff0000}ERROR: {ffffff}You have to be be logged in as RCON administrator." );
       
    // ( Play the MP3 Link for all players )
    for( new i = 0; i < MAX_PLAYERS; i++ )
        PlayAudioStreamForPlayer( playerid, lsMP3Link );
   
    // ( Return )
    return ( 1 );
}
Reply
#4

Quote:
Originally Posted by Alex_Obando
Посмотреть сообщение
Great, thanks Gen
Can you help me with the other link please ?
Reply
#5

I can but i don't understand what do you want. I can't make that check when the player connects because you have to login in as admin first.

Don't forget about the +REP :P
Reply
#6

What i mean, is that if you are in a list with [COD] Tag you'll be able to join, but if you join with [COD] tag and you're not on a list you'll get kicked!
Reply
#7

like this ?
pawn Код:
CMD:globalMP3( playerid, params[ ] )
{
    new name[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));
    // Check tag name
    if(strfind(name, "[COD]", true) != -1)
    {
        // ( Check Link )
        new lsMP3Link[ 56 ];
        if ( sscanf( params, "s[256]", lsMP3Link ) )
            return SendClientMessage( playerid, ~1, "USAGE: {33CCFF}/globalMP3 [MP3-Link]" );
           
        // ( Check Player Admin )
        if( !IsPlayerAdmin( playerid ) )
            return SendClientMessage( playerid, ~1, "{ff0000}ERROR: {ffffff}You have to be be logged in as RCON administrator." );
           
        // ( Play the MP3 Link for all players )
        for( new i = 0; i < MAX_PLAYERS; i++ )
            PlayAudioStreamForPlayer( playerid, lsMP3Link );
           
    }
    else
    {
        Kick(playerid);
    }
    // ( Return )
    return ( 1 );
}
Reply
#8

Quote:
Originally Posted by rickisme
Посмотреть сообщение
like this ?
pawn Код:
CMD:globalMP3( playerid, params[ ] )
{
    new name[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));
    // Check tag name
    if(strfind(name, "[COD]", true) != -1)
    {
        // ( Check Link )
        new lsMP3Link[ 56 ];
        if ( sscanf( params, "s[256]", lsMP3Link ) )
            return SendClientMessage( playerid, ~1, "USAGE: {33CCFF}/globalMP3 [MP3-Link]" );
           
        // ( Check Player Admin )
        if( !IsPlayerAdmin( playerid ) )
            return SendClientMessage( playerid, ~1, "{ff0000}ERROR: {ffffff}You have to be be logged in as RCON administrator." );
           
        // ( Play the MP3 Link for all players )
        for( new i = 0; i < MAX_PLAYERS; i++ )
            PlayAudioStreamForPlayer( playerid, lsMP3Link );
           
    }
    else
    {
        Kick(playerid);
    }
    // ( Return )
    return ( 1 );
}
Dude... it's not about that command. And where is that list? )
Reply
#9

Quote:
Originally Posted by nGen.SoNNy
Посмотреть сообщение
Dude... it's not about that command. And where is that list? )
OMG, why so serious =.=!
just create a file name : admin.ini in scriptfiles folder
put all admin name into admin.ini ( 1 line / 1 admin name )

pawn Код:
stock CheckAdmin(username[])
{
    new string[MAX_PLAYER_NAME+1];
    if(fexist("admin.ini"))
    {
        new File: file = fopen("admin.ini", io_read);
        while(fread(file, string))
        {
            if (strcmp(username, string, true, strlen(username)) == 0)
            {
                fclose(file);
                return 1;
            }
        }
        fclose(file);
    }
    return 0;
}

CMD:globalMP3( playerid, params[ ] )
{
    new name[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));
    // Check tag name
    if(strfind(name, "[COD]", true) != -1)
    {
        if(CheckAdmin(name))
        {
            // ( Check Link )
            new lsMP3Link[ 56 ];
            if ( sscanf( params, "s[256]", lsMP3Link ) )
                return SendClientMessage( playerid, ~1, "USAGE: {33CCFF}/globalMP3 [MP3-Link]" );
               
            // ( Check Player Admin )
            if( !IsPlayerAdmin( playerid ) )
                return SendClientMessage( playerid, ~1, "{ff0000}ERROR: {ffffff}You have to be be logged in as RCON administrator." );
               
            // ( Play the MP3 Link for all players )
            for( new i = 0; i < MAX_PLAYERS; i++ )
                PlayAudioStreamForPlayer( playerid, lsMP3Link );
        }
        else
        {
            Kick(playerid);
        }
    }
    // ( Return )
    return ( 1 );
}
I'm noob, ok
Reply
#10

Quote:
Originally Posted by rickisme
Посмотреть сообщение
OMG, why so serious =.=!
just create a file name : admin.ini in scriptfiles folder
put all admin name into admin.ini ( 1 line / 1 admin name )

pawn Код:
stock CheckAdmin(username[])
{
    new string[MAX_PLAYER_NAME+1];
    if(fexist("admin.ini"))
    {
        new File: file = fopen("admin.ini", io_read);
        while(fread(file, string))
        {
            if (strcmp(username, string, true, strlen(username)) == 0)
            {
                fclose(file);
                return 1;
            }
        }
        fclose(file);
    }
    return 0;
}

CMD:globalMP3( playerid, params[ ] )
{
    new name[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));
    // Check tag name
    if(strfind(name, "[COD]", true) != -1)
    {
        if(CheckAdmin(name))
        {
            // ( Check Link )
            new lsMP3Link[ 56 ];
            if ( sscanf( params, "s[256]", lsMP3Link ) )
                return SendClientMessage( playerid, ~1, "USAGE: {33CCFF}/globalMP3 [MP3-Link]" );
               
            // ( Check Player Admin )
            if( !IsPlayerAdmin( playerid ) )
                return SendClientMessage( playerid, ~1, "{ff0000}ERROR: {ffffff}You have to be be logged in as RCON administrator." );
               
            // ( Play the MP3 Link for all players )
            for( new i = 0; i < MAX_PLAYERS; i++ )
                PlayAudioStreamForPlayer( playerid, lsMP3Link );
        }
        else
        {
            Kick(playerid);
        }
    }
    // ( Return )
    return ( 1 );
}
I'm noob, ok
Hmm, can you explain the Tag stock?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)