[Include] AntiInfiniteAmmo - Форум Cheat-Master.ru
  • Страница 1 из 1
  • 1
Модератор форума: Phoenixxx_Czar, Getbackthere, [CM]OlegEhtler  
[Include] AntiInfiniteAmmo
Herro[CM] Дата: Среда, 09.09.2015, 23:20 | Сообщение # 1
Бывалый
Сообщений: 425
Статус: Offline
Предоставляю вам include на запрет бесконечных патрон при стрельбе из оружия.

Установка:
Код

#include <ammo.inc>     -  Кидаем в начала скрипта/мода


Сам Include
Код

#if !defined _samp_included
         #error Please include "samp.inc"
#endif
#if !defined AMMO_INC
         #define  AMMO_INC
         
         #define ammo::                  ammo_
         #define valid_w<%0>             (%0>=22&&%0<=42)
   
         enum ammo::enum {
                 bool: ammo::detect,
                 ammo::count[ 13 ],
                 ammo::warns[ 13 ]
         };
         static ammo::Info[ MAX_PLAYERS ][ ammo::enum ];
         
         static shandle[144], player[24], weapon[28];
         
         
         public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid) {
                 if(valid_w<weaponid>) {
                         new p_ammo, slot = ammo::getWeaponSlot(weaponid);
                         GetPlayerWeaponData(playerid, slot, weaponid, p_ammo);
                         if(ammo::Info[playerid][ammo::count][slot] == p_ammo) {
                    if(!ammo::IsBetweenDistancePlayers(playerid, damagedid, 1.0)) {
                    ammo::Info[playerid][ammo::warns][slot] ++;
                    if(ammo::Info[playerid][ammo::warns][slot] >= 5 && ammo::Info[playerid][ammo::warns][slot] < 8) {
                    if(!ammo::Info[playerid][ammo::detect]) {
                    ammo::Info[playerid][ammo::detect] = true ;
                    GetPlayerName(playerid, player, 24), GetWeaponName(weaponid, weapon, 28);
                    format(shandle, sizeof shandle, "*(AC) %s[%i][%s] использует чит. ( Бесконечные патроны )",
                    player, playerid, weapon), sendToAdmin(shandle);
                    }
                    } else if(ammo::Info[playerid][ammo::warns][slot] >= 8) {
                    GetPlayerName(playerid, player, 24), GetWeaponName(weaponid, weapon, 28);
                    format(shandle, sizeof shandle, "*(AC) %s[%i][%s] был кикнут за использование читов. ( Бесконечные патроны )",
                    player, playerid, weapon), sendToAdmin(shandle);
                    SendClientMessage(playerid, 0xFF6347AA, "*(AC) Вы были кикнуты! Причина: Бесконечные патроны"),
                    Kick(playerid);
                    
                    ammo::Info[playerid][ammo::detect] = false ;
                    ammo::Info[playerid][ammo::count][slot] = 0;
                    ammo::Info[playerid][ammo::warns][slot] = 0;
                    
                    return 0 ;
                    }
                    }
                         } else {
                    ammo::Info[playerid][ammo::detect] = false ;
                    ammo::Info[playerid][ammo::warns][slot] = 0 ;
                    ammo::Info[playerid][ammo::count][slot] = p_ammo;
                         }
                 }
                 return CallLocalFunction("ammo_OnPlayerGiveDamage", "iifi", playerid, damagedid, amount, weaponid) ;
         }
         
         stock sendToAdmin(const msg[], color=0xFF6347AA) {
                 #if defined foreach
                         foreach(new adminid : Player)
                 #else
                         for(new adminid; adminid < MAX_PLAYERS; adminid++)
                 #endif
                 {
                         if(IsPlayerAdmin(adminid)) {
                    Send(adminid, color, msg);
                         }
                 }
         }
         
         stock ammo::IsBetweenDistancePlayers(playerid, damagedid, Float:dist) {
                 new Float: pos[ 3 ];
                 GetPlayerPos( damagedid, pos[ 0 ], pos[ 1 ], pos[ 2 ] );
                 if( dist >= GetPlayerDistanceFromPoint(playerid, pos[ 0 ], pos[ 1 ], pos[ 2 ]) )
                         return true ;
   
                 return false ;
         }
         
         stock ammo::getWeaponSlot( weaponid ) {
                 switch( weaponid ) {
                         case 0, 1               : return 0;
                         case 2..9               : return 1;
                         case 10..15     : return 10;
                         case 16..18,39  : return 8;
                         case 22..24     : return 2;
                         case 25..27     : return 3;
                         case 28,29,32   : return 4;
                         case 30,31              : return 5;
                         case 33,34              : return 6;
                         case 35..38             : return 7;
                         case 40                 : return 12;
                         case 41..43             : return 9;
                         case 44..46             : return 11;
                 }
                 return 0;
         }
         
         
// Hooks
         #if defined _ALS_OnPlayerGiveDamage
                 #undef OnPlayerGiveDamage
         #else
                 #define _ALS_OnPlayerGiveDamage
         #endif
         #define OnPlayerGiveDamage ammo::OnPlayerGiveDamage
         forward ammo::OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid);
         
#endif


Когда нет знания, есть мнение.
Surex Дата: Суббота, 02.07.2016, 14:04 | Сообщение # 2
Боец
Сообщений: 137
Статус: Offline
полезно

Плисс Дата: Вторник, 19.07.2016, 20:37 | Сообщение # 3
Боец
Сообщений: 70
Статус: Offline
Кросс
  • Страница 1 из 1
  • 1
Поиск: