Raised This Month: $ Target: $400
 0% 

get user flags


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 01-20-2014 , 07:21   Re: get user flags
Reply With Quote #3

Quote:
Originally Posted by bare380 View Post
Dude, indentation
use this :
PHP Code:
#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) && !(get_user_flags(id) & ADMIN_RCON))
         {
                  
iWarnings[id]++
                  if(
iWarnings[id] >= MAXWARNS)
                  {
                           new 
name[32]
                           
get_user_name(id,name,31)
                           
user_kill(id)
                           
client_print(0print_chat" %s slayed for using developer",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
         
}

Thanks Very Much!
siriusmd99 is offline
 



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 10:08.


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