AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hook Dat DeathMsg! (https://forums.alliedmods.net/showthread.php?t=60020)

thebobjones34 08-25-2007 08:59

Hook Dat DeathMsg!
 
Okay yeah, first time with events and i dont know what im doing wrong. Like when i kill who evers id is passed into PlayerCT it doesnt reg it.
Code:
public hook_DeathMsg() {     new Victim = read_data(2) //get the second message parameter     if(g_Dueling == 1) {         if(is_user_dueling(Victim)) {             duelEND(Victim)         }     }     return PLUGIN_CONTINUE }                 /* returns wether or not if the user is dueling */ public is_user_dueling(id) {     if(g_Dueling == 1) {         if(g_PlayerCT == id || g_PlayerT == id)             return 1     }     return 0 }

X-Script 08-25-2007 09:55

Re: Hook Dat DeathMsg!
 
Compile it, and what are your errors?

thebobjones34 08-25-2007 09:59

Re: Hook Dat DeathMsg!
 
Read the post properly next time...
Quote:

Originally Posted by thebobjones34
Like when i kill who evers id is passed into PlayerCT it doesnt reg it.

My plugin compiles no errors. Its a logic error somewhere in there.


Full Code Here -> http://ampaste.net/80927

hlstriker 08-25-2007 13:55

Re: Hook Dat DeathMsg!
 
Looks like you are hooking the DeathMsg wrong. I really didn't look much at the rest of your code so I don't know if there are any other mistakes.

Change...
register_event("DeathMsg","hook_DeathMsg","b" )

To...
register_event("DeathMsg", "hook_DeathMsg", "a", "1>0")

thebobjones34 08-25-2007 18:36

Re: Hook Dat DeathMsg!
 
Thanks Works now


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

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