SA-MP Forums Archive
brackets - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: brackets (/showthread.php?tid=437904)



brackets - Nivniv2 - 17.05.2013

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);
}



Re: brackets - gtakillerIV - 17.05.2013

What's the problem?


Re: brackets - Faisal_khan - 17.05.2013

What? Elaborate the problem more dude.


Re: brackets - Nivniv2 - 17.05.2013

There's a missing bracket.


Re: brackets - Faisal_khan - 17.05.2013

Dude you high?
http://codegenerators.pl/brackets


Re: brackets - Red_Dragon. - 17.05.2013

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

Anyway, I don't see any missing braces.


Re: brackets - ReVo_ - 17.05.2013

everything is ok. { } and ( ) inside ifs.


Re: brackets - SuperViper - 17.05.2013

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)