Advertisement
Dayrion

aa

May 28th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.75 KB | None | 0 0
  1. public adminChat(string[], color) // Send a msg to every online admin
  2. {
  3.     foreach(new i : Player)
  4.     {
  5.         if(PlayerInfo[i][pAdminlvl] > 0 || IsPlayerAdmin(i)) // change this PlayerInfo[i][pAdminlvl] > 0
  6.         {
  7.             SendClientMessage(i, color, string[0]);
  8.         }
  9.     }
  10.     new jour, mois, heure, minute, seconde, anne, str[190];
  11.     new File:pos=fopen("LOG_AdminAlert.txt", io_append);
  12.     gettime(heure, minute, seconde);
  13.     getdate(anne, mois, jour);
  14.     format(str,sizeof(str),"\r\n[%02i/%02i/%02i] %02i:%02i:%02i : %s", jour, mois, anne, heure, minute, seconde, string);
  15.     fwrite(pos,str);
  16.     fclose(pos);
  17.     return 1;
  18. }
  19.  
  20.  
  21. stock aAlert(commande[], id) // when a player make a command
  22. {
  23.         new str[200], count=0;
  24.         if(PlayerInfo[id][pAdminlvl] > 0) // change
  25.         {
  26.             format(str, 200, "[AdminCmd] ADMIN %s (ID: %i) used the command %s", GetName(id), id, commande);
  27.         }
  28.         else //if(PlayerInfo[id][pAdminlvl] != 4) // change
  29.         {
  30.             format(str, 200, "[AdminCmd] %s (ID: %i) used the command : %s", GetName(id), id, commande);
  31.         }
  32.         if(strlen(str) == 0) return 1;
  33.         foreach(new i : Player)
  34.         {
  35.             if(PlayerInfo[i][pAdminlvl] == 5 && count == 0) // change
  36.             {
  37.                 SendClientMessage(i, X11_TAN, str);
  38.                 count ++;
  39.             }
  40.             break;
  41.         }
  42.         new jour, mois, heure, minute, seconde, anne, str3[300];
  43.         new File:pos=fopen("LOG_AdminCmd.txt", io_append);
  44.         gettime(heure, minute, seconde);
  45.         getdate(anne, mois, jour);
  46.         format(str3,sizeof(str3),"\r\n[ADMIN/CMD] [%02i/%02i/%02i] %02i:%02i:%02i | %s USED %s", jour, mois, anne, heure, minute, seconde, GetName(id), commande);
  47.         fwrite(pos,str3);
  48.         fclose(pos);
  49.         return 1;
  50. }
  51.  
  52. stock GetName(playerid)
  53. {
  54.     new gName[MAX_PLAYER_NAME];
  55.     GetPlayerName(playerid, gName, sizeof(gName));
  56.     return gName;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement