AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Log weapon & log damage with amxx (https://forums.alliedmods.net/showthread.php?t=29200)

nightscreem 05-31-2006 17:47

Log weapon & log damage with amxx
 
how can i let amxx log a kill
because if you use fakedamage the player is killed with world & not with the weapon :?
I need it for the He grenade multiplier

thx in advance

Rolnaaba 05-31-2006 23:53

well you could allways just add an if func call that when someone kills some-one else to add a frag to their score... and that ussually will log that kill into their ranks.

Hawk552 06-01-2006 08:27

:arrow:

Code:
public createKill(id, attacker, weaponDescription[] ) {     new FFon = get_cvar_num("mp_friendlyfire")         if (FFon && get_user_team(id) == get_user_team(attacker))     {         set_user_frags(attacker, get_user_frags(attacker) - 1)         client_print(attacker,print_center,"You killed a teammate")         new money = cs_get_user_money(attacker)         if (money != 0)             cs_set_user_money(attacker,money - 150,1)     }     else if (get_user_team(id) != get_user_team(attacker))     {         set_user_frags(attacker, get_user_frags(attacker) + 1)         new money = cs_get_user_money(attacker)         if (money < 16000)             cs_set_user_money(attacker,money + 300,1)     }             logKill(attacker, id, weaponDescription)         //Kill the victim and block the messages     set_msg_block(g_iMsgDeathMsg,BLOCK_ONCE)     set_msg_block(g_iMsgScoreInfo,BLOCK_ONCE)     user_kill(id)         //user_kill removes a frag, this gives it back     set_user_frags(id,get_user_frags(id) + 1)         //Replaced HUD death message     message_begin(MSG_ALL,g_iMsgDeathMsg,{0,0,0},0)     write_byte(attacker)     write_byte(id)     write_byte(0)     write_string(weaponDescription)     message_end()         //Update killers scorboard with new info     message_begin(MSG_ALL,g_iMsgScoreInfo)     write_byte(attacker)     write_short(get_user_frags(attacker))     write_short(get_user_deaths(attacker))     write_short(0)     write_short(get_user_team(attacker))     message_end()         //Update victims scoreboard with correct info     message_begin(MSG_ALL,g_iMsgScoreInfo)     write_byte(id)     write_short(get_user_frags(id))     write_short(get_user_deaths(id))     write_short(0)     write_short(get_user_team(id))     message_end()     } // ------- LOG KILL------------ public logKill(id, victim, weaponDescription[] ) {     new namea[32],namev[32],authida[35],authidv[35],teama[16],teamv[16]         //Info On Attacker     get_user_name(id,namea,31)     get_user_team(id,teama,15)     get_user_authid(id,authida,34)         //Info On Victim     get_user_name(victim,namev,31)     get_user_team(victim,teamv,15)     get_user_authid(victim,authidv,34)         //Log This Kill     if(id != victim)     {         log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"",         namea,get_user_userid(id),authida,teama,namev,get_user_userid(victim),authidv,teamv, weaponDescription )     }     else     {         log_message("^"%s<%d><%s><%s>^" committed suicide with ^"%s^"",         namea,get_user_userid(id),authida,teama, weaponDescription )     } }

nightscreem 06-01-2006 11:12

Ok thx but not really what i mean, i asked for the wrong thing
it logs my weapon
but i use fakedamage to a grenade but the damage that is done
is not the damage that is registered in the stats and such
it 's the normal damage that's been used

jtp10181 06-01-2006 18:15

Hawk552: nice steal from superhero ;)


nightscreem: you want to block the hlds log message saying the player got killed by the world? There is a plugin called "vehiclekills" that does that, you might want to look at it.

nightscreem 06-02-2006 10:38

thx gonna try that:D


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

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