PDA

View Full Version : CAR AUDIO


romka
16/01/2012, 03:30 PM
Hello samp forum!
if (strcmp("/autoraadio", cmdtext, true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
SendClientMessage(playerid,COLOR_GREY,"Sa ei ole sőidukis!");
return 1;
}
new Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
GetVehiclePos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);
return 1;
}
This is the car audio system put this dident work why?

This should work like this:
http://www.youtube.com/watch?v=EekoE5mtLDo&feature=player_embedded

thimo
16/01/2012, 03:45 PM
if (strcmp("/autoraadio", cmdtext, true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);
return 1;
}
else
SendClientMessage(playerid, 0xFFFFFFFFFFF, "You gotta be in a vehicle to use this command!");
return 1;
}

And btw this only works when ur standing still u got change the poss everytime u move... So use a timer :)

romka
16/01/2012, 03:53 PM
Can you do it for me?:D pleas :D

thimo
16/01/2012, 03:56 PM
Sure... If you dont wanna learn something:

//Under the command:
SetTimer("ResetPosOfRadio", 1000, true);

//Somewhere top your script:
forward ResetPosOfRadio(playerid);
//Somewhere in ur script.
public ResetPosOfRadio(playerid)
{
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);
return 1;
}

Untested... If errors just show me the errors

romka
16/01/2012, 04:01 PM
and how i can start and stop the music?

Sascha
16/01/2012, 04:03 PM
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 0);
or simply use 0 as for "usepos", which will update it automatically..

romka
16/01/2012, 04:12 PM
C:\Documents and Settings\nuka\Desktop\samp_P\samp_P\Ravens_Rolepla y_0.3c\Raven's Roleplay 0.3c\gamemodes\lsrp.pwn(45095) : error 017: undefined symbol "X" this error:S

Sascha
16/01/2012, 04:37 PM
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", 0.0, 0.0, 0.0, 0, 0);

romka
16/01/2012, 04:41 PM
its dosent work help please:S

romka
16/01/2012, 05:56 PM
help please!

romka
18/01/2012, 07:14 PM
help please