CMD:help(playerid,params[]) { new command[128],suggestions[4][128],temp[128]; new success = 0; new sugcount = 0; new tracksug = 1; new fm[128] = "Error: Could not find any matches for the specified command. (Entered \"%s\")."; if(!sscanf(params,"s",command)) { new commandArray[2][3][128] = {{"/admin","/admin [optional: id] [optional:1/0] (Must enter at least one parameter)","Returns if a player is admin or can be used to give or take admin status."},{"/help","/help /[command]","Returns information about the entered command (must include slash before command)"}}; if(command[0] == "/") { new i; for(i = 0; i < sizeof(commandArray); i++) { if(command == commandArray[i][0]) { SuccessMessage(playerid,commandArray[i][1]); SuccessMessage(playerid,commandArray[i][2]); success = 1; } else if(tracksug == 1) { strmid(suggestions[sugcount],commandArray[i][0],0,sizeof(command),sizeof(suggestions[sugcount]); if(strcmp(command,suggestions[sugcount])) { sugcount++; if(sugcount == 4) tracksug = 0; } else { suggestions[sugcount] = ""; } } else if(tracksug == 0) { strmid(temp,commandArray[i][0],0,sizeof(command),sizeof(suggestions[sugcount]); if(strcmp(command,temp)) { sugcount++; } } } if(i == sizeof(commandArray) && success == 0) { if(sugcount == 0) { format(fm,sizeof(fm),fm,command); ErrorMessage(playerid,fm); } else if(sugcount > 0) { if(tracksug == 1) { fm = "Error: Found %i similar commands, but no exact match. (Entered \"%s\"):"; new fm2[128]; if(sugcount == 1) { fm2 = "%s"; format(fm2,sizeof(fm2),fm2,suggestions[0]); } else if(sugcount == 2) { fm2 = "%s or %s"; format(fm2,sizeof(fm2),fm2,suggestions[0],suggestions[1],"",""); } else if(sugcount == 3) { fm2 = "%s, %s, or %s"; format(fm2,sizeof(fm2),fm2,suggestions[0],suggestions[1],suggestions[2],""); } else if(sugcount == 4) { fm2 = "%s, %s, %s, or %s"; format(fm2,sizeof(fm2),fm2,suggestions[0],suggestions[1],suggestions[2],suggestions[3]); } format(fm,sizeof(fm),fm,sugcount,command); } else if(tracksug == 0) { fm = "Error: Found over 4 similar commands (Entered \"%s\"):"; new fm2 = "%s, %s, %s, %s, and %i unshown others (use /commands to see all existing commands)"; format(fm,sizeof(fm),fm,command); format(fm2,sizeof(fm2),fm2,suggestions[0],suggestions[1],suggestions[2],suggestions[3],sugcount - 4); } } } } else { ErrorMessage(playerid,"USAGE: /help /[command]"); } } else if(sscanf(params,"s",command)){ ErrorMessage(playerid,"USAGE: /help /[command]"); } return 1; }
I can't find any unusual things in this code. Try commenting if statement for if statement (including the opening and closing brackets of that statement), and check when it compiles. That way you might find which part of the code is causing the problem. When you find it, check if you see the problem, if not, post the crashing code here. I know, it's kind of a shitty job, but that's the only way as I see it.
For the information of others, the brackets are not the problem here, there are 24 '{' brackets and 24 '}' brackets. I hope you can find the problem. |