Lecz mam pewien problem wysadza on wszytkich nawet tego co kladzie + nie daje w ogole expa i nie pokazuje ze kogos zabilo.
public PlaceFakeC4(id)
{
if (c4array[id][0] != 0)
{
return PLUGIN_HANDLED
}
else if(!(get_entity_flags(id) & FL_ONGROUND))
{
return PLUGIN_HANDLED
}
else
{
new location[3];
get_user_origin(id,location);
c4array[id][0] = location[0];
c4array[id][1] = location[1];
c4array[id][2] = location[2];
fakec4[id] = create_entity("env_sprite");
if (!fakec4[id]) return PLUGIN_HANDLED;
location[2] = location[2] - 30;
new Float:LocVec[3];
IVecFVec(location, LocVec);
entity_set_string(fakec4[id], EV_SZ_classname, "FakeC4");
entity_set_edict(fakec4[id], EV_ENT_owner, id);
entity_set_int(fakec4[id], EV_INT_solid, 1);
entity_set_int(fakec4[id], EV_INT_movetype, 0);
entity_set_model(fakec4[id], "models/w_backpack.mdl");
entity_set_origin(fakec4[id], LocVec);
DispatchSpawn(fakec4[id]);
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public DetonateFakeC4(id)
{
if (c4array[id][0] == 0)
{
return PLUGIN_HANDLED
}
else
{
new location[3]
new players[32]
new playercount
location[0] = c4array[id][0]
location[1] = c4array[id][1]
location[2] = c4array[id][2]
explode(location, sprite_blast, 30, 10, 0)
get_players(players,playercount,"a")
for (new i=0; i<playercount; i++)
{
new playerlocation[3]
new resultdistance
get_user_origin(players[i], playerlocation)
resultdistance = get_distance(playerlocation,location)
if(resultdistance < 200)
{
fakedamage(players[i],"FakeC4", 2000.0, DMG_BLAST)
}
}
RemoveFakeC4(id);
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public explode(startloc[3], spritename, scale, framerate, flags)
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(3);
write_coord(startloc[0]);
write_coord(startloc[1]);
write_coord(startloc[2]);
write_short(spritename);
write_byte(scale);
write_byte(framerate);
write_byte(flags);
message_end();
}
public RemoveFakeC4(id)
{
remove_entity(fakec4[id]);
c4array[id][0] = 0;
c4array[id][1] = 0;
c4array[id][2] = 0;
if(has_fakec4[id]) has_fakec4[id] = false;
return PLUGIN_CONTINUE;
}
Użytkownik MenTo(S) edytował ten post 08.12.2010 16:30