brackets
#1

having problems with brackets:

pawn Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
    foreach(Player, i)
    {
        if(GetPVarType(i, "bboxareaid"))
        {
            new station[256];
            GetPVarString(i, "BoomboxURL", station, sizeof(station));
            if(areaid == GetPVarInt(i, "bboxareaid"))
            {
                PlayAudioStreamForPlayer(playerid, station, GetPVarFloat(i, "bposX"), GetPVarFloat(i, "bposY"), GetPVarFloat(i, "bposZ"), 30.0, 1);
                SendClientMessage(playerid, COLOR_GREY, " You are listening to music coming out of a nearby boombox.");
                return 1;
            }
        }
    }
    return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
    foreach(Player, i)
    {
        if(GetPVarType(i, "bboxareaid"))
        {
            if(areaid == GetPVarInt(i, "bboxareaid"))
            {
                StopAudioStreamForPlayerEx(playerid);
                SendClientMessage(playerid, COLOR_GREY, " You have went far away from the boombox.");
                return 1;
            }
        }
    }
    return 1;
}

public Audio_OnPlay(playerid, handleid)
{
    //new string[128];
    //format(string, sizeof(string), "(Audio Plugin) Debug: Audio playback started for handle ID %d.", handleid);
    //SendClientMessage(playerid, 0xA9C4E4FF, string);
}
Reply
#2

What's the problem?
Reply
#3

What? Elaborate the problem more dude.
Reply
#4

There's a missing bracket.
Reply
#5

Dude you high?
http://codegenerators.pl/brackets
Reply
#6

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
Hahahahaha.

Anyway, I don't see any missing braces.
Reply
#7

everything is ok. { } and ( ) inside ifs.
Reply
#8

If your compiler crashes, it doesn't necessarily mean that there's a bracket problem. It could be foreach. If you're using the old syntax with the new version or vice versa, it will crash your compiler.

Old syntax:

pawn Код:
foreach(iterator, variable)
New syntax:

pawn Код:
foreach(new variable: iterator)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)