Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta>
- #include <hamsandwich>
- #define DEVELOPER_OFFSET 768
- #define MAXWARNS 3
- #define is_user_valid(%1) (1 <= %1 <= 32)
- new cvar_MaxFps;
- new iFrames[33]
- new iWarnings[33]
- new alive[33]
- public plugin_init()
- {
- register_plugin("Anti-developer", "1.0", "NeuTroN aka Menethil")
- register_forward(FM_PlayerPreThink, "Fwd_PlayerPreThink")
- cvar_MaxFps = register_cvar("amx_maxfps", "130")
- register_event( "DeathMsg", "eventDeath", "a" )
- RegisterHam(Ham_Spawn,"player","playerSpawn")
- }
- public Fwd_PlayerPreThink(id)
- {
- if(!alive[id])
- return FMRES_IGNORED
- iFrames[id]++
- return FMRES_IGNORED
- }
- public client_putinserver(id)
- {
- iFrames[id] = 0
- set_task(1.0, "ShowFps",id+DEVELOPER_OFFSET, _, _, "b");
- }
- public ShowFps(id)
- {
- id-=DEVELOPER_OFFSET
- if(is_user_alive(id) && iFrames[id] >= get_pcvar_num(cvar_MaxFps))
- {
- iWarnings[id]++
- if(iWarnings[id] >= MAXWARNS)
- {
- new name[32]
- get_user_name(id,name,31)
- user_kill(id)
- client_print(0, print_chat, " %s slayed for using more fps than allowed(100)",name)
- }
- }
- iFrames[id] = 0
- }
- public client_disconnect(id)
- {
- if(task_exists(id+DEVELOPER_OFFSET))
- {
- remove_task(id+DEVELOPER_OFFSET)
- }
- }
- public playerSpawn(id)
- {
- alive[id] = 1
- return PLUGIN_CONTINUE
- }
- public eventDeath()
- {
- new victim = read_data(2)
- if(is_user_valid(victim))
- {
- alive[victim] = 0
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement