Sound Commands for VIPs - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sound Commands for VIPs (
/showthread.php?tid=615691)
Sound Commands for VIPs -
EgyptForLife - 25.08.2016
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(playerid, params[])
{
if(Player[playerid][vip] > 0)
{
PlayerPlaySound(playerid, 5462, 0.0, 0.0, 10.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.
Re: Sound Commands for VIPs -
99fe3rnando - 25.08.2016
PHP код:
COMMAND:winforsir(playerid, params[])
{
if(Player[playerid][vip] > 0)
{
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]); // get position
PlayerPlaySound(playerid, 5462, pos[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;
}
Re: Sound Commands for VIPs -
EgyptForLife - 25.08.2016
Quote:
Originally Posted by 99fe3rnando
PHP код:
COMMAND:winforsir(playerid, params[])
{
if(Player[playerid][vip] > 0)
{
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]); // get pos
PlayerPlaySound(playerid, 5462, pos[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?
Re: Sound Commands for VIPs -
99fe3rnando - 25.08.2016
PHP код:
COMMAND:winforsir(playerid, params[])
{
if(Player[playerid][vip] > 0)
{
SendClientMessageToAll(-1, "{FF0000}Another win for sir{01DF3A}!");
new Float:pos[3];
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
GetPlayerPos(i, pos[0], pos[1], pos[2]);
PlayerPlaySound(i, 5462,pos[0], pos[1], pos[2]);
}
}
else
{
Server(playerid, "This command only for VIP's.");
}
return 1;
}
Re: Sound Commands for VIPs -
EgyptForLife - 25.08.2016
Quote:
Originally Posted by 99fe3rnando
PHP код:
COMMAND:winforsir(playerid, params[])
{
if(Player[playerid][vip] > 0)
{
SendClientMessageToAll(-1, "{FF0000}Another win for sir{01DF3A}!");
new Float:pos[3];
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
GetPlayerPos(i, pos[0], pos[1], pos[2]);
PlayerPlaySound(i, 5462,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.