[Include] Ban System for Hard Disk - Форум Cheat-Master.ru
  • Страница 1 из 1
  • 1
Модератор форума: Phoenixxx_Czar, Getbackthere, [CM]OlegEhtler  
Форум » Pawno программирование SAMP » Include и Plugins » [Include] Ban System for Hard Disk
[Include] Ban System for Hard Disk
Herro[CM] Дата: Вторник, 08.09.2015, 23:25 | Сообщение # 1
Бывалый
Сообщений: 425
Статус: Offline
Приветствую, уважаемые пользователи хочу с вами поделиться Системой блокировки пользователя по HDD

Код
/*
   @title C-Serial
   @author Carlton
   @copyright (2010)
     
   @functions
   native SerialBanPlayer(playerid, BanPlayer=true);
           native GetPlayerSerial(playerid);
   native RemoveSerialBan(serial[]);
   native IsPlayerSerialBanned(playerid);
   native OnPlayerSerialBanned(playerid);
   native AddSerialBan(serial[]);
*/
//=====================================
#define STORAGE_POSITION     ("SerialBans.txt")
#define SERIAL_SIZE      (25)
#define FILE_SIZE               (516)
#define STR_SIZE                (90)
//=====================================
native gpci ( playerid, serial [ ], maxlen );
//=====================================
forward OnPlayerSerialBanned(playerid);
//=====================================
static
   File:SerialFile,
   PlayerSerial[SERIAL_SIZE],
   cserialstring[STR_SIZE],
   Bans[FILE_SIZE]
;
//=====================================
stock AddSerialBan(serial[]) {
      if(!fexist(STORAGE_POSITION)) return 0;
      SerialFile = fopen(STORAGE_POSITION, io_append);
      gpci(playerid, PlayerSerial, sizeof PlayerSerial);
    format(cserialstring, sizeof cserialstring, "%s\r\n", PlayerSerial);

     fwrite(SerialFile, cserialstring);
      fclose(SerialFile);
}
stock GetPlayerSerial(playerid) {
          gpci(playerid, PlayerSerial, sizeof PlayerSerial);
    return PlayerSerial;
}
stock SerialBanPlayer(playerid, BanPlayer=true) {
   if(!fexist(STORAGE_POSITION))
    SerialFile = fopen(STORAGE_POSITION, io_write);
   else
    SerialFile = fopen(STORAGE_POSITION, io_append);
     
   gpci(playerid, PlayerSerial, sizeof PlayerSerial);
    format(cserialstring, sizeof cserialstring, "%s\r\n", PlayerSerial);
      
     fwrite(SerialFile, cserialstring);
      fclose(SerialFile);
      OnPlayerSerialBanned(playerid);
      if(BanPlayer == true) return BanEx(playerid, "Serial Numaran Sunucu Tarafэndan Yasaklandэ. N*h Girersin.!");
}
stock RemoveSerialBan(serial[]) {
      if(!fexist(STORAGE_POSITION)) return 0;
        
      SerialFile = fopen(STORAGE_POSITION, io_read);
   fread(SerialFile, Bans);
   fclose(SerialFile);
     
   strdel(Bans, strfind(Bans, serial), strlen(serial));
   fremove(STORAGE_POSITION);
     
   SerialFile = fopen(STORAGE_POSITION, io_write);
   fwrite(SerialFile, Bans);
      fclose(SerialFile);
      return 1;
}

stock IsPlayerSerialBanned(playerid) {
   if(!fexist(STORAGE_POSITION)) return 0;
     
    gpci(playerid, PlayerSerial, sizeof PlayerSerial);
   SerialFile = fopen(STORAGE_POSITION, io_read);
   fread(SerialFile, Bans);
   fclose(SerialFile);
     
   if(strfind(Bans, PlayerSerial, true) != -1) return 1;
   return 0;
}


Код

SerialBanPlayer(playerid, BanPlayer=true); // Блокировка игрока
GetPlayerSerial(playerid);  //  Получение серийного номера
RemoveSerialBan(serial[]); // Удаляет серийный номер   
AddSerialBan(serial[]);      // Добавляет серийный номер  


Пример команды:
Код
if(strcmp(cmdtext,"/hban",true)==0)   
{   
       SerialBanPlayer(playerid);   
       return 1;   
}  


Автор: h424n



Когда нет знания, есть мнение.

Сообщение отредактировал Herro[CM] - Вторник, 08.09.2015, 23:26
Плисс Дата: Вторник, 19.07.2016, 21:06 | Сообщение # 2
Боец
Сообщений: 70
Статус: Offline
Christian_Chavez
Форум » Pawno программирование SAMP » Include и Plugins » [Include] Ban System for Hard Disk
  • Страница 1 из 1
  • 1
Поиск:
Статистика Форума
Лучшие пользователи
Admin [39113]

GеNius [7209]

[CM]Russel [5557]

kenlo763 [4952]

[CM]AGRESSOR [4639]

Snake_Firm [4452]

Сэс [4416]

Artem_Buero [4223]

[CM]Durman [3204]

[CM]Рафаэль [3080]

iMaddy [2855]

sky_Woker [2854]

getrekt [2745]

Новые пользователи
donaldga2 [05:28]

rubenia18 [21:17]

pokotiloroman91 [18:24]

stephensh5 [12:00]

calliesv7 [06:11]

louqm16 [22:14]

artushak [16:32]

Kingpolker [15:42]

leeyv11 [15:12]

Trappa17 [01:00]

Djamalchik [16:40]

ajeense [14:24]

654470559 [08:55]