Streaming Help please?
#1

Okay so I am creating a Radio System which shall be posted soon for the public but I have a problem,I setup for when the player gets out of the vehicle,the Audio Stream stops,but it does not stop when you fall off your bike,this is what the script looks like.
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    StopAudioStreamForPlayer(playerid);
    return 1;
}
How do I setup for when the player falls off a bike?
Reply
#2

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) {
    if(oldstate == PLAYER_STATE_DRIVER) {
        StopAudioStreamForPlayer(playerid);
    }
}
Reply
#3

Quote:
Originally Posted by Misiur
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) {
    if(oldstate == PLAYER_STATE_DRIVER) {
        StopAudioStreamForPlayer(playerid);
    }
}
lol i thought it was that,but had to be sure thanks +rep for helping
Reply
#4

I can also do this right?
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_DRIVER)
    {
        StopAudioStreamForPlayer(playerid);
    }
    if(oldstate == PLAYER_STATE_PASSENGER)
    {
        StopAudioStreamForPlayer(playerid);
    }
}
Reply
#5

Yup. In fact just use or (||) operator:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
    {
        StopAudioStreamForPlayer(playerid);
    }
}
Reply
#6

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Yup. In fact just use or (||) operator:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
    {
        StopAudioStreamForPlayer(playerid);
    }
}
Coool thanks man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)