Raised This Month: $51 Target: $400
 12% 

error 054: unmatched closing brace ("}")


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NC.svtrade
Senior Member
Join Date: Nov 2015
Old 11-10-2017 , 14:14   error 054: unmatched closing brace ("}")
Reply With Quote #1

Error:

C:\Users\이지민\Desktop\TF2 Modding\My Plugins\My Mods\CSGO\Testing\FileDownloader.sp(30) : error 054: unmatched closing brace ("}")
C:\Users\이지민\Desktop\TF2 Modding\My Plugins\My Mods\CSGO\Testing\FileDownloader.sp(40) : error 054: unmatched closing brace ("}")
C:\Users\이지민\Desktop\TF2 Modding\My Plugins\My Mods\CSGO\Testing\FileDownloader.sp(52) : error 054: unmatched closing brace ("}")
C:\Users\이지민\Desktop\TF2 Modding\My Plugins\My Mods\CSGO\Testing\FileDownloader.sp(64) : error 054: unmatched closing brace ("}")


Code:

Code:
stock void Downloader_PrecacheFile(String:name[], int flag) {
	new String:Buffer[PLATFORM_MAX_PATH];
	
	switch(flag) {
		case DWNTYPE_MDL: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name, DEF_MDL_INST); if(FileExists(Buffer)) PrecacheModel(Buffer, true);
		case DWNTYPE_DEC: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name, DEF_DEC_INST); if(FileExists(Buffer)) PrecacheDecal(Buffer, true);
		case DWNTYPE_SND: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name, DEF_SND_INST); if(FileExists(Buffer)) PrecacheSound(Buffer, true);
	}
} // Line 30

stock void Downloader_AddToDownloadTable(String:name[], int flag) {
	new String:Buffer[PLATFORM_MAX_PATH];
	
	switch(flag) {
		case DWNTYPE_MDL: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name, DEF_MDL_INST); if(FileExists(Buffer)) AddFileToDownloadsTable(Buffer);
		case DWNTYPE_DEC: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name, DEF_DEC_INST); if(FileExists(Buffer)) AddFileToDownloadsTable(Buffer);
		case DWNTYPE_SND: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name, DEF_SND_INST); if(FileExists(Buffer)) AddFileToDownloadsTable(Buffer);
	}
} // Line 40

stock void Downloader_PrecacheFilePack(String:name[][], int size, int flag) {
	new String:Buffer[PLATFORM_MAX_PATH], i = 0;
	
	while (!StrEqual(name[i], "") && i =< size - 1) {
		switch(flag) {
			case DWNTYPE_MDL: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name[i], DEF_MDL_INST); if(FileExists(Buffer)) PrecacheModel(Buffer, true); i += 1;
			case DWNTYPE_DEC: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name[i], DEF_DEC_INST); if(FileExists(Buffer)) PrecacheDecal(Buffer, true); i += 1;
			case DWNTYPE_SND: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name[i], DEF_SND_INST); if(FileExists(Buffer)) PrecacheSound(Buffer, true); i += 1;
		}
	}
} // Line 52

stock void Downloader_AddToDownloadTablePack(String:name[][], int size, int flag) {
	new String:Buffer[PLATFORM_MAX_PATH];
	
	while (!StrEqual(name[i], "") && i =< size - 1) {
		switch(flag) {
			case DWNTYPE_MDL: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name[i], DEF_MDL_INST); if(FileExists(Buffer)) AddFileToDownloadsTable(Buffer); i += 1;
			case DWNTYPE_DEC: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name[i], DEF_DEC_INST); if(FileExists(Buffer)) AddFileToDownloadsTable(Buffer); i += 1;
			case DWNTYPE_SND: Format(Buffer, PLATFORM_MAX_PATH, "%s/%s%s", g_sDefDir, name[i], DEF_SND_INST); if(FileExists(Buffer)) AddFileToDownloadsTable(Buffer); i += 1;
		}
	}
} // Line 64
Help!

Last edited by NC.svtrade; 11-10-2017 at 14:19.
NC.svtrade is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 11-10-2017 , 16:47   Re: error 054: unmatched closing brace ("}")
Reply With Quote #2

If you want multiple statements in a switch case, you need to put them in braces.

You have a typo and need <= and not =<.

It might be the errors you pasted are caused by lines before the line numbers indicated.
Fyren is offline
Reply



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 06:56.


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