20.10.2013, 18:17
Hey, title says it all 
/globalMP3 (For Admins) [Link]

/globalMP3 (For Admins) [Link]
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 );
}
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 );
}
like this ?
pawn Код:
|
Dude... it's not about that command. And where is that list?
![]() |
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 );
}
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 Код:
![]() |