SA-MP Forums Archive
No Sound On Player Spawn When I added it... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: No Sound On Player Spawn When I added it... (/showthread.php?tid=262237)



No Sound On Player Spawn When I added it... - Robert_Crawford - 17.06.2011

pawn Код:
new rand = random(sizeof(RequestCamera));
    cordinatex = RequestCamera[rand][0];
    cordinatey = RequestCamera[rand][1];
    cordinatez = RequestCamera[rand][2];
    cordinateangle = RequestCamera[rand][3];
    PlayerPlaySound(playerid, 1185, cordinatex, cordinatey, cordinatez);
    SetPlayerFacingAngle(playerid, cordinateangle);
    SetPlayerCameraPos(playerid,cordinatex+(10*floatsin(-cordinateangle,degrees)),cordinatey+(10*floatcos(-cordinateangle,degrees)),cordinatez);//0.8 is a test
    SetPlayerCameraLookAt(playerid, cordinatex,cordinatey,cordinatez);
    SpawnCam[playerid][SpawnTimer] = SetTimerEx("MoveCamera", 50, true, "i", playerid);// 2 to reduce lagg change if wanted
    SetCameraBehindPlayer(playerid);



Re: No Sound On Player Spawn When I added it... - iggy1 - 17.06.2011

Id say it was something to do with the requestcamera function try this just to see if it works.

pawn Код:
new rand = random(sizeof(RequestCamera));
    cordinatex = RequestCamera[rand][0];
    cordinatey = RequestCamera[rand][1];
    cordinatez = RequestCamera[rand][2];
    cordinateangle = RequestCamera[rand][3];
    PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
    SetPlayerFacingAngle(playerid, cordinateangle);
    SetPlayerCameraPos(playerid,cordinatex+(10*floatsin(-cordinateangle,degrees)),cordinatey+(10*floatcos(-cordinateangle,degrees)),cordinatez);//0.8 is a test
    SetPlayerCameraLookAt(playerid, cordinatex,cordinatey,cordinatez);
    SpawnCam[playerid][SpawnTimer] = SetTimerEx("MoveCamera", 50, true, "i", playerid);// 2 to reduce lagg change if wanted
    SetCameraBehindPlayer(playerid);



Re: No Sound On Player Spawn When I added it... - Max_Coldheart - 17.06.2011

He was faster


Re: No Sound On Player Spawn When I added it... - Robert_Crawford - 17.06.2011

So you all put the player sound at 0.0 cause why? I'm trying to understand this. Cause wouldnt you want the sound to follow the player?


Re: No Sound On Player Spawn When I added it... - iggy1 - 17.06.2011

Its an offset from the players current co-ordinates you dont need to get the players position. Similar to the AttachObjectToPlayer func, but with sounds.


Re: No Sound On Player Spawn When I added it... - Robert_Crawford - 17.06.2011

Yah i tried it. Not working. Did you change any other code that the cords for the sound?