error 029: invalid expression, assumed zero
#1

Help please.
error 029: invalid expression, assumed zero
PHP код:
CMD:ehr(playerid)
{
    if(
PlayerLogged[playerid] == 0) return 1;
    {
    
PlayAudioStreamForPlayer(playerid"http://stream.europeanhitradio.lv");
    }
    else
    {
    
StopAudioStreamForPlayer(playerid);
    }
    return 
1;

Reply
#2

pawn Код:
CMD:ehr(playerid)
{
    if(PlayerLogged[playerid] == 0) // 0 means false
    {
    PlayAudioStreamForPlayer(playerid, "http://stream.europeanhitradio.lv");
    return 1;
    }
    else
    {
    StopAudioStreamForPlayer(playerid);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by rfr
Посмотреть сообщение
pawn Код:
CMD:ehr(playerid)
{
    if(PlayerLogged[playerid] == 0) // 0 means false
    {
    PlayAudioStreamForPlayer(playerid, "http://stream.europeanhitradio.lv");
    return 1;
    }
    else
    {
    StopAudioStreamForPlayer(playerid);
    }
    return 1;
}
yeah but /ehr is not working with ur code
Reply
#4

PHP код:
new IsPlaying[MAX_PLAYERS]; // up top in your script somewhere
CMD:ehr(playerid

    if(
PlayerLogged[playerid] == 0) return 1;
    if(
IsPlaying[playerid] == 0)
    { 
         
PlayAudioStreamForPlayer(playerid"http://stream.europeanhitradio.lv"); 
         
IsPlaying[playerid] = 1;
    } 
    else 
    { 
         
StopAudioStreamForPlayer(playerid); 
         
IsPlaying[playerid] = 0;
    } 
    return 
1

(The indenting might be rough, did this on my phone)
Reply
#5

Quote:
Originally Posted by CantBeJohn
Посмотреть сообщение
PHP код:
new IsPlaying[MAX_PLAYERS]; // up top in your script somewhere
CMD:ehr(playerid

    if(
PlayerLogged[playerid] == 0) return 1;
    if(
IsPlaying[playerid] == 0)
    { 
         
PlayAudioStreamForPlayer(playerid"http://stream.europeanhitradio.lv"); 
         
IsPlaying[playerid] = 1;
    } 
    else 
    { 
         
StopAudioStreamForPlayer(playerid); 
         
IsPlaying[playerid] = 0;
    } 
    return 
1

(The indenting might be rough, did this on my phone)
ty. worked lol
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)