PDA

View Full Version : No Scope Kill Notifier /w Logging


dodsynthetic
01-19-2008, 07:13 PM
Syn's No Scope Notifier v2.001

This plugin will display no scope kills and keeps track of them. I know I've seen servers with something similar but could never find the plugin so I just made my own. It works with the scoped Kar, Springfield, and Enfield. It should be possible to port this to other mods just by changing out the mod specific include, get_user_weapon, and alter/add weapon id numbers, etc..

===========================
v2.001 Changes
===========================
- Found and fixed a bug with displaying no scope to regular kill percentage. It was triggered with CVAR no_scope_notify_headshot instead of a seperate CVAR causing to only work when headshot notification was enabled.
- Added new CVAR no_scope_percent to enable or disable the extra no scope to regular kill percnetage information.

===========================
v1.9 Changes
===========================
- Some parts of the code were overhauled for speed. Engine is no longer used.
- Best shots/records now hold the top 3 players instead of 1.
- Added temporary best no scope shot per current map played with say command /noscoperound.
- Added CVAR no_scope_round to enable or disable temporary best shot record per map feature.
- Best shot records are now on a per map basis. You will need to create a folder named "no_scope" in your amxmodx configs directory.
- Fixed a couple issues of not checking if a player was still connected when performing some functions. Thanks again Diamond-Optic for sharing your log info.

===========================
v1.8 Changes
===========================
- Fixed no scope head shot totals for PsychoStats logging. Thanks Diamond-Optic for letting me know of the problem.

===========================
v1.7 Changes
===========================
- Added percentage of no scope shots to other kills in the output of say command /noscopes.
- Added optional HUD message of no scope headshot.
- Added optional shot distance in feet or meters along with body part hit.
- Added some speed improvements.
- Added optional shot blocking with message when trying to use the scope.
- Added say command /noscopehits that shows no scope kills by hit box.

===========================
v1.6 Changes
===========================
- Fixed on kill private chat message of total no scope kills. It was displaying with other
weapons and could flood the chat box. Thanks to Tank from BAM for spotting it.
- Fixed invalid player errors on player disconnect for keeping track of final score.
- Added no scope best shot distance record option.
- Added CVAR no_scope_record for enabling and disabling best no scope shot record feature.

===========================
v1.5 Changes
===========================
- Added checking for players that weren't connected under MG non deployed reload message fix.
Gave invalid player errors in log. Not necessary but I like to keep things clean.

===========================
v1.4 Changes
===========================
- Changed some natives to fakemeta equivalents. This includes the scope / non scope detection.
Should be 100% accurate now.
- Fixed MG non deployed reload small hud text message. Showed last no scope kill info along with
message about needing to deploy to reload. Since this message is apparently client side, I did
find a work around but it shifts the reload message to the left.
- Fixed crashing issue for detection of player team info. Thanks again johndoe on dodplugins.net
for providing the debug output.

===========================
v1.3 Changes
===========================
- Changed get_user_team function to dod specific dod_get_pl_teamname. Reading the amxmodx forums
I found posts that stated get_user_team is buggy. This dropped no scope kill weapon stats on
failure. Thanks johndoe on dodplugins.net for spotting the crash.

===========================
v1.2 Changes
===========================
- Added cvar to enable or disable TK no scope kill notification.

===========================
v1.1 Changes
===========================
- Added cvars to adjust how long a no scope kill HUD notification stays on screen.
- Added cvar to mirror no scope kill HUD notification types in chat.
- Added detailed weapon stats logging for no scope kills.
- Added FF support. FF kills now do not add to the /noscopes total.
- Changed /noscopes to properly display "1 kill" instead of "1 kills".
- Clarified and added to the notes.

===========================
Features:
===========================
- Choose between small and large HUD text display or chat only notification.
- No scope kill logging for use with Psychostats. Reports no scope kills by individual gun used.
- Optional no scope record keeping.
- Optional display of shot distance and body part hit.
- Reporting of total no scope kills per round along with percentage of no scope kills in regards to regular kills.
- Optional scoped shot blocking with message.
- Players are able to see their no scope kills by body part informaiton the entire map.
- Optional HUD notification of no scoped head shots.

===========================
Notes:
===========================
- Tested on an AMXMODX v1.8 Linux server and v1.76 Windows server as well.
- Detailed no scope kill weapon stats do not interfere with regular scope weapon stats. They still log as normal when no scope logging is on. IE a no scoped kill still counts as a regular stat kill for that type of gun.

===========================
Say Commands:
===========================
/noscopes - Displays how many no scope kills a player has accumulated along with percentage of no scope shots.

/noscopehits - Displays a player's total kills by hit box to a player

/noscoperecord - Displays the best no scope records and who the holders are for the current map.

/noscoperound - Displays the best no scope records and who the holders are for the current map
played. This is temporary data and is discarded on map change.

===========================
CVARS:
===========================
no_scope_notify | 0 = off | 1 = on
- Gives confirmation on screen of a no scope kill. Default on.

no_scope_notify_type | 0 = small | 1 = large | 2 = in chat
- Changes size and type of no scope kill notification. Default small.

no_scope_notify_small_time | 0 = 3.8 sec | 1 = 4.8 sec | 2 = 5.8 sec | 3 = 6.8 sec
- Changes duration of small HUD no scope kill notification. Due to the nature of this type of HUD
message, the minimum is 3.8 seconds and the options available should be sufficient. Default 3.8.

no_scope_notify_large_time | x or x.x
- Changes duration of large HUD no scope kill notification. You can enter an integer or real
number here. For example, a value of one would just be 1 second and a value of 1.5 would be
1 and a 1/2 seconds. Default 3.0.

no_scope_notify_tk_notify | 0 = off | 1 = on
- Enable or disable TK no scope notification. Default off.

no_scope_notify_mirror_chat | 0 = off | 1 = on
- Enables or disables mirroring of no scope kill notification in chat box. This is helpful if
you have allot of people no scoping and the regular notification changes too fast to read.
This automatically checks to see if no_scope_notify_type is set to chat so you don't get
double notifications. Default off.

no_scope_notify_chat | 0 = off | 1 = on
- Displays total no scope kills in chat privately to player on no scope kill. Default off.

no_scope_notify_say | 0 = off | 1 = on
- Enables or disables the say command /noscopes. Default on.

no_scope_logging | 0 = off | 1 = on
- Enables logging of no scope kills. Default off.

no_scope_notify_distance | 0 = off | 1 = on
- Enables or disables showing of shot in "game distance" in no scope kill notification. Defualt
on.

no_scope_notify_distance_type | 0 = meters | 1 = feet
- Sets whether shot in "game distance" is shown as meters or feet. Default meters.

no_scope_notify_hitbox | 0 = off | 1 = on
- Enables or disables showing of hitbox hit in no scope kill notification. Default on.

no_scope_notify_block_scope | 0 = off | 1 = on
- Enables or disables the blocking of scoped shots. Default off.

no_scope_notify_block_notify | 0 = off | 1 = on
- Enables or disables telling a user that you can't fire scoped when blocking of scoped shots is
enabled. Default on.

no_scope_record | 0 = off | 1 = on
- Enables or disables best no scope shot record feature. Default on.

no_scope_round | 0 = off | 1 = on
- Enables or disables the temporary map best shot record feature. Default on.

no_scope_notify_headshot | 0 = off | 1 = on
- Enables or disables displaying a no scope headshot notification on all player's HUD. Default on.

no_scope_hits_say | 0 = off | 1 = on
- Enables or disables the say command /noscopehits. Default on.

no_scope_percent | 0 = off | 1 = on
- Enables or disables additional no scope kill to regular kill percentage when using say command /noscopes.

===========================
Installation
===========================
- Compile the .sma file | An online compiler can be found here:
http:www.amxmodx.org/webcompiler.cgi
- Copy the compiled .amxx file into your addons\amxmodx\plugins folder.
- Add the name of the compiled .amxx to the bottom of your addons\amxmodx\configs\plugins.ini
- Create a new folder named no_scope in your addons\amxmodx\configs folder.
- Change the map or restart your server to start using the plugin!

===========================
Psychostats v1.9.1:
===========================
- This version automatically picks up no scope kills. Nothing is needed on your part.

===========================
Psychostats v3:
===========================
- To get no scope kills to show up in this version, login into an admin account. Now under
"configuration", click "weapons". You will need to add three new entries here by clicking the
"new" button. The first Unique ID will be NoScopeKar, second NoScopeSpring, lastly
NoScopeEnfield. The other options are up to you and how your PsychoStats are set up.

|OnEHiTwOnDeR|SoCal
01-20-2008, 02:28 AM
impressive...not tested...but i like the idea.

blobby
01-20-2008, 11:27 AM
Nice one m8 looks good im gonna put this on my server but what i think would be good also is for the people who use psycho stats if this could be logged there 2

blobby

Wilson [29th ID]
01-20-2008, 11:29 AM
Code looks good m8.

There's a native in DoDx to catch scoping though, might be easier.

dodsynthetic
01-20-2008, 03:12 PM
Nice one m8 looks good im gonna put this on my server but what i think would be good also is for the people who use psycho stats if this could be logged there 2

blobby

I will gladly add features but I'm not sure what you mean. Are you talking about logging to where psychostats is stored? I'm confused lol.

dodsynthetic
01-20-2008, 03:16 PM
;8894']Code looks good m8.

There's a native in DoDx to catch scoping though, might be easier.

lol If there is, it's labeled something I wouldn't think could give me the result needed. I looked in just about everything for getting weapon state with sniper rifles and the only way I could figure how to do it was by catching changes to a players field of view.

blobby
01-20-2008, 06:17 PM
Yeah like Diamond-Optic has done with his push plugin it logs who dies from pushes so if you could add the code to make No scopes log to Psycho stats as well that would be top

Blobby

dodsynthetic
01-20-2008, 07:44 PM
Yeah like Diamond-Optic has done with his push plugin it logs who dies from pushes so if you could add the code to make No scopes log to Psycho stats as well that would be top

Blobby

It already logs it's own separate kill type for Psychostats to pick up. :D Original kill log message is blocked and replaced with unique "killed with" weapon names when a no scoped kill is made. The unique ids can be found at the bottom of the documentation (see my original post up above). Instructions are also there for adding these to Psychostats v3.

{DwP} 325th ABN
01-20-2008, 08:24 PM
hell im in on this to, sounds like a good plug. anyone that has tried it have any comments on its workings

blobby
01-20-2008, 09:35 PM
Ok ive got this on my server and on my psycho stats works a treat one question you know the message that it shows when you get a noscope is one of the settings to make it a hud message ??

Blobby

dodsynthetic
01-20-2008, 11:38 PM
Ok ive got this on my server and on my psycho stats works a treat one question you know the message that it shows when you get a noscope is one of the settings to make it a hud message ??

Blobby

Yeah, just set > no_scope_notify_type 1

blobby
01-21-2008, 12:00 AM
Lol u know i really shouldn't ask all these questions i should know myself lol i can code hahaha TBH just to lazy to look ROFL

Nice work on this one m8 looks good and works a treat ill test it full 2moz because we are gonna have a noscope comption to see how it goes 4 u :P

Blobby

{DwP} 325th ABN
01-21-2008, 02:02 AM
ive got it running no errors the clan likes it already, kinda keeps everyone from always yelling oooo no scope cause they thought noone saw it. very nice i likes good job

dodsynthetic
01-21-2008, 04:28 AM
ive got it running no errors the clan likes it already, kinda keeps everyone from always yelling oooo no scope cause they thought noone saw it. very nice i likes good job

lol yeah this was one of my motivating factors to make it. Definitive proof haha. I may be adding an optional mode to block scoped shots too. It's annoying when we are playing no scopes only and someone comes on and scopes anyway even after telling them multiple times.

{DwP} 325th ABN
01-21-2008, 02:42 PM
i looked last night maybe to many coors lites but is there anyway to adjust how long the hud message stays up on screen

dodsynthetic
01-21-2008, 04:34 PM
Only for the large hud message type. It's done with set hud_message and you will want to adjust the number that currently says 3.0. This is how long it will stay on screen and is currently 3 seconds. Actually, now that I think about it, I could easily make it so the small hud texts stays on longer if you want. I will add cvars to adjust display times too.

{DwP} 325th ABN
01-21-2008, 05:32 PM
i like where it comes up just wanted it to stay alittle longer, a cvar for it would be perfect yes, again nicely done.

blobby
01-24-2008, 06:55 PM
Ive found a little bug if you no scope your team mates it still counts as a no scope in game you should add something to make it obey ff just a heads up

Blobby

dodsynthetic
01-24-2008, 08:51 PM
Ive found a little bug if you no scope your team mates it still counts as a no scope in game you should add something to make it obey ff just a heads up

Blobby

Ahh lol something I forgot to add. I'm used to no ff on my server so it slipped by me. I'm almost done with the next version that adds adjustable display time and the detailed weapon stats. I'll be sure to add that too.

blobby
01-24-2008, 08:51 PM
Coolies cant wait till you put your new version up :P

dodsynthetic
01-26-2008, 11:31 PM
Ok, the new version is up and ready to go. I would have been done allot sooner but had stuff to do irl and not to mention that the custom weapons slots for stats did not fit my needs. I had to generate the detailed weapon stats manually which took more time.

blobby
01-27-2008, 01:24 PM
Ok i have updated to the new version and all is good but did think of another thing you could fix when you kill a team mate with no scope it no longer logs now but it still displays the no scope message any way to stop this from happening on TKS ???

Regards

Blobby

dodsynthetic
01-27-2008, 06:42 PM
Ok i have updated to the new version and all is good but did think of another thing you could fix when you kill a team mate with no scope it no longer logs now but it still displays the no scope message any way to stop this from happening on TKS ???

Regards

Blobby

I gave it a new option to have it say killed their team mate or nothing at all on a TK. :D

jondoe
02-02-2008, 03:29 PM
I'm geting the following error in my amxx logs.
[AMXX] Run time error 10 (plugin "syns_no_scope_notifier.amxx") (native "get_user_team") -

I put it into debug mode and will post back what i find out.

Also did you ever think about adding say, Saying who killed who and at what range.
Noscopes are easy close up but from across the map it takes some real skill.

dodsynthetic
02-02-2008, 06:03 PM
I'm geting the following error in my amxx logs.
[AMXX] Run time error 10 (plugin "syns_no_scope_notifier.amxx") (native "get_user_team") -

I put it into debug mode and will post back what i find out.

Also did you ever think about adding say, Saying who killed who and at what range.
Noscopes are easy close up but from across the map it takes some real skill.

Thanks for the info. I'll look into that more. As for the range I have it working along with hitbox info on my server. I just haven't released it yet. ;)

jondoe
02-02-2008, 10:21 PM
Ok here is a little more about whats going on with it.


"syns_no_scope_notifier.amxx")
L 02/01/2008 - 23:11:03: [AMXX] Run time error 10: native error (native "get_user_team")
L 02/01/2008 - 23:11:03: [AMXX] [0] syns_no_scope_notifier.sma::client_disconnect (line 730)
L 02/01/2008 - 23:15:28: Start of error session.
L 02/01/2008 - 23:15:28: Info (map "dod_avalanche") (logfile "error_020108.log")
L 02/01/2008 - 23:15:28: [DODX] Invalid player 13
L 02/01/2008 - 23:15:28: [AMXX] Displaying debug trace (plugin "syns_no_scope_notifier.amxx")
L 02/01/2008 - 23:15:28: [AMXX] Run time error 10: native error (native "get_user_team")
L 02/01/2008 - 23:15:28: [AMXX] [0] syns_no_scope_notifier.sma::client_damage (line 196)

dodsynthetic
02-03-2008, 01:55 AM
Ok, I changed out the function for getting a users team. Apparently it has issues as reported on the amxmodx forums. I changed it to the dodfun version and should take care of the problem. Now back to finishing the voting system in the shrike bot menu plugin.

{DwP} 325th ABN
02-03-2008, 02:18 AM
damn synthetic your a busy bee, way to stay with it man you got good stuff out there and you work thru errors and updates nice job. good seeing you in the server last night rock on yes yes

dodsynthetic
02-03-2008, 05:05 AM
damn synthetic your a busy bee, way to stay with it man you got good stuff out there and you work thru errors and updates nice job. good seeing you in the server last night rock on yes yes

lol oh yeah. I'm all over it. When we were doing melee only on rennes I was going prone and kept rifle butting wild child over and over in the head. He wasn't pleased lol.

jondoe
02-04-2008, 12:34 PM
Ok now im getting this run time error. I put it in debug mode and will post after i wake up.


L 02/04/2008 - 04:51:03: [DODFUN] Invalid player 20
L 02/04/2008 - 04:51:03: [AMXX] Run time error 10 (plugin "syns_no_scope_notifier.amxx") (native "dod_get_pl_teamname") - debug not enabled!
L

dodsynthetic
02-04-2008, 12:37 PM
Ok now im getting this run time error. I put it in debug mode and will post after i wake up.


L 02/04/2008 - 04:51:03: [DODFUN] Invalid player 20
L 02/04/2008 - 04:51:03: [AMXX] Run time error 10 (plugin "syns_no_scope_notifier.amxx") (native "dod_get_pl_teamname") - debug not enabled!
L


Probably because I'm not checking to make sure the player is still in game. I'll add that in.

jondoe
02-14-2008, 06:19 PM
Have you added the fix for this synthectic ?.

Here is the debug trace and theres another error here.


XX] Displaying debug trace (plugin "syns_no_scope_notifier.amxx")
L 02/14/2008 - 12:15:32: [AMXX] Run time error 10: native error (native "dod_get_pl_teamname")
L 02/14/2008 - 12:15:32: [AMXX] [0] syns_no_scope_notifier.sma::client_damage (line 205)

L 02/14/2008 - 12:15:40: [AMXX] Displaying debug trace (plugin "syns_no_scope_notifier.amxx")
L 02/14/2008 - 12:15:40: [AMXX] Run time error 10: native error (native "dod_get_pl_teamname")
L 02/14/2008 - 12:15:40: [AMXX] [0] syns_no_scope_notifier.sma::client_disconnect (line 737)


I get these when using both 1.76c & 1.80. The plugin compiles fine for both.

dodsynthetic
02-17-2008, 09:15 AM
Sorry for the delay. I did some overhaul and some engine natives were changed to fakemeta since it seems to be the way to go. The crash on team detection should be fixed as I switched to a fakemeta method as well. I have also fixed a rare issue with the plugin that I encountered. It get's stuck thinking your scoped when your not. I could never get it to happen consistently so I have changed how it detects scope and non scope mode. Also added a non essential fix for the message to deploy when trying to reload an mg when not deployed.

CLICKBOOM
05-10-2008, 02:05 AM
Any ideas why i cant change commands. Trying to set some of the defaults to desired settings. Also what is n where does the .SMA file go.

CLICKBOOM
05-12-2008, 11:22 PM
bump bump bump

diamond-optic
05-12-2008, 11:52 PM
Any ideas why i cant change commands. Trying to set some of the defaults to desired settings.

what exactly are you trying to do/change?

Also what is n where does the .SMA file go.

the .sma file is the source code that you need to compile into a *.amxx file to run on your server

to compile plugins, you can read THIS (http://www.dodplugins.net/forums/showthread.php?t=50) to learn how to do them on your machine
or you can use the online compiler here by clicking 'help tabs' on the nav menu on the lefthand side of the forums and selecting the amxx version you need it for. OR you could use the online compiler at amxmodx.org (http://www.amxmodx.org)


*** on a side note, im removing all the *.amxx files from posts in the non-developers section due to safety factors brought about after the UAIO incident and also because its good for ppl to learn to compile plugins on their own :)

dodsynthetic
08-15-2008, 04:55 AM
Just updated to v1.6. A couple fixes added and a new best no scope shot record feature added.

diamond-optic
12-19-2008, 11:09 PM
think you could add another message for when the no scope is a headshot?

..and also maybe with the /noscopes command or such have it show what percentage of your kills are no scopes..

Ba5ic
12-20-2008, 05:46 AM
I'm running Version 1.6 and have just started receiving this in the error logs:-

L 12/20/2008 - 08:42:29: [FAKEMETA] Invalid entity
L 12/20/2008 - 08:42:29: [AMXX] Displaying debug trace (plugin "syns_weaponmod.amxx")
L 12/20/2008 - 08:42:29: [AMXX] Run time error 10: native error (native "pev")
L 12/20/2008 - 08:42:29: [AMXX] [0] 874.attach::func_weapon_touch (line 2430)

Any idea's

Thanks

dodsynthetic
12-20-2008, 09:55 AM
@ Diamond - No problem, I'll gladly add that XD I have kept the version that displays distance in feet or meters private but going to make it a public feature as well.

@ Basic - It's probably related to missing a check for a player that is alive. I'll fix this as well XD

dodsynthetic
12-20-2008, 10:00 AM
@ Basic - Oh, that's related to the weapons mod. I'll have a look at that. Same thing though, probably not checking for a valid entity or player. XD

Ba5ic
12-20-2008, 10:34 AM
@ Basic - Oh, that's related to the weapons mod. I'll have a look at that. Same thing though, probably not checking for a valid entity or player. XD

Thanks Syn

Keep up the great work as always :)

diamond-optic
12-20-2008, 11:00 PM
ahh yeah i saw the 'no_scope_notify_distance_type' in the code for using feet or meters when i was adding the distance to the no scope msgs.. but then i noticed its not registered in plugin_init.. i was wondering about that lol...

also.. why no cvar pointers? :P

dodsynthetic
12-21-2008, 04:41 AM
LOL well I was used to using the old get cvar method and never used the pointer method when it came out. Changing all of my plugins to this has been lurking in the back of my mind haha and guess it's time to do it. I'm always up for efficiency and speed enhancments. XD

diamond-optic
12-21-2008, 04:58 AM
oh come on! changing over to pcvars has got to be the simplest thing youve done in a while lol!

dodsynthetic
12-29-2008, 10:41 AM
New version up with some new goodies. No scope kill totals by body part, percentage of no scope to regular kill ratio, no scope kill shot distance in feet or meters along with body part hit info, HUD notification of no scope head shot, speed enhancement by using pcvar method, and scoped shot blocking.

Is3
12-30-2008, 08:36 AM
dodsynthetic make a record individual for every map :)

dodsynthetic
12-30-2008, 10:50 AM
Not a bad idea. I'll add that in. XD I was thinking about adding the best 3 shots instead of only 1 as well.

diamond-optic
12-30-2008, 12:58 PM
yeah i was about to ask for that myself lol..

i was also thinking maybe a record for the current played map (as in not best overall for that map but best for the current game on that map) ..tho i was also thinking that might be getting into too much excessive junk lol.. tho you wouldnt need to save that info in a file since it would be reset when the map changes..


also, think maybe you could convert this over to a non-deployed MG rambo notify plugin as well :P

Dr.G
12-30-2008, 01:27 PM
also, think maybe you could convert this over to a non-deployed MG rambo notify plugin as well :P

Great idea :D

diamond-optic
12-30-2008, 07:12 PM
ive noticed some inconsistencies with the data that appears in my psychostats with the logging enabled

like if you look here: http://stats.avamods.com/stats/weapon.php?id=52

you notice that there are people who definitly have no scope headshots, yet on the 'hitbox zone' section on the left column its saying 0 for head

not sure if someone might know the reason behind this.. as when ive done logging for custom weapons for psychostats ive never had this problem (and i mean back when i did the log msgs myself and didnt use the custom weapon natives in amxx)

and i would imagine that if it is able to tell that shots were headshots for individual no scope stats, it should definitly be able to get the same results for total headshots...

the same thing goes for the other 2 rifles too

http://stats.avamods.com/stats/weapon.php?id=53
http://stats.avamods.com/stats/weapon.php?id=54

diamond-optic
12-31-2008, 12:43 AM
ok it is the log messages.. take a look:

"weaponstats" (weapon "NoScopeKar") (shots "99") (hits "19") (kills "18") (headshots "2") (tks "0") (damage "2885") (deaths "5") (score "13")
"weaponstats2" (weapon "NoScopeKar") (head "0") (chest "1") (stomach "2") (leftarm "2") (rightarm "11") (leftleg "1") (rightleg "0")

weaponstats will show headshots..
but weaponstats2 has 0 for head

dodsynthetic
12-31-2008, 01:30 AM
At first, I thought this was an issue with PS as I know there were issues with head shot totals and percentage before with all guns in early version 3 because of incorrectly named variables but I noticed on about 3.0.7 and higher it appears to work with all guns now except no scoped shots so it may just be that I need to generate a standard kill log entry. The way it is now, it only generates end statistics. I'll check it out though.

dodsynthetic
12-31-2008, 01:31 AM
lol well that isn't right. That might have something to do with it. XD

dodsynthetic
12-31-2008, 01:43 AM
Ahh, I found it. I was misplacing variable order when creating the second part of the log messages. I'll have this fixed soon.

Edit: Never mind XD I wasn't looking at it right. On goes the search.

dodsynthetic
12-31-2008, 03:54 AM
OK I did find it. I wasn't combining kill and non kill no scope headshots for the total in the weaponstats2 part of the log XD

diamond-optic
12-31-2008, 09:15 PM
with v1.7


errors such as:

[DODX] Invalid player 4
[AMXX] Displaying debug trace (plugin "syns_no_scope_notifier.amxx")
[AMXX] Run time error 10: native error (native "dod_get_user_score")
[AMXX] [0] syns_no_scope_notifier.sma::client_damage (line 1226)



as well as:

[DODX] Invalid player 9
[AMXX] Displaying debug trace (plugin "syns_no_scope_notifier.amxx")
[AMXX] Run time error 10: native error (native "dod_get_user_weapon")
[AMXX] [0] syns_no_scope_notifier.sma::client_damage (line 1210)

Dr.G
02-15-2009, 01:13 PM
Syns... isnt it about time to fix this :D i have no clue whats going on in your 800 lines long client_damage func :D but my errors is the same as those d-o posted above ;)

diamond-optic
02-15-2009, 02:07 PM
i no longer get the errors..

changed line 1205 (i think) from:
if (players_zoomed[victim] == 0 && get_user_health(victim) <= 0)
to:
if (players_zoomed[victim] == 0 && get_user_health(victim) <= 0 && is_user_connected(victim))

and then like line 1226 it was:
user_final_score[attacker] = dod_get_user_score(attacker)
to this:
if(is_user_connected(attacker))
user_final_score[attacker] = dod_get_user_score(attacker)

and then in the beggining of the prethink function added this:
if(!is_user_connected(id))
return FMRES_IGNORED

dodsynthetic
02-15-2009, 04:04 PM
I'll have the new one up soon. I just haven't had the time to finish setting it up to do records per map. XD Probably later tonight.

dodsynthetic
03-04-2009, 11:57 PM
Updated with some fixes and requested features.

diamond-optic
03-11-2009, 03:00 AM
getting this.....

[AMXX] Displaying debug trace (plugin "syns_no_scope_notifier.amxx")
[AMXX] Run time error 4: index out of bounds
[AMXX] [0] syns_no_scope_notifier.sma::func_get_best (line 1658)

diamond-optic
03-11-2009, 07:41 PM
ok also this as well:

[DODX] Invalid player 8
[AMXX] Displaying debug trace (plugin "syns_no_scope_notifier.amxx")
[AMXX] Run time error 10: native error (native "dod_get_user_score")
[AMXX] [0] syns_no_scope_notifier.sma::client_damage (line 1348)


is that cause this:
if(is_user_connected(victim))
user_final_score[attacker] = dod_get_user_score(attacker)

should be checking if the attacker is connected and not the victim...

