Proszę o dodanie do źródła żeby tylko użytkownik z flaga np "t" dostał nieskończona amunicje.
Z góry dziękuje
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#define PLUGIN "Nieskonczona amunicja"
#define VERSION "1.0"
#define AUTHOR "lisek"
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4
new const g_MaxClipAmmo[] =
{
0,
13, //CSW_P228
0,
10, //CSW_SCOUT
0, //CSW_HEGRENADE
7, //CSW_XM1014
0, //CSW_C4
30,//CSW_MAC10
30, //CSW_AUG
0, //CSW_SMOKEGRENADE
15,//CSW_ELITE
20,//CSW_FIVESEVEN
25,//CSW_UMP45
30, //CSW_SG550
35, //CSW_GALIL
25, //CSW_FAMAS
12,//CSW_USP
20,//CSW_GLOCK18
10, //CSW_AWP
30,//CSW_MP5NAVY
100,//CSW_M249
8, //CSW_M3
30, //CSW_M4A1
30,//CSW_TMP
20, //CSW_G3SG1
0, //CSW_FLASHBANG
7, //CSW_DEAGLE
30, //CSW_SG552
30, //CSW_AK47
0, //CSW_KNIFE
50//CSW_P90
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event( "CurWeapon" , "fw_CurWeapon" , "b" , "1=1" );
// Add your code here...
}
public fw_CurWeapon( id )
{
static szWeapon[32], iWeapon, iWeaponEntity;
iWeapon = read_data( 2 );
get_weaponname( iWeapon , szWeapon , sizeof szWeapon - 1 );
iWeaponEntity = fm_find_ent_by_owner( -1 , szWeapon , id );
fm_set_weapon_ammo( iWeaponEntity , g_MaxClipAmmo[ iWeapon ] + 1 );
return PLUGIN_CONTINUE
}
public fm_find_ent_by_owner( entity , const classname[] , owner )
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}
return entity;
}
public fm_set_weapon_ammo(entity, amount)
{
set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}