How to attach ringtone to player?
#1

Код:
...
		GameTextForPlayer(odbiorcaid, string, 15500, 3);

						new Float: x, Float: y, Float: z;
		        		GetPlayerPos(odbiorcaid, x, y, z);
		        		format(string, sizeof(string), "%s", PhoneRings[PlayerData[odbiorcaid][pPhoneMusic]-1]);
	  					foreach(i, MAX_PLAYERS)
				        {
				            if(IsPlayerInRangeOfPoint(i, 10, x, y, z))
				            {
					        	RingToneHandle[i] = Audio_PlayStreamed(i, string);
								Audio_Set3DPosition(i, RingToneHandle[i], x, y, z, 5);
							}
				        }
...
How to attach Ringtone to player position (ringtone walking with player)? This is my script, ringtone don't "walk" with player. Sorry for my bad English. Thanks.
Reply
#2

I never used the audio plugin, but i think you have tu use a timer, that updates the sound and sets its position to the players position every 500-1000ms
Reply
#3

Thanks, but I don't have idea how to do that... I never use timers. Thanks for help.
Reply
#4

Can anybody help? It's very important. Sorry for double post. Thank You
Reply
#5

Sorry guys, but I really need it. Mercy!!
Reply
#6

Quote:
Originally Posted by cywil
Посмотреть сообщение
Thanks, but I don't have idea how to do that... I never use timers. Thanks for help.
on top of your gamemode
pawn Код:
forward Timer(playerid); //Tells the compiler theres a function called "Timer"
Wherever you want it to update
pawn Код:
SetTimerEx("Timer", 1000, 0, "%d", playerid); //Timer will update every 1000ms, non repeating, has an integer as a type, will do this for playerid
function would be
pawn Код:
public Timer(playerid) //Function that will be called when you run the timer
{
        ...
}
That's in a nutshell how to use timers, read a tutorial about them if you still don't understand.
Reply
#7

amm now ther is Audio_Set3DPosition (Plugin made by Incognito) i dont know how to use it yet but this is what u looking for i guess
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)