AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error 033 Help (https://forums.alliedmods.net/showthread.php?t=194117)

poke722 08-25-2012 11:59

Error 033 Help
 
I'm trying to add on some code to a End Round Music plugin so it will display the title of the song and the artist. However no matter what I do I get an error message.

Error:
Code:

/groups/sourcemod/upload_tmp/textX7WO3V.sp(125) : error 033: array must be indexed (variable "musicfile")
Line of code that's broken:
Code:

(125)                if (musicfile == "LARoundEnd/ermsong1.mp3"){
(126)                        PrintCenterTextAll("Song Title - Author");
(127)                }

Function that's broken:
Code:

public Event_TeamPlayRoundWin(Handle:event, const String:name[], bool:dontBroadcast)
{
        if (GetArraySize(g_Array_PerMapMusicFiles) == 0) {
                return;
        }
        // play music
        decl String:musicfile[PLATFORM_MAX_PATH];
        GetArrayString(g_Array_PerMapMusicFiles, g_Cursor, musicfile, sizeof(musicfile));
        decl String:playcmd[PLATFORM_MAX_PATH];
        Format(playcmd, sizeof(playcmd), "play \"%s\"", musicfile);
        for (new i = 1; i < MaxClients; i++) {
                if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i) &&
                        g_ClientCookies[i] == MUSIC_ENABLED)
                {
                        //EmitSoundToClient(i, musicfile);
                        ClientCommand(i, playcmd);
                }
        }
        g_Cursor++;
        if (g_Cursor == GetArraySize(g_Array_PerMapMusicFiles)) {
                g_Cursor = 0;
        }

        PrintToChatAll("musicfile: %s", musicfile);

        if (musicfile == "LARoundEnd/ermsong1.mp3"){
                PrintCenterTextAll("Song Title - Author");
        }

}

How do I fix this problem? Let me know if there's any other parts of the code that you need.

fysiks 08-25-2012 12:04

Re: Error 033 Help
 
Post in the SourceMod section.

poke722 08-25-2012 12:05

Re: Error 033 Help
 
Sorry. Can do. Sorry about putting it in the wrong area.


All times are GMT -4. The time now is 05:48.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.