Raised This Month: $ Target: $400
 0% 

fix plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 05-18-2015 , 02:00   Re: fix plugin
Reply With Quote #2

Because the attacker can be the world

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

public plugin_init() {
    
register_plugin("cfg""1.0""x");

    
RegisterHam(Ham_Killed"player""killed_player");
}
 
public 
killed_player(victimattacker) {
    if (!
is_user_connected(attacker))
        return 
HAM_IGNORED;

    static 
Float:vorigin[3], Float:aorigin[3];
 
    
pev(victimpev_originvorigin);
    
pev(attackerpev_originaorigin);
 
    if(
fm_get_distance(voriginaorigin) > 2)
    {
        new 
name[32];
        
get_user_name(attackername31);
        
server_cmd("kick #%d ^"You killed from more than 2 meters distance.^""get_user_userid(attacker));
        
client_print(0print_chat"%s have knife cfg."name);
    }

    return 
HAM_IGNORED;
}
 
 
Float:fm_get_distance(Float:origin1[3], Float:origin2[3]) {
    new 
Float:rdistance get_distance_f(origin1origin2);
    return(
rdistance*0.0254);

__________________
simanovich 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 20:01.


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