Raised This Month: $ Target: $400
 0% 

Events, log events, entities.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
pizzahut
Senior Member
Join Date: Oct 2004
Old 05-14-2005 , 09:47  
Reply With Quote #4

Alright the part if it's an object is probably solved. I get victim IDs of 300+, so basically if victim id is higher than 32 it should be an object.

This script prints info if you press attack button while aiming at something. (You can also use a melee weapon from far away to get the info without damaging the target.)
Code:
#include <amxmodx> #include <engine> #include <tfcconst> public plugin_init() {   register_plugin("TFC Object", "0.1", "pizzahut") } public plugin_modules() {    require_module("engine")    require_module("tfcx") } public client_PreThink(id) {   new is_attack, was_attack   is_attack = entity_get_int(id, EV_INT_button) & IN_ATTACK   was_attack = entity_get_int(id, EV_INT_oldbuttons) & IN_ATTACK   if (is_attack && !was_attack)   {     new victim, bodypart     new Float:distance = get_user_aiming(id, victim, bodypart)     new clip, ammo     new weapon = get_user_weapon(id,clip,ammo)     client_print(id, print_chat, "id=%d | distance=%f victim=%d bodypart=%d | weapon=%d clip=%d ammo=%d^n", id, distance, victim, bodypart, weapon, clip, ammo)   }   return PLUGIN_CONTINUE }

So what is left, is to find out if the object belongs to the own team.
And ideally, find out if the attack destroys the object.
pizzahut is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode