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-03-2011 , 05:25   Re: Codding help.Function ignored.
Reply With Quote #1

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 #2

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 #3

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 #4

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