Raised This Month: $ Target: $400
 0% 

Error 033 Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
poke722
New Member
Join Date: Aug 2012
Old 08-25-2012 , 11:59   Error 033 Help
Reply With Quote #1

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.
poke722 is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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