Raised This Month: $ Target: $400
 0% 

Whats wrong with the plugin?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 02-22-2009 , 13:01   Whats wrong with the plugin?
#1

(worng section, sry.)

This plugin dont work for me and i dont know why, or how to fix it. Its for HLDS 1.6 with amxmodx. It should slay AFK players on my server when they havent moved in 20 seconds.

Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#define TIME 20.0
new Float:player_origin[3][33];
public plugin_init()
{
     RegisterHam(Ham_Spawn, "player", "e_Spawn", 1);
}
 
public e_Spawn(id)
{
     if(is_user_alive(id))
     {
           pev(id, pev_origin, player_origin[id]);
           set_task(TIME, "check_afk", id);
     }
     return HAM_IGNORED;
}
 
public check_afk(id)
{
     if(is_user_alive(id))
     if(same_origin(id))
     {
     user_kill(id);
     new name[33];
     get_user_name(id, name, 32);
     client_print(0, print_chat, "%s was killed for being an AFK.", name);
     }
}
 
public same_origin(id)
{
       new Float:origin[3];
       pev(id, pev_origin, origin);
       for(new i = 0; i < 3; i++)
             if(origin[i] != player_origin[i][id])
                   return 0;
       return 1;
}

Last edited by Ejziponken; 02-22-2009 at 13:13.
Ejziponken 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 17:03.


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