Radio system error! Help me
#1

Hey guys I added a radio system to my script heres the code;

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_PINK 0xFFC0CBAA
#define COLOR_RED 0xAA3333AA

public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" Online Radio script by Edge");
        print("--------------------------------------\n");
        return 1;
}

main()
{
        print("\n----------------------------------");
        print(" Online Radio script by Edge");
        print("----------------------------------\n");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if(strcmp("/radio", cmdtext, true, 10) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"Radio Stations","Please type /radio [1-] ","Ok","Cancel");
        SendClientMessage(playerid, COLOR_WHITE, "You are now viewing the list Of Radio Stations");
        SendClientMessage(playerid, COLOR_RED, "Please use /off to turn the radio off.");
        return 1;
}
        if(strcmp("/radiolit", cmdtext, true, 10) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"Radio Stations","Station 1 - Kiss 100, Station 2 - Capital FM, Station 3 - London's Heart, Station 4 - Choice FM ","Ok","Cancel");
        SendClientMessage(playerid, COLOR_WHITE, "You are now viewing the list Of Radio Stations");
        SendClientMessage(playerid, COLOR_RED, "Please use /off to turn the radio off.");

        if (strcmp("/off", cmdtext, true, 10) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        StopAudioStreamForPlayer(playerid);
        SendClientMessage(playerid, 0xAA3333AA, "You have turned the radio off!");
        return 1;
}

        if (strcmp("/st1", cmdtext, true) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        PlayAudioStreamForPlayer(playerid, "http://kiss100.ukradioplayer.kissfmuk.com/console");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen Channel 1, Type /off to stop.");
        return 1;
}
        if (strcmp("/st2", cmdtext, true) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=285516");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen Channel 2, Type /off to stop audio streaming.");
        return 1;
}
        if (strcmp("/st3", cmdtext, true) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2187022");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen Channel 3, Type /off to stop audio streaming.");
        return 1;
}
        if (strcmp("/st4", cmdtext, true) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen Channel 4, Type /off to stop audio streaming.");
        return 1;
}


        return 0;
}

I also get this error in compiler


Код:
C:\Documents and Settings\Danny.YOUR-E6F02835AE\My Documents\GTA SA Server\filterscripts\radiothing.pwn(110) : error 030: compound statement not closed at the end of file (started at line 55)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Please help
Reply
#2

You're missing a closing bracket (}). There is nothing closing the radiolit command.

It should look something like this:

Код:
if(strcmp("/radiolit", cmdtext, true, 10) == 0)
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"Radio Stations","Station 1 - Kiss 100, Station 2 - Capital FM, Station 3 - London's Heart, Station 4 - Choice FM ","Ok","Cancel");
    SendClientMessage(playerid, COLOR_WHITE, "You are now viewing the list Of Radio Stations");
    SendClientMessage(playerid, COLOR_RED, "Please use /off to turn the radio off.");
} // <----- This is what you're missing.
Reply
#3

pawn Код:
error 030: compound statement not closed at the end of file (started at line 55)
that error is showing you that you missed some closing brackets (})
hope you learned new something

Fixed Script
pawn Код:
#include <a_samp>

#define FILTERSCRIPT

#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_PINK 0xFFC0CBAA
#define COLOR_RED 0xAA3333AA

public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" Online Radio script by Edge");
        print("--------------------------------------\n");
        return 1;
}

main()
{
        print("\n----------------------------------");
        print(" Online Radio script by Edge");
        print("----------------------------------\n");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if(strcmp("/radio", cmdtext, true, 10) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"Radio Stations","Please type /radio [1-] ","Ok","Cancel");
        SendClientMessage(playerid, COLOR_WHITE, "You are now viewing the list Of Radio Stations");
        SendClientMessage(playerid, COLOR_RED, "Please use /off to turn the radio off.");
        return 1;
}
        if(strcmp("/radiolit", cmdtext, true, 10) == 0)
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX ,"Radio Stations","Station 1 - Kiss 100, Station 2 - Capital FM, Station 3 - London's Heart, Station 4 - Choice FM ","Ok","Cancel");
    SendClientMessage(playerid, COLOR_WHITE, "You are now viewing the list Of Radio Stations");
    SendClientMessage(playerid, COLOR_RED, "Please use /off to turn the radio off.");  
    return 1;
}

        if (strcmp("/off", cmdtext, true, 10) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        StopAudioStreamForPlayer(playerid);
        SendClientMessage(playerid, 0xAA3333AA, "You have turned the radio off!");
        return 1;
}

        if (strcmp("/st1", cmdtext, true) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        PlayAudioStreamForPlayer(playerid, "http://kiss100.ukradioplayer.kissfmuk.com/console");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen Channel 1, Type /off to stop.");
        return 1;
}
        if (strcmp("/st2", cmdtext, true) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=285516");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen Channel 2, Type /off to stop audio streaming.");
        return 1;
}
        if (strcmp("/st3", cmdtext, true) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2187022");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen Channel 3, Type /off to stop audio streaming.");
        return 1;
}
        if (strcmp("/st4", cmdtext, true) == 0)
{
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen Channel 4, Type /off to stop audio streaming.");
        return 1;
}


        return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)