Car Sound
#1

Hey guys i'm trying to make a song sistem but i'm having some problems,i want to play a song on my car but i want to play for everyone who is next to me like a car sound you know,but how i can make the sound still on the car coordinates? i need to make the music play together with the car...i tried to make this command but he only gets 1 coordinate and play the song there...

pawn Код:
if(strcmp(cmd, "/testesong", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        new currentveh;
        currentveh = GetPlayerVehicleID(playerid);
        new Float:songx, Float:songy, Float:songz;
        GetVehiclePos(currentveh, songx, songy, songz);
        new carid = currentveh;
        PlayAudioStreamForPlayer(i, "http://dc677.4shared.com/img/5007482591/6bd05747/dlink__2Fdownload_2FMu3VbE0vba_3Ftsid_3D20140818-034743-893bc92_26lgfp_3D1000_26dsid_3D6yh6k5.1f90f5deb1506f39a7c17a25a7b41710_26sbsr_3D9a428b511a77d6cb2fb3ff76834e7eb624d31b18f84a1c9d/preview.mp3",carid,carid,carid,20,1);
        }
        }
        return 1;
    }
Reply
#2

You don't have to use coordinates. Use
Quote:

PlayAudioStreamForPlayer(i, "http://dc677.4shared.com/img/5007482591/6bd05747/dlink__2Fdownload_2FMu3VbE0vba_3Ftsid_3D20140818-034743-893bc92_26lgfp_3D1000_26dsid_3D6yh6k5.1f90f5deb150 6f39a7c17a25a7b41710_26sbsr_3D9a428b511a77d6cb2fb3 ff76834e7eb624d31b18f84a1c9d/preview.mp3");

and it will be playing everywhere.
Reply
#3

but i don't want this i want the song to play only near the car,like a real sound in the car :/
Reply
#4

Quote:
Originally Posted by SonicFreeStyle
Посмотреть сообщение
but i don't want this i want the song to play only near the car,like a real sound in the car :/
EDIT: removed, proven wrong below.. hahaha
Reply
#5

but how? if i make a public or put this on a cmd the system only will take 1 place to put the music and i need the song on the car on everyplace :P
Reply
#6

The thing with this is, the sound can only be played on one place at a time. You cannot currently 'attach' an audio stream to a vehicle and have it move around with the vehicle. Using loops is out of the question, because when using PlayAudioStreamForPlayer in succession just results in the stream being restarted over and over.

There currently is no effective way to do what you're asking, but you can produce and broadcast a live stream that allows players to hear the same music at the same time. Then simply play it when the player goes within a certain distance of the vehicle, then stop it when they move too far away.
Reply
#7

i was think the same,thanks ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)