Sma Pluginu
include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util>
#include <engine>
#include <hamsandwich>
#define PLUGIN "Ammo"
#define VERSION "1.0"
#define AUTHOR "Pan PrO"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("CurWeapon","CurWeapon","b");
}
public CurWeapon(id)
{
new ile_dodac_magazynek[33];
new stare_id_broni[33];
new stare_ammo[33];
new wid = read_data(2) // Id broni
if(wid == CSW_C4 || wid == CSW_FLASHBANG || wid == CSW_HEGRENADE || wid == CSW_KNIFE || wid == CSW_SMOKEGRENADE){
return PLUGIN_CONTINUE;
}
if(wid != stare_id_broni[id]){
ile_dodac_magazynek[id] = 50;
stare_id_broni[id] = wid;
return PLUGIN_CONTINUE;
}
new ammo = read_data(3) // liczba naboi w magazynku
if(ammo > stare_ammo[id]){
ile_dodac_magazynek[id] = 50;
stare_ammo[id] = ammo;
return PLUGIN_CONTINUE;
}
if(ile_dodac_magazynek[id] == 0){
return PLUGIN_CONTINUE;
}
new ent = fm_get_user_weapon_entity(id);
if(ent){
cs_set_weapon_ammo(ent, ammo+1);
ile_dodac_magazynek[id]--;
message_begin(MSG_ONE,get_user_msgid("AmmoPickup"),_,id);
write_byte(wid);
write_byte(ammo+1);
message_end();
}
return PLUGIN_CONTINUE;
}
z góry dziękuję za wszelką pomoc
Użytkownik Pan PrO edytował ten post 30.05.2012 20:11