Coloque isto com as includes #include < DOF2 > Coloque junto com as new enum pAInfo{ cMotivoAgendou[128], cAdminAgendou[64],}; new AgendouInfo[MAX_PLAYERS][pAInfo]; coloque isto na Public OnGameModeExit DOF2_Exit(); Coloque isto na public OnCommandText if(strcmp(cmd, "/agendarcadeia",true) == 0 || strcmp(cmd, "/agendar",true) == 0) { if(IsPlayerConnected(playerid)) { new tmpo[20]; if(PlayerInfo[playerid][pAdmin] < 1) { SendClientMessage(playerid, COLOR_GREY, " Vocк nгo esta autorizado para usar este comando!"); return true; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /agendarcadeia [NOME_CORRETO] [Tempo] [Motivo]"); return true; } tmpo = strtok(cmdtext, idx); if(!strlen(tmpo)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /agendarcadeia [NOME_CORRETO] [Tempo] [Motivo]"); return true; } new tempo2 = strval(tmpo); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /agendarcadeia [NOME_CORRETO] [Tempo] [Motivo]"); return true; } GetPlayerName(playerid, sendername, sizeof(sendername)); new arquivo[128]; format(arquivo, sizeof(arquivo), "Contas/%s.ini",tmp); if(!DOF2_FileExists(arquivo)) { SendClientMessage(playerid, COLOR_WHITE, "[ERRO] Este nick nгo estб registrado no Brasil PlayHappy!"); return true; } format(string, sizeof(string), "O Admin %s agendou o nick %s para %d minutos de cadeia, Motivo: %s",PlayerName(playerid), tmp, tempo2, (result)); SendClientMessageToAll(COLOR_LIGHTRED, string); AgendarLog(string); DOF2_SetInt(arquivo,"Jailed",9); DOF2_SetInt(arquivo,"JailTime",tempo2 * 60); strmid(AgendouInfo[playerid][cAdminAgendou], sendername, 0, strlen(sendername), MAX_PLAYER_NAME); DOF2_SetString(arquivo,"AdminAgendou",sendername); strmid(AgendouInfo[playerid][cMotivoAgendou], result, 0, strlen(result), MAX_PLAYER_NAME); DOF2_SetString(arquivo,"MotivoAgendou",result); DOF2_SetInt(arquivo,"Agendado",1); DOF2_SetInt(arquivo,"TempoAgendado",tempo2); DOF2_SaveFile(); } return true; } Coloque isto junto com as stocks stock AgendarLog(string[]) { new entry[128]; format(entry, sizeof(entry), "%s\n",string); new File:hFile; hFile = fopen("AgendarCadeia.log", io_append); fwrite(hFile, entry); fclose(hFile); }
//Coloque isto com as includes
#include < Dini >
//Coloque junto com as new
enum pAInfo{
cMotivoAgendou[128],
cAdminAgendou[64],};
new AgendouInfo[MAX_PLAYERS][pAInfo];
//Coloque isto na public OnCommandText
if(strcmp(cmd, "/agendarcadeia",true) == 0 || strcmp(cmd, "/agendar",true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpo[20];
if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo esta autorizado para usar este comando!");
return true;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /agendarcadeia [NOME_CORRETO] [Tempo] [Motivo]");
return true;
}
tmpo = strtok(cmdtext, idx);
if(!strlen(tmpo))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /agendarcadeia [NOME_CORRETO] [Tempo] [Motivo]");
return true;
}
new tempo2 = strval(tmpo);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /agendarcadeia [NOME_CORRETO] [Tempo] [Motivo]");
return true;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new arquivo[128];
format(arquivo, sizeof(arquivo), "Contas/%s.ini",tmp);
if(!dini_Exists(arquivo))
{
SendClientMessage(playerid, COLOR_WHITE, "[ERRO] Este nick nгo estб registrado no Brasil PlayHappy!");
return true;
}
format(string, sizeof(string), "O Admin %s agendou o nick %s para %d minutos de cadeia, Motivo: %s",PlayerName(playerid), tmp, tempo2, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
AgendarLog(string);
dini_IntSet(arquivo,"Jailed",9);
dini_IntSet(arquivo,"JailTime",tempo2 * 60);
strmid(AgendouInfo[playerid][cAdminAgendou], sendername, 0, strlen(sendername), MAX_PLAYER_NAME);
dini_Set(arquivo,"AdminAgendou",sendername);
strmid(AgendouInfo[playerid][cMotivoAgendou], result, 0, strlen(result), MAX_PLAYER_NAME);
dini_Set(arquivo,"MotivoAgendou",result);
dini_IntSet(arquivo,"Agendado",1);
dini_IntSet(arquivo,"TempoAgendado",tempo2);
}
return true;
}
//Coloque isto junto com as stocks
stock AgendarLog(string[])
{
new entry[128];
format(entry, sizeof(entry), "%s\n",string);
new File:hFile;
hFile = fopen("AgendarCadeia.log", io_append);
fwrite(hFile, entry);
fclose(hFile);
}