Playing music stream in interior
#1

What to change about this:

pawn Код:
public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
    switch(93)
    {
        case [0]:PlayAudioStreamForPlayer(playerid, "http://82.72.91.159:8000", 2554.4253, 1417.2795, 7703.7041, 270.7457, 50.0);
        default:(StopAudioStreamForPlayer(playerid);
        return 1;
    }
}
\filterscripts\radio.pwn(16) : error 029: invalid expression, assumed zero
\filterscripts\radio.pwn(16) : warning 215: expression has no effect
\filterscripts\radio.pwn(16) : error 001: expected token: ";", but found "]"
\filterscripts\radio.pwn(16) : error 029: invalid expression, assumed zero
\filterscripts\radio.pwn(16) : fatal error 107: too many error messages on one line
Reply
#2

pawn Код:
public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
    switch(93)
    {
        case 0:
        {
            PlayAudioStreamForPlayer(playerid, "http://82.72.91.159:8000", 2554.4253, 1417.2795, 7703.7041, 270.7457, 50.0);
        }
        default:
        {
            StopAudioStreamForPlayer(playerid);
        }
        return 1;
    }
}
Reply
#3

\filterscripts\radio.pwn(14) : warning 213: tag mismatch
\filterscripts\radio.pwn(20) : error 002: only a single statement (or expression) can follow each "case"
\filterscripts\radio.pwn(20) : warning 215: expression has no effect
\filterscripts\radio.pwn(22) : error 054: unmatched closing brace ("}")
Reply
#4

Well, if you showed us what lines 14, 20 and 22 are we could help.
Also there is a parameter missing
pawn Код:
PlayAudioStreamForPlayer(playerid, "http://82.72.91.159:8000", 2554.4253, 1417.2795, 7703.7041, 270.7457, 50.0);
https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer
Either your 270.7457 is the distance, but then the 50.0 is wrong, and when 50.0 is the distance, there are 4 location floats, which can't work.
Reply
#5

can i just put this stuff in a new filterscript ??

if i only put this:

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>


public OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
    switch(93)
    {
        case 0:
        {
            PlayAudioStreamForPlayer(playerid, "http://82.72.91.159:8000", 2554.4253, 1417.2795, 7703.7041, 270.7457, 50.0);
        }
        default:
        {
            StopAudioStreamForPlayer(playerid);
        }
        return 1;
    }
}
Reply
#6

Quote:
Originally Posted by Just rp
Посмотреть сообщение
can i just put this stuff in a new filterscript ??
Why would you want to do that? It's not needed, just fix the PlayAudioStreamForPlayer();
Reply
#7

pawn Код:
switch(93) // wtf?
    {
        case 0:
        {
            PlayAudioStreamForPlayer(playerid, "http://82.72.91.159:8000", 2554.4253, 1417.2795, 7703.7041, 270.7457, 50.0);
        }
        default:
        {
            StopAudioStreamForPlayer(playerid);
        }
        return 1; // wtf?
    }
Reply
#8

I just wanna play a "http://82.72.91.159:8000" in ONE interior thats the : 2554.4253, 1417.2795, 7703.7041 with a Range of 50

Please halppp
Reply
#9

pawn Код:
OnPlayerInteriorChange(playerid,newinteriorid,oldinteriorid)
{
    switch(newinterior)
    {
        case [your interior]:{PlayAudioStreamForPlayer(playerid, [your url], 0.0, 0.0, 0.0, 0.0, 0);}
        default:{StopAudioStreamForPlayer(playerid);}
    }
     return 1;
}
They sended me that on the Dutch forums
Reply
#10

OnPlayerUpdate:

pawn Код:
public OnPlayerUpdate(playerid)
{

    if(!GetPlayerInterior(playerid) == 0)
    {

        PlayAudioStreamForPlayer(playerid, "yourlink");

    }
    else
    {

        StopAudioStreamForPlayer(playerid);

    }

    return 1;

}
That code will work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)