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

set_task Help Please


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-21-2020 , 23:14   Re: set_task Help Please
Reply With Quote #11

Wouldn't this be enough? Is it possible for someone to switch their opengl32.dll during run-time?
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Anti-Cheat"
#define VERSION "1.5"
#define AUTHOR "Danger"

#define FILE "../opengl32.dll"

public plugin_precache() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
force_unmodifiedforce_exactfile , {0,0,0} , {0,0,0} , FILE );
}

public 
inconsistent_fileid , const szFilename[], szReason64 ] )

    if ( !
equalszFilename FILE ) )
    {
        
server_cmd"kick #%d ^"CsLope Anti-Cheat Bulunamadi...^"" get_user_useridid ) );
    }
    
    return 
PLUGIN_HANDLED;

__________________
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-21-2020 , 23:51   Re: set_task Help Please
Reply With Quote #12

I've changed files at run-time (not even a DLL) and it crashed my game when loading a new map. Generally, DLLs are loaded when you start the application (especially if they are actually required by the application the entire time; which OpenGL is). So, you can probably change it but it won't take effect until the application is restarted.

If Half-Life games reload DLLs, it certainly wouldn't be while playing, it'd have to be on a map change.
__________________

Last edited by fysiks; 03-21-2020 at 23:55.
fysiks is offline
SANTO37
Member
Join Date: Aug 2008
Old 03-22-2020 , 09:10   Re: set_task Help Please
Reply With Quote #13

how can we solve the problem
SANTO37 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-22-2020 , 11:16   Re: set_task Help Please
Reply With Quote #14

The problem is solved, look at my post above.

Edit: I just realized my code is basically the same that's in your original post.

Explain why this code needs to run every 10 seconds. A player should not be able to modify his game files while the game is running.
__________________

Last edited by Bugsy; 03-22-2020 at 11:18.
Bugsy is offline
SANTO37
Member
Join Date: Aug 2008
Old 03-22-2020 , 13:15   Re: set_task Help Please
Reply With Quote #15

I do not want to use CFG during the game. I will use this plugin on my match server. Players will not be able to cheat CFG.
SANTO37 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-22-2020 , 13:19   Re: set_task Help Please
Reply With Quote #16

What does this mean "I do not want to use CFG during the game. "?

Run this plugin and when a player connects it will kick them if inconsistent_file() finds an issue. No need to re-check since a player cannot modify files while the game is running.
__________________
Bugsy is offline
SANTO37
Member
Join Date: Aug 2008
Old 03-23-2020 , 09:09   Re: set_task Help Please
Reply With Quote #17

I need to run this code every 10 seconds. I just want help with this. I added set_task but it doesn't work



PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Anti-Cheat"
#define VERSION "1.5"
#define AUTHOR "Danger"

#define FILE "../opengl32.dll"

new CheckClient[33][26]

public 
plugin_precache() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
force_unmodified(force_exactfile, {0,0,0},{0,0,0},FILE)
}


public 
client_connect(id)
{
set_task(0.4,"checkClientFile"id)
}



public 
checkClientFile(id)
{
    if(
CheckClient[id][0] > 0)
    {
        
server_cmd("kick #%d ^"CsLope Anti-Cheat Bulunamad&#305;...^"", get_user_userid(id))
    
}

    
setc(CheckClient[id], 25 ,0)
    
set_task(10.0,"checkClientFile"id)
}

public 
inconsistent_file(id, const filename[], reason[64])

    if(
equal(filename,FILE))
    {
        
copy(CheckClient[id], 25,FILE
    }

    return 
PLUGIN_HANDLED;

SANTO37 is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 03-23-2020 , 13:29   Re: set_task Help Please
Reply With Quote #18

why would you run it every 10 seconds? its useless since this checks clients on connect, i guess
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
SANTO37
Member
Join Date: Aug 2008
Old 03-23-2020 , 14:24   Re: set_task Help Please
Reply With Quote #19

It works. But I couldn't do it every 10 seconds. Do you know anything about this?
SANTO37 is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 03-23-2020 , 14:29   Re: set_task Help Please
Reply With Quote #20

you dont have to run it every 10 seconds because it already check every player on connect
__________________
a simple act of caring creates an endless ripple.
Nutu_ 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 11:03.


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