#tryinclude #if !defined _INC_y_va #define InsertDebugLine(%0) InsertDebugLine_((format(formatBuffer, 100, %0), formatBuffer)) static formatBuffer[100]; #else #define InsertDebugLine InsertDebugLine_ #endif static Text:TD_DebugConsole[14]; static debugLines[13][100]; static debugConsole, debugIndex, debugCount; #if defined _INC_y_va InsertDebugLine_(line[], va_args<>) { static buffer[100]; va_format(buffer, _, line, va_start<1>); #else InsertDebugLine(buffer[]) { #endif if(debugCount < 13) { format(debugLines[debugCount], 100, buffer); TextDrawSetString(TD_DebugConsole[++debugCount], buffer); } else { format(debugLines[debugIndex++], 100, buffer); if(debugIndex == 13) { debugIndex = 0; } for(new i = 1, x = debugIndex; i < 14; ++i, ++x) { if(x == 13) { x = 0; } TextDrawSetString(TD_DebugConsole[i], isnull(debugLines[x]) ? (" ") : debugLines[x]); } } } ClearDebugLines() { for(new i; i < sizeof debugLines; ++i) { debugLines[i][0] = EOS; debugIndex = debugCount = 0; } } ToggleDebugLines(playerid) { if(debugConsole ^= 1) { for(new i; i < sizeof TD_DebugConsole; ++i) { TextDrawShowForPlayer(playerid, TD_DebugConsole[i]); } } else { for(new i; i < sizeof TD_DebugConsole; ++i) { TextDrawHideForPlayer(playerid, TD_DebugConsole[i]); } } } public OnGameModeInit() { TD_DebugConsole[0] = TextDrawCreate(174.275192, 281.000030, "box"); TextDrawLetterSize(TD_DebugConsole[0], 0.000000, 19.651535); TextDrawTextSize(TD_DebugConsole[0], 490.556304, 0.000000); TextDrawAlignment(TD_DebugConsole[0], 1); TextDrawColor(TD_DebugConsole[0], -1); TextDrawUseBox(TD_DebugConsole[0], 1); TextDrawBoxColor(TD_DebugConsole[0], 194); TextDrawSetShadow(TD_DebugConsole[0], 0); TextDrawSetOutline(TD_DebugConsole[0], 0); TextDrawBackgroundColor(TD_DebugConsole[0], 255); TextDrawFont(TD_DebugConsole[0], 1); TextDrawSetProportional(TD_DebugConsole[0], 1); TextDrawSetShadow(TD_DebugConsole[0], 0); for(new i = 1; i < 14; ++i) { TD_DebugConsole[i] = TextDrawCreate(182.240112, 286.25 + 14.0 * (i - 1), " "); TextDrawLetterSize(TD_DebugConsole[i], 0.200000, 1.200000); TextDrawTextSize(TD_DebugConsole[i], 481.003326, 0.000000); TextDrawAlignment(TD_DebugConsole[i], 1); TextDrawColor(TD_DebugConsole[i], -1); TextDrawUseBox(TD_DebugConsole[i], 1); TextDrawBoxColor(TD_DebugConsole[i], 0); TextDrawSetShadow(TD_DebugConsole[i], 0); TextDrawSetOutline(TD_DebugConsole[i], 0); TextDrawBackgroundColor(TD_DebugConsole[i], 0); TextDrawFont(TD_DebugConsole[i], 2); TextDrawSetProportional(TD_DebugConsole[i], 1); TextDrawSetShadow(TD_DebugConsole[i], 0); } #if defined IGDL_OnGameModeInit IGDL_OnGameModeInit(); #endif } #if defined _ALS_OnGameModeInit #undef OnGameModeInit #else #define _ALS_OnGameModeInit #endif #define OnGameModeInit IGDL_OnGameModeInit #if defined IGDL_OnGameModeInit forward IGDL_OnGameModeInit(); #endif