View Single Post
Zenith77
Veteran Member
Join Date: Aug 2005
Old 03-07-2006 , 15:35  
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #include <engine> new target[33]; public plugin_init() {   register_plugin("Sample", "1.0", "Zenith77");   register_cvar("kz_distance","5");   register_event("DeathMsg", "eventDeath", "a"); } public client_connect(id) {   target[id] = -1 } public eventDeath() {   new victim = read_data(2);   new i;       for(i=1; i<get_maxplayers(); i++){        if(!is_user_connected(i)) continue;        if(victim == target[i]) target[i] = -1;   } } public client_PreThink(id) {     new i;   for(i=1; i<get_maxplayers();i++) {        if(!is_user_connected(i) || !is_user_alive(i)) continue;                        new distance;        new origin[3];        new otherOrigin[3];        get_user_origin(id, origin, 0);        if(target[id] < 0)          get_user_origin(i, otherOrigin, 0);        else          get_user_origin(target[id], otherOrigin, 0);        distance = get_distance(origin, otherOrigin);        if(distance <= get_cvar_num("kz_distance") && target[id] < 0 ) {           target[id] = i;           entity_set_int(id, EV_INT_solid, SOLID_TRIGGER);           client_print(id, print_chat, "[KZ] Player detected, semi-clip set!");           break;        }        if(distance > get_cvar_num("kz_distance") && target[id]){           target[id] = -1;           entity_set_int(id, EV_INT_solid, SOLID_BBOX);           client_print(id, print_chat, "[KZ] Semi-clip unset!");        }    } }

Try that
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline