Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // by Victor
- #include a_samp
- #if defined ___vDBG_included___
- #error ___vDBG_included___ ja esta definido! usando a include 2 vezes no mesmo script?
- #endif
- #define ___vDBG_included___
- #define CDebug::%0(%1) forward %0(%1); \
- public %0(%1)
- #define cDebug->%0(%1) %0(%1)
- #define varCDebug new
- #define FALSE 0
- #define TRUE 1
- enum eDebug
- {
- DebugUF[64],
- }
- varCDebug vDebug[eDebug];
- CDebug::MarcarUltimaFuncao(vDebug_funcao[])
- {
- if(strlen(vDebug_funcao) < 1) return FALSE;
- varCDebug vDebug_hora, vDebug_minuto, vDebug_segundo, vDebug_ano, vDebug_mes, vDebug_dia;
- gettime(vDebug_hora, vDebug_minuto, vDebug_segundo);
- getdate(vDebug_ano, vDebug_mes, vDebug_dia);
- format(vDebug[DebugUF], 64, "[%i-%i-%i . %i/%i/%i] %s",
- vDebug_hora, vDebug_minuto, vDebug_segundo, vDebug_ano,
- vDebug_mes, vDebug_dia, vDebug_funcao);
- varCDebug File:arq = fopen("Debug/UF.txt", io_write);
- if(!arq) return FALSE;
- fwrite(arq, vDebug[DebugUF]);
- fclose(arq);
- return TRUE;
- }
- CDebug::LerUltimaFuncao(vDebug_str[])
- {
- varCDebug File:arq = fopen("Debug/UF.txt", io_read);
- if(!arq) return FALSE;
- fread(arq, vDebug_str, 64);
- fclose(arq);
- return TRUE;
- }
- // Exemplo
- public OnFilterScriptInit()
- {
- cDebug->MarcarUltimaFuncao("OnFilterScriptInit()");
- varCDebug vDebug_ReadStr[64];
- cDebug->LerUltimaFuncao(vDebug_ReadStr);
- printf("%s", vDebug_ReadStr);
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement