[HELP] Sound issue
#1

Hello everyone i've made a script with gates and commands, only i want to play a sound when the commands are typed.
I've tried lots of things but i cant get it to work, and if the commands are typed, i'd like to make the sound only hearable for the player that used the command, how do i do this all?
Also, i trid to make a sound hearable for only admins or such, but i couldn't get that to work either (duhh..).
If someone could help me i'd apprecciate it.
Reply
#2

I have this:
Quote:

if (strcmp(cmdtext, "/Dac1", true)==0)
{
GetPlayerPos(playerid, s[X], s[Y] ,s[Z]);
PlayerPlaySound(playerid, 1158, 0, 0, 0);
MoveObject(carry, -2533.359375, 3040.3, 8.9499998092651, 1.0);
SendClientMessage(playerid, BLUE, "Aircraftcarrier elevator 1 downed, over.");
return 1;
}

Reply
#3

Someone please help!
Reply
#4

that will play the sound to the one who typed the cmd
Reply
#5

Quote:
Originally Posted by dice7
that will play the sound to the one who typed the cmd
]
Yes but it doesn't work, do you know how to get it to work?
Reply
#6

You play the sound too far away so you can't hear it, and maybe this sound id doesn't work.
Reply
#7

Thank you the sound id was wrong, but now i have another problem
If i play teh sound it keeps repeating itsself and it uses way too long time to play,
Could you help me out here??
Reply
#8

dont let it loop
go to wiki.sa-mp.com and search for playerplaysound
Reply
#9

Some sounds are looping, and you have to stop it by playing sound id <your sound id + 1>.

Exemple from AudioEvents.txt:
Код:
SOUND_GARAGE_DOOR_START 1153

SOUND_GARAGE_DOOR_STOP 1154
If you want to stop it when the object reach it's destination, play the sound which stop the loop, under OnObjectMoved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)