Raised This Month: $51 Target: $400
 12% 

[L4D & L4D2] Anti-Speedrunner System (v29.39, 07-16-2018)


Post New Thread Reply   
 
Thread Tools Display Modes
KasperH
Senior Member
Join Date: Apr 2016
Location: Hungary
Old 11-26-2017 , 05:12   Re: [L4D & L4D2] Anti-Speedrunner System (v10.5, 11-23-2017)
Reply With Quote #41

Added Hungarian.

Update: File removed, go for the updated file.
https://forums.alliedmods.net/showpo...1&postcount=43
__________________

"I've Got You In My Sights!"

Last edited by KasperH; 12-02-2017 at 05:24. Reason: updated the file, see post 43
KasperH is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 12-02-2017 , 01:25   Re: [L4D & L4D2] Anti-Speedrunner System (v11.0, 12-01-2017)
Reply With Quote #42

Version 11.0 is out!

Changes

1. Added the Delay system.
2. The anti-spam and anti-close procedure codes for saferoom doors can now operate without the Keyman system.
3. Fixed the Teleportation system not working properly.
4. Lowered the Punishment system's delay check from 3 seconds to 1 second again for efficient teleportation.
5. The Keyman system now only chooses a non-incapacitated player to be the Keyman.
6. Added a check for the Incapacitation system when l4d_ass_incap_required value is greater than the amount of survivors alive.
7. Updated translation file to support Hungarian and Spanish languages.
8. Updated translation file to support the Delay system's announcements.
9. All messages are now handled by the translation file.
10. Optimized the code.

Please redownload everything from the first post and delete your l4d_anti-speedrunner.cfg!
__________________

Last edited by Psyk0tik; 12-02-2017 at 15:02.
Psyk0tik is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 12-02-2017 , 05:37   Re: [L4D & L4D2] Anti-Speedrunner System (v11.0, 12-01-2017)
Reply With Quote #43

why you do this? ^_- looks pointless?

PHP Code:
int GetSurvivorCount()
{
    
int sCount 0;
    for(
int sClient 1sClient <= MaxClientssClient++)
    {
        if(!
IsSurvivor(sClient))
            continue;
        if(
IsSurvivor(sClient))
            
sCount++;
    }

    return 
sCount;

Better?

PHP Code:
int GetSurvivorCount()
{
    
int sCount 0;
    for(
int sClient 1sClient <= MaxClientssClient++)
    {
        if(
IsSurvivor(sClient))
            
sCount++;
    }

    return 
sCount;

Edit:
Also a good way what i do to detect if map is finale is checking for the trigger_finale entity, this entity is used for finale stage events ect, if checking for the entity fails you have the map checks below.
Cuts down on manual work for custom maps should auto detect and is a good way to start making your code more flexible/adaptive.

I added a check here
PHP Code:
if(FindEntityByClassname(MaxClients"trigger_finale") >= 0)
        return 
true
PHP Code:
bool IsFinale()
{
    if(
FindEntityByClassname(MaxClients"trigger_finale") >= 0)
        return 
true;
    
    
GetCurrentMap(MapNamesizeof(MapName));
    if(
StrEqual(MapName"c1m4_atrium"false) ||
    
StrEqual(MapName"c6m3_port"false) ||
    
StrEqual(MapName"c2m5_concert"false) ||
    
StrEqual(MapName"c3m4_plantation"false) ||
    
StrEqual(MapName"c4m5_milltown_escape"false) ||
    
StrEqual(MapName"c5m5_bridge"false) ||
    
StrEqual(MapName"c13m4_cutthroatcreek"false) ||
    
StrEqual(MapName"c8m5_rooftop"false) ||
    
StrEqual(MapName"c9m2_lots"false) ||
    
StrEqual(MapName"c11m5_runway"false) ||
    
StrEqual(MapName"c12m5_cornfield"false) ||
    
StrEqual(MapName"c7m3_port"false) ||
    
StrEqual(MapName"l4d_hospital05_rooftop"false) ||
    
StrEqual(MapName"l4d_garage02_lots"false) ||
    
StrEqual(MapName"l4d_airport05_runway"false) ||
    
StrEqual(MapName"l4d_farm05_cornfield"false) ||
    
StrEqual(MapName"l4d_river03_port"false))
    {
        return 
true;
    }

    return 
false;

Hope it helps
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D

Last edited by Lux; 12-02-2017 at 05:57.
Lux is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 12-02-2017 , 15:33   Re: [L4D & L4D2] Anti-Speedrunner System (v11.0, 12-01-2017)
Reply With Quote #44

Quote:
Originally Posted by KasperH View Post
Thx for the update!

Here is mine.
Update: Fix'd missing speech marks!
Quote:
Originally Posted by Lux View Post
why you do this? ^_- looks pointless?

PHP Code:
int GetSurvivorCount()
{
    
int sCount 0;
    for(
int sClient 1sClient <= MaxClientssClient++)
    {
        if(!
IsSurvivor(sClient))
            continue;
        if(
IsSurvivor(sClient))
            
sCount++;
    }

    return 
sCount;

Better?

PHP Code:
int GetSurvivorCount()
{
    
int sCount 0;
    for(
int sClient 1sClient <= MaxClientssClient++)
    {
        if(
IsSurvivor(sClient))
            
sCount++;
    }

    return 
sCount;

Edit:
Also a good way what i do to detect if map is finale is checking for the trigger_finale entity, this entity is used for finale stage events ect, if checking for the entity fails you have the map checks below.
Cuts down on manual work for custom maps should auto detect and is a good way to start making your code more flexible/adaptive.

I added a check here
PHP Code:
if(FindEntityByClassname(MaxClients"trigger_finale") >= 0)
        return 
true
PHP Code:
bool IsFinale()
{
    if(
FindEntityByClassname(MaxClients"trigger_finale") >= 0)
        return 
true;
    
    
GetCurrentMap(MapNamesizeof(MapName));
    if(
StrEqual(MapName"c1m4_atrium"false) ||
    
StrEqual(MapName"c6m3_port"false) ||
    
StrEqual(MapName"c2m5_concert"false) ||
    
StrEqual(MapName"c3m4_plantation"false) ||
    
StrEqual(MapName"c4m5_milltown_escape"false) ||
    
StrEqual(MapName"c5m5_bridge"false) ||
    
StrEqual(MapName"c13m4_cutthroatcreek"false) ||
    
StrEqual(MapName"c8m5_rooftop"false) ||
    
StrEqual(MapName"c9m2_lots"false) ||
    
StrEqual(MapName"c11m5_runway"false) ||
    
StrEqual(MapName"c12m5_cornfield"false) ||
    
StrEqual(MapName"c7m3_port"false) ||
    
StrEqual(MapName"l4d_hospital05_rooftop"false) ||
    
StrEqual(MapName"l4d_garage02_lots"false) ||
    
StrEqual(MapName"l4d_airport05_runway"false) ||
    
StrEqual(MapName"l4d_farm05_cornfield"false) ||
    
StrEqual(MapName"l4d_river03_port"false))
    {
        return 
true;
    }

    return 
false;

Hope it helps
Thanks guys!
__________________
Psyk0tik is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 12-02-2017 , 15:34   Re: [L4D & L4D2] Anti-Speedrunner System (v11.1, 12-02-2017)
Reply With Quote #45

Version 11.1 is out!

Changes

1. Applied Lux's suggestions here.
2. Updated translation file with KasperH's fixes here.

Please redownload everything from the first post!
__________________

Last edited by Psyk0tik; 12-02-2017 at 17:19.
Psyk0tik is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 12-02-2017 , 16:01   Re: [L4D & L4D2] Anti-Speedrunner System (v11.0, 12-01-2017)
Reply With Quote #46

Quote:
Originally Posted by Lux View Post
Edit:
Also a good way what i do to detect if map is finale is checking for the trigger_finale entity, this entity is used for finale stage events ect, if checking for the entity fails you have the map checks below.
Cuts down on manual work for custom maps should auto detect and is a good way to start making your code more flexible/adaptive.

I added a check here
PHP Code:
if(FindEntityByClassname(MaxClients"trigger_finale") >= 0)
        return 
true
PHP Code:
bool IsFinale()
{
    if(
FindEntityByClassname(MaxClients"trigger_finale") >= 0)
        return 
true;
    
    
GetCurrentMap(MapNamesizeof(MapName));
    if(
StrEqual(MapName"c1m4_atrium"false) ||
    
StrEqual(MapName"c6m3_port"false) ||
    
StrEqual(MapName"c2m5_concert"false) ||
    
StrEqual(MapName"c3m4_plantation"false) ||
    
StrEqual(MapName"c4m5_milltown_escape"false) ||
    
StrEqual(MapName"c5m5_bridge"false) ||
    
StrEqual(MapName"c13m4_cutthroatcreek"false) ||
    
StrEqual(MapName"c8m5_rooftop"false) ||
    
StrEqual(MapName"c9m2_lots"false) ||
    
StrEqual(MapName"c11m5_runway"false) ||
    
StrEqual(MapName"c12m5_cornfield"false) ||
    
StrEqual(MapName"c7m3_port"false) ||
    
StrEqual(MapName"l4d_hospital05_rooftop"false) ||
    
StrEqual(MapName"l4d_garage02_lots"false) ||
    
StrEqual(MapName"l4d_airport05_runway"false) ||
    
StrEqual(MapName"l4d_farm05_cornfield"false) ||
    
StrEqual(MapName"l4d_river03_port"false))
    {
        return 
true;
    }

    return 
false;

Hope it helps
I tried this and I got log errors about Client 32 not being in-game. This spammed the logs constantly every second and I eventually crashed.
Attached Files
File Type: log errors_20171202.log (902.0 KB, 110 views)
__________________
Psyk0tik is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 12-02-2017 , 16:57   Re: [L4D & L4D2] Anti-Speedrunner System (v11.0, 12-01-2017)
Reply With Quote #47

Quote:
Originally Posted by Crasher_3637 View Post
I tried this and I got log errors about Client 32 not being in-game. This spammed the logs constantly every second and I eventually crashed.
Yea sorry it's MaxClients+1

if(FindEntityByClassname(MaxClients+1, "trigger_finale") >= 0)
return true;
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 12-02-2017 , 17:20   Re: [L4D & L4D2] Anti-Speedrunner System (v11.0, 12-01-2017)
Reply With Quote #48

Quote:
Originally Posted by Lux View Post
Yea sorry it's MaxClients+1

if(FindEntityByClassname(MaxClients+1, "trigger_finale") >= 0)
return true;
Okay I updated the .sp file in the main post.

Edit: Now I get logs about Entity 33 being invalid so I removed it from the .sp file for now.
Attached Files
File Type: log errors_20171202.log (6.9 KB, 114 views)
__________________

Last edited by Psyk0tik; 12-02-2017 at 18:03.
Psyk0tik is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 12-02-2017 , 20:07   Re: [L4D & L4D2] Anti-Speedrunner System (v11.1, 12-02-2017)
Reply With Quote #49

I'v got no idea why that don't work for you

Try and use OnEntityCreate instead, sdkhooks best friend for me
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 12-03-2017 , 07:16   Re: [L4D & L4D2] Anti-Speedrunner System (v11.1, 12-02-2017)
Reply With Quote #50

Try this, if this fails i'm not sure why it errors :c

PHP Code:
    int entity FindEntityByClassname(MaxClients"trigger_finale");
    if(
entity != -&& IsValidEntity(entity))
        return 
true
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux 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:15.


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