public plugin_precache() precache_model("models/model.mdl");
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("DeathMsg", "Death", "a");
register_forward(FM_Touch, "ForwardTouch");
}
public Death()
{
new Killer = read_data(1);
new Victim = read_data(2);
if(is_user_connected(Victim) && is_user_connected(Killer))
Drop();
}
public Drop()
{
new Victim = read_data(2);
static Float:Origin[3];
pev(Victim, pev_origin, Origin);
new Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
Origin[2] -= 36;
engfunc(EngFunc_SetOrigin, Ent, Origin);
if(!pev_valid(Ent))
return PLUGIN_HANDLED;
set_pev(Ent, pev_classname, "asdasd");
engfunc(EngFunc_SetModel, Ent, "models/model.mdl");
dllfunc(DLLFunc_Spawn, Ent);
set_pev(Ent, pev_solid, SOLID_BBOX);
set_pev(Ent, pev_movetype, MOVETYPE_NONE);
engfunc(EngFunc_SetSize, Ent, Float:{-23.160000, -13.660000, -0.050000}, Float:{11.470000, 12.780000, 6.720000});
engfunc(EngFunc_DropToFloor, Ent);
return PLUGIN_HANDLED;
}
public ForwardTouch(Ent, id)
{
if(pev_valid(Ent))
{
new ClassName[32], Victim;
Victim = read_data(2);
new CsTeams:userTeam = cs_get_user_team(id);
new CsTeams:victimTeam = cs_get_user_team(Victim);
pev(Ent, pev_classname, ClassName, charsmax(ClassName));
if(!equal(ClassName, "asdasd"))
return FMRES_IGNORED;
if(userTeam == victimTeam)
client_printcolor(id, "A csapatok megegyeztek");
engfunc(EngFunc_RemoveEntity, Ent);
}
return FMRES_IGNORED;
}
/*public logevent_round_start()
{
new EntName = FM_NULLENT;
while((EntName = fm_find_ent_by_class(EntName, "dogcedula")))
engfunc(EngFunc_RemoveEntity, EntName);
}*/
stock client_printcolor(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^4");
replace_all(msg, 190, "!y", "^1");
replace_all(msg, 190, "!t", "^3") ;
if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
return PLUGIN_HANDLED;
}