PDA

View Full Version : brackets


Nivniv2
17/05/2013, 09:08 PM
having problems with brackets:

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

gtakillerIV
17/05/2013, 09:11 PM
What's the problem?

Faisal_khan
17/05/2013, 09:13 PM
What? Elaborate the problem more dude.

Nivniv2
17/05/2013, 09:13 PM
There's a missing bracket.

Faisal_khan
17/05/2013, 09:16 PM
Dude you high?
http://codegenerators.pl/brackets

Red_Dragon.
17/05/2013, 09:17 PM
Dude you high?
http://codegenerators.pl/bracketsHahahahaha.

Anyway, I don't see any missing braces.

ReVo_
17/05/2013, 09:22 PM
everything is ok. { } and ( ) inside ifs.

SuperViper
17/05/2013, 11:08 PM
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:

foreach(iterator, variable)

New syntax:

foreach(new variable: iterator)