Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Crie um arquivo chamado "agendargmx.txt" e adicione na seguinte forma:
- DIA-MES-ANO: Mensagem
- Exemplo:
- 04-11-2013:Manutenção De segurança
- */
- VerifyGMX(); public VerifyGMX(){
- static
- File: Arquivo,
- Linha[128],
- Datas[3],
- Data[3],
- Tamanho
- ;
- Arquivo = fopen("agendargmx.txt", io_read);
- while(fread(Arquivo, Linha)){
- Tamanho = strlen(Linha);
- if(!strfind(Linha, "\r\n")){
- strdel(Linha, Tamanho-2, Tamanho);
- }
- if(!strfind(Linha, "\n")){
- strdel(Linha, Tamanho-1, Tamanho);
- }
- static
- tmp_file[13]
- ;
- strmid(tmp_file, Linha, 0, strfind(Linha, "-"));
- Datas[0] = strval(tmp_file); // DIA
- strdel(Linha, 0, strfind(Linha, "-")+1);
- strmid(tmp_file, Linha, 0, strfind(Linha, "-"));
- Datas[1] = strval(tmp_file); // MES
- strdel(Linha, 0, strfind(Linha, "-")+1);
- strmid(tmp_file, Linha, 0, strfind(Linha, ":"));
- Datas[2] = strval(tmp_file); // ANO
- strdel(Linha, 0, strfind(Linha, ":") + 1);
- getdate(Data[0], Data[1], Data[2]);
- if(Data[0] == Datas[2]){
- if(Datas[1] == Data[1]){
- if(Datas[0] == Data[2]){
- SendClientMessageToAll(-1, "Manutenção Agendada, ações");
- SendClientMessageToAll(-1, Linha);
- }
- }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement