Raised This Month: $32 Target: $400
 8% 

Block Ghosting


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
anssik
Senior Member
Join Date: May 2006
Location: Suomi Finland Perkele
Old 07-05-2009 , 19:49   Block Ghosting
Reply With Quote #1

Block Ghosting v1.2

This plugin is made to effectively block ghosters in local area networks (ex. internet cafes).

The main concept is that when anyone from the same IP is still alive, you can only spectate the players from the same network and first person camera is also forced.
When all the players from the same IP are dead, then you can spectate anyone.

Admins with immunity flag will be ignored and can spectate normally even if playing from the same network.
This flag can be changed in the .sma in #define IMMUNITY_FLAG, which defaults to ADMIN_BAN.

This has not been fully tested, but should work. Optimization might have need to be done. Please report any bugs if found.

Changelog:
v1.2 - replaced engclient_cmd with client_cmd, also fixed if admin was on the same lan with a normal player and admin died the normal player could not spectate anyone
v1.1 - Added black screenfade when iterating through players
v1.0 - First release
Attached Files
File Type: sma Get Plugin or Get Source (block_ghosting.sma - 869 views - 2.7 KB)
__________________

Last edited by anssik; 07-22-2009 at 08:19.
anssik is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 07-05-2009 , 20:24   Re: Block Ghosting
Reply With Quote #2

To make this much more effective, I think you should include an option for checking just the first 3 octets of an IP.
__________________
Brad is offline
anssik
Senior Member
Join Date: May 2006
Location: Suomi Finland Perkele
Old 07-05-2009 , 20:44   Re: Block Ghosting
Reply With Quote #3

Well that has a downside that at least here in Finland it's enough if you live in the same city and have the same ISP, you might have the same three octects of an IP with someone living on the other side of the city.
__________________
anssik is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 07-05-2009 , 20:45   Re: Block Ghosting
Reply With Quote #4

I tried to make this plugin and I couldn't make it in a pleasant way. Amxmodx doesn't exposes the functions to handle spectate functionality. I tried with this (that you also have in your plugin):

PHP Code:
engclient_cmd(id"follownext 1"
But it sucks because it has a delay to iterate over the players. So basically, this plugin can't be made in a clean way.
__________________
joaquimandrade is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 07-05-2009 , 20:53   Re: Block Ghosting
Reply With Quote #5

Quote:
Originally Posted by anssik View Post
Well that has a downside that at least here in Finland it's enough if you live in the same city and have the same ISP, you might have the same three octects of an IP with someone living on the other side of the city.
That's why I said it should be an "option". In other words, a CVAR can be used to designate how many octets to check. In my LAN Notifier plugin, I basically had a CVAR that specified whether 3 or all 4 octets were to be checked. Here in the U.S., I've found it much more likely that people are in the same building rather than not, when the first 3 octets match.
__________________
Brad is offline
anssik
Senior Member
Join Date: May 2006
Location: Suomi Finland Perkele
Old 07-05-2009 , 20:59   Re: Block Ghosting
Reply With Quote #6

@joaquimandrade: Yes it's not totally clean, but maybe it would be better if I faded the screen to black when iterating thru players and seeing what you should not see?

EDIT: @Brad: I'll look into that later.
__________________

Last edited by anssik; 07-05-2009 at 21:07.
anssik is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 07-05-2009 , 21:07   Re: Block Ghosting
Reply With Quote #7

Maybe that would make it look nicer but for me isn't enough. I'm really waiting for anyone to make a new module for amxmodx that exposes every function for CS.

Anyway, that's up to you and to the users of the plugin. If they find it acceptable that way that's ok for them.

I was writing in here more like to share my experience in this matter with you.
__________________
joaquimandrade is offline
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 07-12-2009 , 03:55   Re: Block Ghosting
Reply With Quote #8

Could not find function "messageText"
[AMXX] Displaying debug trace (plugin "block_ghosting.amxx")
[AMXX] Run time error 19: function not found
[AMXX] [0] block_ghosting.sma::plugin_init (line 25)
__________________


Last edited by Jack86; 07-12-2009 at 04:21.
Jack86 is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 07-12-2009 , 10:03   Re: Block Ghosting
Reply With Quote #9

Quote:
Originally Posted by Jack86 View Post
Could not find function "messageText"
[AMXX] Displaying debug trace (plugin "block_ghosting.amxx")
[AMXX] Run time error 19: function not found
[AMXX] [0] block_ghosting.sma::plugin_init (line 25)
The code has an error.

Change

PHP Code:
register_message(get_user_msgid("TextMsg"), "messageText"
to

PHP Code:
register_message(get_user_msgid("TextMsg"), "MessageText"
__________________
joaquimandrade is offline
anssik
Senior Member
Join Date: May 2006
Location: Suomi Finland Perkele
Old 07-13-2009 , 13:23   Re: Block Ghosting
Reply With Quote #10

Fixed.
__________________
anssik 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 19:51.


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