

bėja su find_ent_in_sphere galima surasti player ?
Code: Select all
new player_in_pole public funkcija(entity_id) { //Stulpo id new id = -1; new Float:origin[3]; entity_get_vector(entity_id, EV_VEC_origin, origin); while ((id = find_ent_in_sphere(id, origin, 80.0)) != 0) // 80.0 - spindulio aplink stulpą ilgis, kuriame skenuojama. { if (is_user_alive(id)) { if (player_in_pole) { return; } else { player_in_pole = id client_print(id, print_center, "Labas, as stulpas") return; } } } player_in_pole = 0;}
Code: Select all
#include <amxmodx>#include <amxmisc>#include <engine> new g_Classname[] = "Flag"new g_model[] = "models/mission/checkpoint.mdl" public plugin_init(){ register_plugin("MissionMod","0.1","DeMo") register_logevent("logevent_round_start", 2, "1=Round_Start")}public plugin_precache(){precache_model(g_model)}public logevent_round_start(){ new szMapName[ 33 ]; get_mapname( szMapName, 32 ); if( equal( szMapName, "de_dust2" ) ) { new ent0 = create_entity("info_target") new Float:fGlowColors[3] = {255.0, 255.0, 0.0} entity_set_origin( ent0, Float:{ 116.69, 2514.92, -98.47 } ); entity_set_string(ent0,EV_SZ_classname,g_Classname); entity_set_model(ent0,g_model); entity_set_int(ent0,EV_INT_solid, 2) entity_set_byte(ent0,EV_BYTE_controller1,125); entity_set_byte(ent0,EV_BYTE_controller2,125); entity_set_byte(ent0,EV_BYTE_controller3,125); entity_set_byte(ent0,EV_BYTE_controller4,125); entity_set_int(ent0, EV_INT_renderfx, kRenderFxGlowShell) entity_set_vector(ent0, EV_VEC_rendercolor, fGlowColors) entity_set_size(ent0, Float:{-2.5, -2.5, -2.5}, Float:{2.5, 2.5, 2.5}) entity_set_float(ent0,EV_FL_animtime,2.0) entity_set_float(ent0,EV_FL_framerate,1.0) entity_set_int(ent0,EV_INT_sequence,0); entity_set_float(ent0, EV_FL_maxspeed, 0.0) drop_to_floor(ent0) } set_task(0.5, "funkcija", 0, "", 0, "a")}new player_in_polepublic funkcija(Flag) { //Stulpo id new id = -1; new Float:origin[3]; entity_get_vector(Flag, EV_VEC_origin, origin); while ((id = find_ent_in_sphere(id, origin, 80.0)) != 0) // 80.0 - spindulio aplink stulpą ilgis, kuriame skenuojama. { if (is_user_alive(id)) { if (player_in_pole) { return; } else { player_in_pole = id client_print(id, print_center, "Labas, as stulpas") return; } } }player_in_pole = 0;}
Users browsing this forum: No registered users and 2 guests