Sound Commands for VIPs
#1

Hello SA:MP Community,

Well I need to add a sound command for my VIP's in the server, I used the PlayPlayerSound code and used some of the Sound ID's in the SA:MP Wiki, but when I came in game to test it, there wasn't any sound at all, while my GTA SA have audio and characters sounds plays.

One of my sound commands(as an example)
PHP код:
COMMAND:winforsir(playeridparams[])
{
    if(
Player[playerid][vip] > 0)
    {
        
PlayerPlaySound(playerid54620.00.010.0);
        
SendClientMessageToAll(-1"{FF0000}Another win for sir{01DF3A}!");
    }
    else
    {
        
Server(playerid"This command only for VIP's.");
    }
    return 
1;

Would really appreciate if you help me, and I will +REP you for sure.
Reply
#2

PHP код:
COMMAND:winforsir(playeridparams[]) 

    if(
Player[playerid][vip] > 0
    { 
        new 
Float:pos[3]; 
        
GetPlayerPos(playeridpos[0], pos[1], pos[2]); // get position
        
PlayerPlaySound(playerid5462pos[0], pos[1], pos[2]); // sound position
        
SendClientMessageToAll(-1"{FF0000}Another win for sir{01DF3A}!"); 
    } 
    else 
    { 
        
Server(playerid"This command only for VIP's."); 
    } 
    return 
1

Reply
#3

Quote:
Originally Posted by 99fe3rnando
Посмотреть сообщение
PHP код:
COMMAND:winforsir(playeridparams[]) 

    if(
Player[playerid][vip] > 0
    { 
        new 
Float:pos[3]; 
        
GetPlayerPos(playeridpos[0], pos[1], pos[2]); // get pos
        
PlayerPlaySound(playerid5462pos[0], pos[1], pos[2]); // sound pos
        
SendClientMessageToAll(-1"{FF0000}Another win for sir{01DF3A}!"); 
    } 
    else 
    { 
        
Server(playerid"This command only for VIP's."); 
    } 
    return 
1

I want to make all the server to listen to that sound command, not only the VIP. Can you help me with that?
Reply
#4

PHP код:
COMMAND:winforsir(playeridparams[]) 

    if(
Player[playerid][vip] > 0
    { 
        
SendClientMessageToAll(-1"{FF0000}Another win for sir{01DF3A}!"); 
        new 
Float:pos[3];
        for(new 
iMAX_PLAYERSi++)
        {        
          if(!
IsPlayerConnected(i)) continue; 
          
GetPlayerPos(ipos[0], pos[1], pos[2]); 
          
PlayerPlaySound(i5462,pos[0], pos[1], pos[2]); 
        }
        
    } 
    else 
    { 
        
Server(playerid"This command only for VIP's."); 
    } 
    return 
1

Reply
#5

Quote:
Originally Posted by 99fe3rnando
Посмотреть сообщение
PHP код:
COMMAND:winforsir(playeridparams[]) 

    if(
Player[playerid][vip] > 0
    { 
        
SendClientMessageToAll(-1"{FF0000}Another win for sir{01DF3A}!"); 
        new 
Float:pos[3];
        for(new 
iMAX_PLAYERSi++)
        {        
          if(!
IsPlayerConnected(i)) continue; 
          
GetPlayerPos(ipos[0], pos[1], pos[2]); 
          
PlayerPlaySound(i5462,pos[0], pos[1], pos[2]); 
        }
        
    } 
    else 
    { 
        
Server(playerid"This command only for VIP's."); 
    } 
    return 
1

Gonna try it, thanks for your help!

EDIT: It worked, thanks for your help! +REPed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)