Guest User

....

a guest
Oct 2nd, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.17 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. #include <zcmd>
  7. #include <sscanf2>
  8. #include <dini>
  9.  
  10. #define FILE_MODS "Mods/ListaModow.ini"
  11. #define FILE_SETTINGS "Mods/PassMod.ini"
  12.  
  13. new Moderator[MAX_PLAYERS];
  14. new ModPass[60];
  15.  
  16. #define COLOR_WHITE 0xFFFFFFAA
  17. #define COLOR_ADMIN 0xFF0000AA
  18. #define COLOR_RED2 0xFF0000FF
  19.  
  20. CMD:mhaslo(playerid,cmdtext[]){//Na Dole Mapy!
  21.  
  22.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED2,"Nie jesteś administratorem RCON!");
  23.  
  24.     new haslo[61];
  25.     if(sscanf(cmdtext,"s[61]",haslo)){
  26.         SendClientMessage(playerid, COLOR_WHITE,"wpisz: /Mhaslo [haslo]");
  27.         return 1;
  28.     }
  29.  
  30.     if(strlen(haslo) > 60) return SendClientMessage(playerid, COLOR_WHITE,"Hasło może mieć max. 60 znaków");
  31.  
  32.     format(ModPass,sizeof(ModPass),"%s",haslo);
  33.     dini_Set(FILE_SETTINGS,"Mod_Pass",haslo);
  34.  
  35.     new tmp[80];
  36.     format(tmp,sizeof(tmp),"Haslo Moderatora To -->> %s <<--",haslo);
  37.     SendClientMessage(playerid,-1,tmp);
  38.  
  39.     return 1;
  40. }
  41.  
  42. CMD:mlogin(playerid,cmdtext[]){//Na Dole Mapy!
  43.  
  44.     new haslo[64];
  45.     if(sscanf(cmdtext,"s[64]",haslo)){
  46.         SendClientMessage(playerid, COLOR_WHITE,"wpisz: /Mlogin [haslo]");
  47.         return 1;
  48.     }
  49.  
  50.     if(Moderator[playerid]){
  51.         SendClientMessage(playerid,COLOR_RED2,"Jestes juz zalogowany(a) na moderatora!");
  52.         return 1;
  53.     }
  54.  
  55.     if(strfind(haslo,ModPass,false) == 0){
  56.  
  57.         new playername[MAX_PLAYER_NAME];
  58.         GetPlayerName(playerid,playername,sizeof(playername));
  59.  
  60.         new tmp[256];
  61.         tmp = dini_Get(FILE_MODS,playername);
  62.         new CanLog = strval(tmp);
  63.  
  64.         if(CanLog < 1){
  65.             format(tmp, sizeof(tmp), "%s zostal(a) wyrzucony(a) , Powod: Nieautoryzowane logowanie na Moderatora", playername, playerid);
  66.             SendClientMessageToAll(COLOR_ADMIN, tmp);
  67.             Kick(playerid);
  68.             return 1;
  69.         }
  70.         Moderator[playerid] = true;
  71.         SetPlayerColor(playerid, 0xFF0000AA);
  72.         PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
  73.  
  74.         format(tmp, sizeof(tmp), "%s (ID: %d) zalogował(a) się jako Moderator", playername, playerid);
  75.         SendClientMessageToAll(COLOR_RED2, tmp);
  76.  
  77.     }else{
  78.         SendClientMessage(playerid,COLOR_RED2,"Bledne Haslo !");
  79.     }
  80.     return 1;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment