Bracket Errors i think
#1

Pawno is crashing.. Is their any bracket errors on these codes

pawn Код:
else if(dialogid == SETSTATION)
    {
        if(response)
        {
            if(listitem == 0)
            {
                 ShowPlayerDialog(playerid, 7365, DIALOG_STYLE_LIST, "Select Station", "Hot 108 Jamz\nUrban Hitz\nServer Radio\nAbsolute Country\nSmooth Jazz", "Select", "Cancel");
            }
            else if(listitem == 1)
            {
                if(!IsPlayerInAnyVehicle(playerid))
                {
                    if(GetPVarType(playerid, "pBoomBox"))
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You have turned off the boom box.");
                        foreach(new i: Player) if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea"))) StopAudioStreamForPlayerEx(i);
                        DeletePVar(playerid, "pBoomBoxStation");
                    }
                    else
                    {
                        StopAudioStreamForPlayerEx(playerid);
                    }
                }
                else
                {
                    format(string, sizeof(string), "* %s turns off the radio.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    foreach(new i: Player) if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        StopAudioStreamForPlayerEx(i);
                    }
                    stationidv[GetPlayerVehicleID(playerid)][0] = 0;
                }
            }
        }
    }
    if(dialogid == 7364)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(GetPVarType(playerid, "pBoomBox"))
                {
                    foreach(Player, i)
                    {
                        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea")))
                        {
                            PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999", GetPVarFloat(playerid, "pBoomBoxX"), GetPVarFloat(playerid, "pBoomBoxY"), GetPVarFloat(playerid, "pBoomBoxZ"), 30.0, 1);
                        }
                    }
                    SetPVarString(playerid, "pBoomBoxStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
                }
            }
            else if(listitem == 1)
            {
                if(GetPVarType(playerid, "pBoomBox"))
                {
                    foreach(Player, i)
                    {
                        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea")))
                        {
                            PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=148353", GetPVarFloat(playerid, "pBoomBoxX"), GetPVarFloat(playerid, "pBoomBoxY"), GetPVarFloat(playerid, "pBoomBoxZ"), 30.0, 1);
                        }
                    }
                    SetPVarString(playerid, "pBoomBoxStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=148353");
                }
            }
            else if(listitem == 2)
            {
                if(GetPVarType(playerid, "pBoomBox"))
                {
                    foreach(Player, i)
                    {
                        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea")))
                        {
                            PlayAudioStreamForPlayerEx(i, "216.52.143.140:8000", GetPVarFloat(playerid, "pBoomBoxX"), GetPVarFloat(playerid, "pBoomBoxY"), GetPVarFloat(playerid, "pBoomBoxZ"), 30.0, 1);
                        }
                    }
                    SetPVarString(playerid, "pBoomBoxStation", "216.52.143.140:8000");
                }
            }
            else if(listitem == 3)
            {
                if(GetPVarType(playerid, "pBoomBox"))
                {
                    foreach(Player, i)
                    {
                        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea")))
                        {
                            PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=109008", GetPVarFloat(playerid, "pBoomBoxX"), GetPVarFloat(playerid, "pBoomBoxY"), GetPVarFloat(playerid, "pBoomBoxZ"), 30.0, 1);
                        }
                    }
                    SetPVarString(playerid, "pBoomBoxStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=109008");
                }
            }
            else if(listitem == 4)
            {
                if(GetPVarType(playerid, "pBoomBox"))
                {
                    foreach(Player, i)
                    {
                        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea")))
                        {
                            PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=467000", GetPVarFloat(playerid, "pBoomBoxX"), GetPVarFloat(playerid, "pBoomBoxY"), GetPVarFloat(playerid, "pBoomBoxZ"), 30.0, 1);
                        }
                    }
                    SetPVarString(playerid, "pBoomBoxStation", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=467000");
                }
            }
        }
        return 1;
    }
    if(dialogid == 7365)
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if(listitem == 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=148353");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=148353");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if(listitem == 2)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "216.52.143.140:8000");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "216.52.143.140:8000");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if(listitem == 3)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=109008");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=109008");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else if(listitem == 4)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=467000");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=467000");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
        }
        return 1;
    }
Reply
#2

I think they may be on the second dialog, case 0 - 3, nothing to close the if(IsPlayerInAnyVehicle(playerid))?
Reply
#3

Repair for me ?
Reply
#4

pawn Код:
if(listitem == 0)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            else if(listitem == 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=148353");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=148353");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            else if(listitem == 2)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "216.52.143.140:8000");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "216.52.143.140:8000");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            else if(listitem == 3)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=109008");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=109008");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
Reply
#5

Not working Pawno still crashing
Reply
#6

Quote:
Originally Posted by StuartD
Посмотреть сообщение
pawn Код:
if(listitem == 0)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=32999");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            else if(listitem == 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=148353");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=148353");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            else if(listitem == 2)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "216.52.143.140:8000");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "216.52.143.140:8000");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            else if(listitem == 3)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    foreach(Player, i) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid)) {
                        PlayAudioStreamForPlayerEx(i, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=109008");
                    }
                    format(stationidv[GetPlayerVehicleID(playerid)], 64, "%s", "http://yp.shoutcast.com/sbin/tunein-station.pls?id=109008");
                    format(string, sizeof(string), "* %s changes the radio station.", GetPlayerNameEx(playerid), string);
                    ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
STILL CRASHING
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)