AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blocking the DeathMsg if suicide and set as someone else (https://forums.alliedmods.net/showthread.php?t=27825)

Xanimos 04-30-2006 14:25

Blocking the DeathMsg if suicide and set as someone else
 
As title say I need to block the deathmsg if they suicide...either fall to death or blow them selves up. Being killed by the bomb shouldn't count though.

Batman/Gorlag 04-30-2006 15:21

For blocking the death message:

Code:
register_message(get_user_msgid("DeathMsg"), "death_check") public death_check(msg_id, msg_dest, msg_entity) {    if(get_msg_arg_int(1) == 0) //first argument is the killer, 0 if worldspawn    return PLUGIN_HANDLED    else       return PLUGIN_CONTINUE }

Try this, tell me if this works. Didn't test, came this up on the top of my head.

Batman/Gorlag 04-30-2006 20:31

Code:
register_message(get_user_msgid("DeathMsg"), "death_check") public death_check(msg_id, msg_dest, msg_entity) {     new killer = get_msg_arg_int(1)     new victim = get_msg_arg_int(2)     if(killer == 0 || killer == victim || killer > 32) //first argument is the killer, 0 if worldspawn         return PLUGIN_HANDLED     return PLUGIN_CONTINUE }


Alright I took some time to test it, and here's the code that works. This catches players falling, blowing themselves up, using kill to commit suicide and using team switching to commit suicide.

Xanimos 04-30-2006 22:17

Thanks. I'll have to consider if they use kill or change teams because that won't help me.


All times are GMT -4. The time now is 05:13.

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