View Single Post
BlueRaja
Senior Member
Join Date: Nov 2004
Old 01-10-2005 , 19:34  
Reply With Quote #10

This is what I've found out:
Code:
        //Call Director (move death-camera to aim at killer)         message_begin(MSG_SPEC, gmsgDirector)         write_byte(9)                  //???  This number is always 9         write_byte(2)                  //???  This number is always 2         write_short(id)      //Victim         write_short(attacker)            //Attacker         if (headshot) {             write_long(105)     //This long seems to only be 105, when the attacker gets a HS         } else {                            //39, when the attacker doesn't             write_long(39)          //5, when (????) - has nothing to do with DeathMsg :S         }                           //I've also seen a 6, a 139, and a 687 - I don't know what they do //maybe something about the player switching views, or Damage?  I'll have to look into it.         message_end()
That didn't work...so DS suggested I register the message:
Code:
public plugin_init(){     register_message(51,"director_event")     ... } ... public director_event(msg_id,msg_dest,msg_entity) {     new msgarg = get_msg_arg_int(5)     if ( msgarg==39 ||          msgarg==105)     {         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
However, now the plugin doesn't work at all (although it doesn't give any errors at runtime, and is said to be running successfully under amxx list). Before using the above code, I used "read_data(5)" instead of "get_msg_arg_int(5)", and, although that still didn't give me the camera effect I'm looking for, the rest of the plugin still worked (hooking Damage as it's supposed to).
It should be noted that I'm using register_event() to register Damage, if that makes a difference (I can't use register_message(), from my understanding, because I call several message_begin()'s).
Any ideas? :S
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja