AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [solved]block weaponstats (https://forums.alliedmods.net/showthread.php?t=88677)

Dr.G 03-28-2009 00:44

[solved]block weaponstats
 
Is it possible to block shoots, damage etc. that is logged with standard weapons?

e.g.:
Code:

05:16:38 L 03/28/2009 - 05:16:38: "Dr.G<1><STEAM_0:0:0><Allies>" triggered "weaponstats" (weapon "spring") (shots "2") (hits "2") (kills "2") (headshots "0") (tks "0") (damage "280") (deaths "0") (score "4")
well the reason why iam asking is because a wanna log sniper rifles thats fire unscoped from when they are scoped, and if it should look right on psychostats with acc. etc. i need to block it and log it as a custom weapon...

- thanks in advance!

Dr.G 03-28-2009 20:56

Re: block weaponstats
 
i found a way to block it ill post how later

*edit* not totaly solved lol

Dr.G 03-28-2009 21:48

Re: block weaponstats
 
ok this is how i blocked it and logged a new one:

PHP Code:

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <dodx>
#include <hamsandwich>
#include <fakemeta>
 
#define PLUGIN "wpn stats blocking"
#define VERSION "1.0"
#define AUTHOR "Dr.G"
 
new wpn_id
new shoot_counter
 
new const WPN_CLASSNAME[] = "weapon_spring"
new const NEW_WPN_SHOOTNAME[] = "SOME_WEAPON_NAME"
 
 
public plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
RegisterHamHam_Weapon_PrimaryAttackWPN_CLASSNAME"func_PrimaryAttack" )
 
 
wpn_id custom_weapon_addNEW_WPN_SHOOTNAME60 NEW_WPN_SHOOTNAME )
}
 
 
public 
func_PrimaryAttack(iEnt)
{
 new 
id pev(iEntpev_owner)
 
 if(
is_user_alive(id) && is_user_connected(id) && get_user_team(id) && !is_user_bot(id))
 {
  
custom_weapon_shot(wpn_idid)
 
  
shoot_counter++
 
  
client_print(id,3,"custom_weapon_shot: %d times"shoot_counter)
 
  return 
HAM_SUPERCEDE
  
}
 
client_print(id,3,"func_PrimaryAttack")
 
 return 
HAM_IGNORED


BUT there is a problem. it calls the function when i hold down my IN_ATTACK key so with one normal hit is logs the custom weapon shot around 5 - 11 times lol.

Code:

03:19:09 og L 03/29/2009 - 03:19:09: "Dr.G<37><STEAM_0:0:0><Allies>" triggered "weaponstats" (weapon "SOME_WEAPON_NAM") (shots "2015") (hits "0") (kills "0") (headshots "0") (tks "0") (damage "0") (deaths "0") (score "0")
03:19:09 og L 03/29/2009 - 03:19:09: "Dr.G<37><STEAM_0:0:0><Allies>" triggered "weaponstats2" (weapon "SOME_WEAPON_NAM") (head "0") (chest "0") (stomach "0") (leftarm "0") (rightarm "0") (leftleg "0") (rightleg "0")
03:19:09 og L 03/29/2009 - 03:19:09: "Dr.G<37><STEAM_0:0:0><Allies>" triggered "time" (time "0:36")
03:19:09 og L 03/29/2009 - 03:19:09: "Dr.G<37><STEAM_0:0:0><Allies>" triggered "latency" (ping "0")


ConnorMcLeod 03-29-2009 06:23

Re: block weaponstats
 
Would be really better to disable it directly from stats_logging.sma ...

May be you thought those messages were generated by the game ?

Dr.G 03-29-2009 12:06

Re: block weaponstats
 
no its cuz i want scoped weapons to be logged as one weapon when they are scoped, and another when they are unscoped. so need to block it logging shoots fired under one condition and log a new one. So this is the way to do it i guess


All times are GMT -4. The time now is 08:50.

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