CAR AUDIO
#1

Hello samp forum!
PHP код:
if (strcmp("/autoraadio"cmdtexttrue) == 0)
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
            
SendClientMessage(playerid,COLOR_GREY,"Sa ei ole sхidukis!");
            return 
1;
        }
        new 
Float:XFloat:YFloat:ZFloat:Distance 5.0;
        
GetVehiclePos(playeridXYZ);
    
PlayAudioStreamForPlayer(playerid"http://somafm.com/tags.pls"XYZDistance1);
    return 
1;
    } 
This is the car audio system put this dident work why?

This should work like this:
[ame]http://www.youtube.com/watch?v=EekoE5mtLDo&feature=player_embedded[/ame]
Reply
#2

pawn Код:
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
Reply
#3

Can you do it for me? pleas
Reply
#4

Sure... If you dont wanna learn something:
pawn Код:
//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
Reply
#5

and how i can start and stop the music?
Reply
#6

pawn Код:
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 0);
or simply use 0 as for "usepos", which will update it automatically..
Reply
#7

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
Reply
#8

pawn Код:
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", 0.0, 0.0, 0.0, 0, 0);
Reply
#9

its dosent work help please:S
Reply
#10

help please!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)