[HELP] Sounds - Musics -
DjSterios - 18.06.2009
Hello. I have a problem. i wanna use some sounds "musics" for example id 1068 but there are not working. Why?
Re: [HELP] Sounds - Musics -
Grim_ - 18.06.2009
How and where are you attempting to use them? May we see some source code?
Re: [HELP] Sounds - Musics -
FreddeN - 18.06.2009
Quote:
Originally Posted by DjSterios
Hello. I have a problem. i wanna use some sounds "musics" for example id 1068 but there are not working. Why?
|
Here is a small guide how you should put it up.
First go on OnPlayerRquestClass and paste this
Код:
PlayerPlaySound(playerid,1185,0,0,0);
Then go to OnPlayerSpawn and paste this
Код:
PlayerPlaySound(playerid,1186,0,0,0);
Will start your song.
Stops it when you spawn.
This should play the Boat School results theme.
If you want other music, check out the wiki for more id's
Re: [HELP] Sounds - Musics -
DjSterios - 18.06.2009
I know how to do it, but this sound id its corrupt or something. :/ if i put other sound id it works. if i put 1068 its not working cuz its music. but i know a server which use this Sound ID. Any help?
Re: [HELP] Sounds - Musics -
Grim_ - 18.06.2009
Post the code to where you're using it and it won't work.
Re: [HELP] Sounds - Musics -
DjSterios - 18.06.2009
Код:
if(strcmp(cmd, "/playsound", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /playsound [Sound ID]");
return 1;
}
new sound = strval(tmp);
if(PlayerInfo[playerid][pAdmin] > 5)
{
new Float:sslx, Float:ssly, Float:sslz;
PlayerPlaySound(playerid, sound, sslx, ssly, sslz);
format(string, sizeof(string), "You hear the sound ID %d", sound);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
if i put other sound, it works.. if i put a music, like id 1068 its not working. :/
Re: [HELP] Sounds - Musics -
Grim_ - 18.06.2009
Why do you create the Float variables if they're not being used?
Re: [HELP] Sounds - Musics -
DjSterios - 18.06.2009
I did wrong. but anyway.. its not working this sound id.
Re: [HELP] Sounds - Musics -
DjSterios - 18.06.2009
Well... Probably its impossible to play this sounds... :/
@off
oops sry for double post.. wrong button :S
Re: [HELP] Sounds - Musics -
OmeRinG - 18.06.2009
Quote:
Originally Posted by DjSterios
Код:
if(strcmp(cmd, "/playsound", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /playsound [Sound ID]");
return 1;
}
new sound = strval(tmp);
if(PlayerInfo[playerid][pAdmin] > 5)
{
new Float:sslx, Float:ssly, Float:sslz;
PlayerPlaySound(playerid, sound, sslx, ssly, sslz);
format(string, sizeof(string), "You hear the sound ID %d", sound);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
if i put other sound, it works.. if i put a music, like id 1068 its not working. :/
|
Well I know it's offtopic but just a little tip for you to make code shorter:
pawn Код:
if(!strcmp(cmd, "/playsound", true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /playsound [Sound ID]");
if(!isNumeric(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "ERROR: ID not a number");
new sound = strval(tmp);
if(PlayerInfo[playerid][pAdmin] > 5)
{
PlayerPlaySound(playerid, sound, 0.0, 0.0, 0.0);
format(string, sizeof(string), "You hear the sound ID %d", sound);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}