dodsynthetic
03-13-2009, 04:24 AM
lol fail. I'll get it fixed.

Tank
03-19-2009, 01:27 AM
PHP Code:

if(is_user_connected(victim))
user_final_score[attacker] = dod_get_user_score(attacker)



Is that the only thing I have to change? Im so out of coding atm due to school. People like the plugin but the plugin is forwarding the same message as what D-O posted.

dodsynthetic
03-19-2009, 03:19 AM
That and there is a part about loading the top shots as well. XD I have some free time tonight and will finish/post the updated version tonight.

Dr.G
03-19-2009, 03:21 PM
not long ago i read this: http://wiki.amxmodx.org/Optimizing_Plugins_(AMX_Mod_X_Scripting)

and some of the things ive noticed was:


BRANCHING - When the processor takes a different path of code. For example, to call a function or to use an if statement, the processor will "branch". Modern processors attempt to predict pathways with "branch prediction", but it's best to avoid branching a lot if possible.

Switch instead of If
If you can, you should use switch cases instead of if. This is because for an if statement, the compiler must branch to each consecutive if case. Using the example from above, observe the switch version:

so i updated the whole client_damage function in this, and reduced with 79 lines in all i think it was. BUT i havent had time to test it for any mistakes yet! but if you want this in your update, here it is...

dodsynthetic
03-22-2009, 10:56 PM
Yeah I did change some of those horrendous if statements over to switches for speed but I've added the ones you did too now. Only one thing had to be changed with the weapon kills since they have to be tallied outside of scoped shots. Anyway, here is the recent update with other fixes. I haven't had allot of time for testing so I'll put this as a temp beta before I make an official release.

Tank
03-22-2009, 10:58 PM
You the man Syn. I'll put it up right after I posted this. Go get your hiny on Steam and give it a go yourself, we miss you.

diamond-optic
03-24-2009, 02:24 PM
instead of having this:
switch(wpnindex)
{
case 6:{
player_regular_kills[attacker]++
}
case 9:{
player_regular_kills[attacker]++
}
case 35:{
player_regular_kills[attacker]++
}
}couldnt you do this instead of having the player_regular_kills.... in there 3 times doing the same thing
switch(wpnindex)
{
case 6,9,35: player_regular_kills[attacker]++
}

Tank
03-24-2009, 04:33 PM
Ok I am running this plugin and it works. Nothing to report so far, so my thanks and compliments on a job well done.

I do however have a question, I guess for D-O. I use your released pack of Psychostats images for DoD and looking at the credits:


DoD 1.3 Weapon Images
Version 1.2
12.30.08

by diamond-optic
http://www.AvaMods.com/


Change Log:

07.18.08 - Version 1.0
> Initial Release

12.25.08 - Version 1.1
> Added image for 'artillery_shell'

12.30.08 - Version 1.2
> Added images for 'No Scope' sniper rifles


I can't seem to get the No Scope images to work as they still show up as NoScopeKar etc. Any idea what I can do to fix this "issue"?

Thanks in advanced.

diamond-optic
03-24-2009, 05:17 PM
hmm but the rest of them show up correctly??

they work fine for me... but for me they come up all lowercase... like noscopeenfield where yours show as NoScopeEnfield ... you could try renaming the image files to have the capital letters (ive noticed some linux webservers are anal about case sensitivity)

if that fixes it i'll correct the file


*****

and btw just finally uploaded a new version of the image pack Ive had sitting here for months that has better images for the noscope rifles..

http://www.psychostats.com/community/browse/Themes/72

Tank
03-24-2009, 10:17 PM
hmm but the rest of them show up correctly??

they work fine for me... but for me they come up all lowercase... like noscopeenfield where yours show as NoScopeEnfield ... you could try renaming the image files to have the capital letters (ive noticed some linux webservers are anal about case sensitivity)

if that fixes it i'll correct the file

The rest shows up correctly and awesome :D So first off thanks for ever launching those files.

I renamed the files and they did show up correctly. Reason why I used capital characters is because of this:

===========================
Psychostats v3:
===========================
- To get no scope kills to show up in this version, login into an admin account. Now under
"configuration", click "weapons". You will need to add three new entries here by clicking the
"new" button. The first Unique ID will be NoScopeKar, second NoScopeSpring, lastly
NoScopeEnfield. The other options are up to you and how your PsychoStats are set up.

I learned my lesson on second guessing Synthetic, so if he tells or posts something should be done, I do it and since his installation section shows upper cased characters I did :D.

And thanks for putting out a new version. I actually like where all weapons show up as a picture and not half showing as text which kinda looked low budget to me.

Thanks again for helping.

Tank
03-24-2009, 10:30 PM
L 03/24/2009 - 00:04:56: [DODX] Invalid player 5
L 03/24/2009 - 00:04:56: [AMXX] Displaying debug trace (plugin "syns_no_scope_notifier.amxx")
L 03/24/2009 - 00:04:56: [AMXX] Run time error 10: native error (native "dod_get_user_score")
L 03/24/2009 - 00:04:56: [AMXX] [0] syns_no_scope_notifier.sma::client_damage (line 1347)


Sorry Syn, I guess I spoke to soon. Any idea? If you want me to test anything or whatever before posting up, just hit me up on Steam.

diamond-optic
03-25-2009, 07:21 PM
lol he forgot to fix that (i posted about it in post #63)
....simple fix for that error...

was:
if(is_user_connected(victim))
user_final_score[attacker] = dod_get_user_score(attacker)change to:
if(is_user_connected(attacker))
user_final_score[attacker] = dod_get_user_score(attacker)

Tank
03-25-2009, 08:25 PM
Thanks, adjusted and updated and I'll keep you guys posted what the outcome is.

dodsynthetic
03-26-2009, 05:48 AM
LOL That's just sad on my part... I even had a temp list of things I was changing and I had that problem checked off as fixed. WTF o.O I probably typed "victim" in there again not even thinking about it. =/ Anyway, if nothing else pops up, I make it official XD. Thanks for testing Tank it's muy apreciado.

dodsynthetic
04-05-2009, 04:53 AM
couldnt you do this instead of having the player_regular_kills.... in there 3 times doing the same thing
switch(wpnindex)
{
case 6,9,35: player_regular_kills[attacker]++
}

I learn something new every day. XD I've never seen a switch statement used like that before. I may as well change it. haha

Dr.G
04-05-2009, 07:18 AM
idk if this will do any diffrence in perspective, but all the:


new kar_stats_shots[33][1]
new kar_stats_hits[33][1]
new kar_stats_kills[33][1]
new kar_stats_headshots[33][1]
new kar_stats_tks[33][1]
new kar_stats_damage[33][1]
new kar_stats_deaths[33][1]
new kar_stats_head[33][1]
new kar_stats_chest[33][1]
new kar_stats_stomache[33][1]
new kar_stats_leftarm[33][1]
new kar_stats_rightarm[33][1]
new kar_stats_leftleg[33][1]
new kar_stats_rightleg[33][1]

etc. dont need to be declared as a 2D array, but it should save some memory if they were changed, i think...

also you can save alot of branches as well e.g:

// Keep track of total kills by hitbox
switch(hitplace)
{
case 0:{
total_stats_general[attacker]++
}
case 1:{
total_stats_head[attacker]++
}
case 2:{
total_stats_chest[attacker]++
}
case 3:{
total_stats_stomache[attacker]++
}
case 4:{
total_stats_leftarm[attacker]++
}
case 5:{
total_stats_rightarm[attacker]++
}
case 6:{
total_stats_leftleg[attacker]++
}
case 7:{
total_stats_rightleg[attacker]++
}

}

can be:

// Keep track of total kills by hitbox
switch(hitplace)
{
case 0:total_stats_general[attacker]++

case 1:total_stats_head[attacker]++

case 2:total_stats_chest[attacker]++

case 3:total_stats_stomache[attacker]++

case 4:total_stats_leftarm[attacker]++

case 5:total_stats_rightarm[attacker]++

case 6:total_stats_leftleg[attacker]++

case 7:total_stats_rightleg[attacker]++
}


i am close to saying its impossible to block weaponstats and weaponstats2 without any bugs. But the way you log that here it will double log damage, shots fired, hits etc. not kills tho

i blocked it with Ham_Weapon_PrimaryAttack and added unscoped rifles shoots with custom_weapon_shot. but it got damn buggy.

dodsynthetic
04-05-2009, 09:51 AM
Yeah, I did declare those arrays unnecessarily as 2D and just as I was about to put out another updated beta. XD For the switch/cases, as far as I know both methods should compile the exact same way, it's just a matter of syntax preference. As for the the stats, these are separate from original scoped shot stats and are used for no scope shots only. All original logging for scoped guns is untouched.

Anyway, here is yet another beta for testing. I just played around with it and it's now about 6am in the morning. Way past bedtime. XD

diamond-optic
04-07-2009, 09:51 PM
yeah i know its just a 'beta' but getting an error bout there being no 'func_types' function...

dodsynthetic
04-07-2009, 11:21 PM
lol That was a debugging function I had but removed. That's the second time I have left something in the plugin init now. Here we go.

dodsynthetic
04-17-2010, 05:14 PM
Small update for a bug I just happened to randomly notice while looking for some logging stuff today.

dodsynthetic
05-26-2010, 02:12 AM
I recently noticed I broke the scope shot blocking. This will be fixed in the next version.