žaidėjo id
Posted: 2011 May 03 07:22
Kai sužinoti žaidėjo ID kuris paleido raketą? ir kaip sužinoti ar tas žaidėjas į kurį pataikė raketa jau negyvas?
Code: Select all
public rocket_touch(id, world){ new Float:location[3] new players[32] new playercount entity_get_vector(id,EV_VEC_origin,location) emit_sound(id, CHAN_WEAPON, _RpgSounds[2], 0.0, 0.0, SND_STOP, PITCH_NORM) explode(location, SpriteExplosion, 30, 10, 0) get_players(players,playercount,"a") for (new i=0; i<playercount; i++) { new Float:playerlocation[3] new Float:resultdistance pev(players[i], pev_origin, playerlocation) resultdistance = get_distance_f(playerlocation,location) if(resultdistance < 450.0) { fakedamage(players[i],"RPG",(1000.0 - (2.0*resultdistance)),DMG_BLAST) } } emit_sound(id, CHAN_AUTO, _RpgSounds[1], 1.0, ATTN_NORM, 0, PITCH_NORM) remove_entity(id) return PLUGIN_CONTINUE }