Raised This Month: $ Target: $400
 0% 

Codding help.Function ignored.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Menethil
Senior Member
Join Date: Aug 2011
Old 08-02-2011 , 15:43   Codding help.Function ignored.
Reply With Quote #1

Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>

#define PLUGIN "Anti Developer"
#define VERSION "1.0"
#define AUTHOR "NeuTroN & TCO"

#define TASK_CHECK 912651

new FramesPer[33], CurFps[33], Fps[33];

new cvar_Fps;
new Float:GameTime[33];


public plugin_init() 
{
    register_plugin("PLUGIN", "VERSION","AUTHOR");
    
    cvar_Fps = register_cvar("amx_developer_fps_max","120");
    
    register_forward(FM_PlayerPreThink,"fwdPlayerPreThink");
}

public fwdPlayerPreThink(id) 
{
    if(is_user_alive(id)) 
    {
        GameTime[id] = get_gametime();
            
        if(FramesPer[id] >= GameTime[id])
            Fps[id] += 1;
        else 
        {
            FramesPer[id]    +=1;
            CurFps[id]    = Fps[id];
            Fps[id]        = 0;
        }

        if(CurFps[id] > get_pcvar_num(cvar_Fps)) 
        {
            new name[32],steamid[32];
            get_user_name(id,name,31);

            client_print(0,print_chat,"[Developer] %s<%s> detected with FPS higher then allowd.Scaning started",name,steamid,CurFps[id]);
            set_task(5.0, "scan", TASK_CHECK, _, _, "a", 2)
            user_kill(id)
            client_print(0,print_chat,"[Developer] %s<%s> slayed for playing with  %i FPS",name,steamid,CurFps[id]);        
        }        
    }
}

public scan(id)
{
    id -= 912651    
    new name[32],steamid[32];
    get_user_name(id,name,31);
    get_user_authid(id,steamid,31);
    
    
    if(is_user_alive(id)) 
    {
        GameTime[id] = get_gametime();
            
        if(FramesPer[id] >= GameTime[id])
            Fps[id] += 1;
        else
        {
            FramesPer[id]    +=1;
            CurFps[id]    = Fps[id];
            Fps[id]        = 0;
        }

        if(CurFps[id] > get_pcvar_num(cvar_Fps)) 
        {
            client_print(0,print_chat,"%s - Scan Status: %d FPS", name, CurFps[id])
        }
                
        if(CurFps[id] < get_pcvar_num(cvar_Fps)) 
        {
            client_print(0,print_chat,"%s - Fps normal  status: lower then 101 ", name)
        }
    }
}       
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
This is not working quite good.
No compilling errors.
But i feel that task is not readed .. no client_prints printed on chat from the "scan" function.
And also i want if anyone is kind and sweet to implement a function that slay the player when fps > then the cvar not just slay after the task .. there is no point.

If there is no way to make this task run 3 times ... that means to scan the player for fps 3 times and slay after all 3 scans found fps > the the cvar
Make it just once...

If there is anyone can help me to clean this kz / hns cheaters PM. I have a private plugin with an similar function.. to complex for me.
Menethil is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 08-03-2011 , 00:59   Re: Codding help.Function ignored.
Reply With Quote #2

PHP Code:
set_task(5.0"scan"TASK_CHECK__"a"2


PHP Code:
set_task(5.0"scan"id TASK_CHECK__"a"2
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 08-03-2011 at 01:04.
hornet is offline
Menethil
Senior Member
Join Date: Aug 2011
Old 08-03-2011 , 02:52   Re: Codding help.Function ignored.
Reply With Quote #3

Ok now its look like this, and i got the error the function scan is undefinited.
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>

#define PLUGIN "Anti Developer"
#define VERSION "1.0"
#define AUTHOR "NeuTroN & TCO"

#define TASK_CHECK 912651

new FramesPer[33], CurFps[33], Fps[33];

new cvar_Fps;
new Float:GameTime[33];


public plugin_init() 
{
    register_plugin("PLUGIN", "VERSION","AUTHOR");
    
    cvar_Fps = register_cvar("amx_developer_fps_max","120");
    
    register_forward(FM_PlayerPreThink,"fwdPlayerPreThink");
}

public fwdPlayerPreThink(id) 
{
    if(is_user_alive(id)) 
    {
        GameTime[id] = get_gametime();
            
        if(FramesPer[id] >= GameTime[id])
            Fps[id] += 1;
        else 
        {
            FramesPer[id]    +=1;
            CurFps[id]    = Fps[id];
            Fps[id]        = 0;
        }

        if(CurFps[id] > get_pcvar_num(cvar_Fps)) 
        {
            new name[32],steamid[32];
            get_user_name(id,name,31);

            client_print(0,print_chat,"[Developer] %s<%s> detected with FPS higher then allowd.Scaning started",name,steamid,CurFps[id]);
            set_task(5.0, "scan", id + TASK_CHECK, _, _, "a", 2)  
    }
}

public scan(id)
{
    id -= 912651    
    new name[32];
    get_user_name(id,name,31);

    if(is_user_alive(id)) 
    {
    if(CurFps[id] > get_pcvar_num(cvar_Fps)) 
        {
    client_print(0,print_chat,"%s - Scan Status: %d FPS", name, CurFps[id])
        }
    }
    if(CurFps[id] > get_pcvar_num(cvar_Fps)) 
        {    
            user_kill(id)
        }
            client_print(0,print_chat,"[Developer] %s slayed for playing with  %i FPS",name,CurFps[id]);            
    }       
}
Menethil is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-03-2011 , 03:18   Re: Codding help.Function ignored.
Reply With Quote #4

You deleted a closing brace after the set_task() line.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Menethil
Senior Member
Join Date: Aug 2011
Old 08-03-2011 , 04:16   Re: Codding help.Function ignored.
Reply With Quote #5

Okey dokey. Now its working but there still be some problems
Its spamming the first client_print .. and after the task complete spamming the last client_print .. and no user_kill(id) user.
Menethil is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 08-03-2011 , 04:38   Re: Codding help.Function ignored.
Reply With Quote #6

Code:
 
public scan(id)
{
    id -= 912651    
    new name[32];
    get_user_name(id,name,31);

    if(is_user_alive(id)) 
    {
    if(CurFps[id] > get_pcvar_num(cvar_Fps)) 
        {
    client_print(0,print_chat,"%s - Scan Status: %d FPS", name, CurFps[id])
        }
    }
    if(CurFps[id] > get_pcvar_num(cvar_Fps)) 
        {    
            user_kill(id)
        }
            client_print(0,print_chat,"[Developer] %s slayed for playing with  %i FPS",name,CurFps[id]);            
    }       
}
why the braces are not matching ?

Quote:
Its spamming the first client_print .. and after the task complete spamming the last client_print
remove the client print if you don't want

Why do you need scan function if you are detecting in the prethink itself ?
Also why do you need engine and fakemeta both ?
gamer99 is offline
Menethil
Senior Member
Join Date: Aug 2011
Old 08-03-2011 , 05:25   Re: Codding help.Function ignored.
Reply With Quote #7

Ok i cleaned the code a bit. Now its working.. but not as i want.
Im wondering how to detect if developer 1 is enabled. And if dev 1 is detected to start my set_task with curFps and slay after that .
Any ideas ?

P.S: I have this code for detecting dev. But its incomplete i mean have just to set the "new" and some others..
If anyone can use this
Code:
public fwdPlayerPreThink_Pre(id)
{
    static Float:last_check[33], Float:game_time;
    static frames[33];
    if(is_user_connected(id))
    {
        if(get_pcvar_num(check_dev) == 1)
        {
            game_time = get_gametime();
            if(game_time - last_check[id] > 1.0)
            {
                if(checking_player[id] == 1)
                {
                    console_cmd(id, "fps_max 1000")
                    if(check_dev_wait[id] == 0)
                    {
                        // if the player has more than 'check_fpslimit cvar' fps he will be using developer; frames[id] will be 100 on 99.99 fps
                        checking_dev_frames[id] = frames[id]-1
                        if(frames[id] > get_pcvar_num(check_fpslimit))
                        {
                            client_cmd(id, "snapshot")
                            developer_illegal_detected[id]++
                        }
                        check_dev_wait[id] = 1
                    }
                }
                else
                    console_cmd(id, "developer 0;fps_max 101")
                
                frames[id] = 0
                last_check[id] = game_time;
            }
            frames[id]++;
        }
    }
}
instead mine and on the set task to detect the CurFps[id] and slay when its detected >

Last edited by Menethil; 08-03-2011 at 05:34.
Menethil is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 08-03-2011 , 05:35   Re: Codding help.Function ignored.
Reply With Quote #8

Its being detected on the basis that when you use developer 1 sometimes you get more than 100 FPS ... so if you are getting more than 100 FPS that menas you are using developer 1

Last edited by gamer99; 08-03-2011 at 05:41.
gamer99 is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 08-03-2011 , 05:39   Re: Codding help.Function ignored.
Reply With Quote #9

why don't you are not using the unaltered version of the plugin ?

Also calulating so much thing in prethink is not a good idea .
You just take one global variable like

g_dFpsCount[33]

and put

g_dFpsCount[id]++

in prethink and start one more task each second which will check how much value the variable g_dFpsCount holds after one secods and will compare it with the thresold ( also it will reset it to 0 )

In this was it will require less resource and will be a better developer detector .. Hope you the idea
gamer99 is offline
gamer99
Senior Member
Join Date: Jul 2011
Old 08-03-2011 , 05:40   Re: Codding help.Function ignored.
Reply With Quote #10

P.S.

Quote:
console_cmd(id, "developer 0;fps_max 101")
Quote:
console_cmd(id, "fps_max 1000")
These are actually slowhacking ... so better you read the rules first
gamer99 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 03:24.


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