Raised This Month: $ Target: $400
 0% 

block logging of "suicide"?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 10-04-2004 , 17:19   block logging of "suicide"?
Reply With Quote #1

hey people,

as blocking of logmessages is possible now, i'd like to use
that to block "suicides" after someone got killed by a gun with less
than 100 damage. (gets damage and then "user_kill")

bailopan posted a help:
Code:
new blockLog = 0 public log_event_thing() {     blockLog = 1 } public plugin_log() {    if (blockLog)    {       blockLog = 0       return PLUGIN_HANDLED    }    return PLUGIN_CONTINUE }

but i don't understand it

sorry for my ignorance, but is anyone here that can tell me how
to block a suiced log with it?

thanks for your help.
FeuerSturm is offline
BAILOPAN
Join Date: Jan 2004
Old 10-04-2004 , 17:36  
Reply With Quote #2

the plugin_log stuff is a quick "switch". it will only block the log output if the switch is set to 1, then the switch turns off.

So catch the damage event, then either block the kill message or set the log block switch to 1.

Blocking thekill message is probably a better idea (set_msg_block).
__________________
egg
BAILOPAN is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 10-04-2004 , 17:49  
Reply With Quote #3

okey, i'm trying to understand, but i'm a bit slow on this one
for some reason i don't know.

that's what i have so far (just a snippet of the main function):
Code:
public client_damage(attacker,victim,damage,wpnindex,hitplace,TA){    if(get_cvar_num("amx_ubergarand") == 1){         if((wpnindex == DODW_GARAND) && (is_user_alive(victim) == 1)){                 garandDeathMsg = get_user_msgid("DeathMsg")                 set_msg_block(garandDeathMsg,BLOCK_ONCE)                 user_kill(victim)                 if(TA == 0){                        new aKills = dod_get_user_kills(attacker)                        dod_set_user_kills(attacker,aKills+1)                 }                 message_begin( MSG_ALL, get_user_msgid("DeathMsg"),{0,0,0},0)         write_byte(attacker)         write_byte(victim)         write_byte(wpnindex)         message_end()                 }    } }

so it would be:
Code:
new blockSuicide = 0 . . . public client_damage(attacker,victim,damage,wpnindex,hitplace,TA){    if(get_cvar_num("amx_ubergarand") == 1){         if((wpnindex == DODW_GARAND) && (is_user_alive(victim) == 1)){                 garandDeathMsg = get_user_msgid("DeathMsg")                 set_msg_block(garandDeathMsg,BLOCK_ONCE)                 blockSuicide = 1                 user_kill(victim)                 if(TA == 0){                        new aKills = dod_get_user_kills(attacker)                        dod_set_user_kills(attacker,aKills+1)                 }                 message_begin( MSG_ALL, get_user_msgid("DeathMsg"),{0,0,0},0)         write_byte(attacker)         write_byte(victim)         write_byte(wpnindex)         message_end()                 }    } } . . . public plugin_log() {    if (blockSuicide)    {       blockSuicide = 0       return PLUGIN_HANDLED    }    return PLUGIN_CONTINUE }

or do i get that wrong?

by the way, thanks for your reply, bailopan
FeuerSturm is offline
BAILOPAN
Join Date: Jan 2004
Old 10-04-2004 , 17:50  
Reply With Quote #4

You can try that, if it doesn't work, post ;]
__________________
egg
BAILOPAN is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 10-04-2004 , 18:02  
Reply With Quote #5

Quote:
Originally Posted by BAILOPAN
You can try that, if it doesn't work, post ;]
not working
PlayerXY commited suicide with "world" still appears in the logs
whenever that specific user_kill is used.

here's the whole thing:

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> #include <dodfun> #include <dodx> new garandDeathMsg new blockSuicide = 0 public plugin_init() {    register_plugin("DoD UberGarand","0.95alpha","[RST] FireStorm")    register_statsfwd(XMF_DAMAGE)    register_cvar("amx_ubergarand","0")    set_cvar_num("amx_ubergarand",0)    register_concmd("amx_setubergarand","admin_setubergarand",ADMIN_BAN,"<enable/disable UberGarand Mode>") } public plugin_modules() {    require_module("engine")    require_module("fun")    require_module("dodx")    require_module("dodfun") } public client_damage(attacker,victim,damage,wpnindex,hitplace,TA){    if(get_cvar_num("amx_ubergarand") == 1){         if((wpnindex == DODW_GARAND) && (is_user_alive(victim) == 1)){                 garandDeathMsg = get_user_msgid("DeathMsg")                 set_msg_block(garandDeathMsg,BLOCK_ONCE)                 blockSuicide = 1                 user_kill(victim)                 if(TA == 0){                        new aKills = dod_get_user_kills(attacker)                        dod_set_user_kills(attacker,aKills+1)                 }                 message_begin( MSG_ALL, get_user_msgid("DeathMsg"),{0,0,0},0)         write_byte(attacker)         write_byte(victim)         write_byte(wpnindex)         message_end()                 }    } } public plugin_log() {    if (blockSuicide)    {       blockSuicide = 0       return PLUGIN_HANDLED    }    return PLUGIN_CONTINUE } public admin_setubergarand(id,level,cid){     if (!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED     new ugm_s[2]     read_argv(1,ugm_s,2)     new ugm = str_to_num(ugm_s)     if(ugm == 1) {                if (get_cvar_num("amx_ubergarand") == 1){                      client_print(id,print_chat,"[AMXX] UberGarand Mode is already running.....")                      }                else if (get_cvar_num("amx_ubergarand") == 0){                     set_cvar_num("amx_ubergarand",1)                     }                }     else if(ugm == 0) {                if (get_cvar_num("amx_ubergarand") == 0){                      client_print(id,print_chat,"[AMXX] UberGarand Mode is already disabled.....")                      }                else if (get_cvar_num("amx_ubergarand") == 1){                     set_cvar_num("amx_ubergarand",0)                         }     }     return PLUGIN_HANDLED }
FeuerSturm is offline
BAILOPAN
Join Date: Jan 2004
Old 10-04-2004 , 19:06  
Reply With Quote #6

You may need to block the death msg then... I dunno
__________________
egg
BAILOPAN is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 10-04-2004 , 19:11  
Reply With Quote #7

Quote:
Originally Posted by BAILOPAN
You may need to block the death msg then... I dunno
deathmessage is blocked and replaced with the proper one
but the plugin is useless if it logs the "kills" as "suicides" as every
stats program (HLStats, PsychoStats) will just catch it as suicides

so i'll throw the plugin into the freezer and warm it up again when there's
a ways to block the log

thanks for your help, bailopan.
FeuerSturm is offline
BAILOPAN
Join Date: Jan 2004
Old 10-04-2004 , 19:38  
Reply With Quote #8

you can block logs all right, the problem is timing.

You don't know when the log actually gets appended.
__________________
egg
BAILOPAN is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 10-04-2004 , 20:58  
Reply With Quote #9

Quote:
Originally Posted by BAILOPAN
you can block logs all right, the problem is timing.

You don't know when the log actually gets appended.
wouldn't it be possible to just make it block the next specified log event once?

like you can do with the deathmessages.

that would be awsome
FeuerSturm is offline
BAILOPAN
Join Date: Jan 2004
Old 10-04-2004 , 21:48  
Reply With Quote #10

yes but the problem is you don'tknow when that log will take place... if could take place like this:

1. Damage is dealt
2. Player is killed
3. Kill is logged
4. Damage message is sent
5. Death message is sent

See the problem?
__________________
egg
BAILOPAN is offline
Reply



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 17:19.


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