Czekaj, za chwile będzie sma zapomniałem dodać że 1/3 szansy

(1/3 = 33,3 %)
Dodano 23 czerwiec 2011 - 14:58:Post wyżej zreportowałem do usunięcia (ten mój jak coś), dlatego że nie mogę go edytować.
Tutaj jest sma, przekompiluj sobie
#include <amxmodx>
#include <fakemeta>
#include <ColorChat>
#define PLUGIN "Dawedov"
#define AUTHOR "He za kill"
#define VERSION "1.0"
new gSzPrefix[64];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "DeathEventHook", "ade")
register_cvar("amx_hegren_prefix","[TAG]")
register_cvar("amx_hegren_chance","3")
get_cvar_string("amx_hegren_prefix",gSzPrefix,63);
}
public DeathEventHook()
{
new attacker = read_data(1)
new victim = read_data(2)
if(get_user_team(attacker) == get_user_team(victim))
return;
if(random(get_cvar_num("amx_hegren_chance")) == 1)
{
fm_give_item(attacker,"weapon_hegrenade");
ColorChat(attacker,GREEN,"%s^x01 Dostales granat HE za zabicie wroga.",gSzPrefix)
}
}
stock fm_give_item(index, const item[])
{
if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
return 0;
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item))
if (!pev_valid(ent))
return 0;
new Float:origin[3];
pev(index, pev_origin, origin);
set_pev(ent, pev_origin, origin);
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
dllfunc(DLLFunc_Spawn, ent);
new save = pev(ent, pev_solid);
dllfunc(DLLFunc_Touch, ent, index);
if (pev(ent, pev_solid) != save)
return ent;
engfunc(EngFunc_RemoveEntity, ent);
return -1;
}
Dodano 23 czerwiec 2011 - 14:59:Ehh nie ogarniam tego forum
Użytkownik Dawedov edytował ten post 23.06.2011 14:45