[HELP] Sounds - Musics
#1

Hello. I have a problem. i wanna use some sounds "musics" for example id 1068 but there are not working. Why?
Reply
#2

How and where are you attempting to use them? May we see some source code?
Reply
#3

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);
Код:
1185
Will start your song.
Код:
1186
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

Reply
#4

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?
Reply
#5

Post the code to where you're using it and it won't work.
Reply
#6

Код:
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. :/
Reply
#7

Why do you create the Float variables if they're not being used?
Reply
#8

I did wrong. but anyway.. its not working this sound id.
Reply
#9

Well... Probably its impossible to play this sounds... :/

@off
oops sry for double post.. wrong button :S
Reply
#10

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);
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)