Raised This Month: $ Target: $400
 0% 

distance between 2 players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 05-05-2012 , 19:01   Re: distance between 2 players
Reply With Quote #2

Try it ;)

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>

#define PLUGIN "Slap Radius"
#define VERSION "1.0"
#define AUTHOR "Xalus"

new cStatuscRadiuscPower

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Register: Cvars
    
cStatus        register_cvar("radiusslap_status""1");
    
cRadius        register_cvar("radiusslap_radius""30");
    
cPower        register_cvar("radiusslap_power""15");
}
public 
client_PreThink(id) {
    if( 
is_user_alive(id) && get_user_team(id) == 
    
&& get_pcvar_num(cStatus) ) {
        static 
Float:plOrigin[3]
        
entity_get_vector(idEV_VEC_originplOrigin)
        
        new 
ent = -1plList[32], plAmount
        plAmount 
find_sphere_class(ent"player"get_pcvar_float(cRadius), plListcharsmax(plList), plOrigin)
        
        if( !
plAmount )
            return
        
        for(new 
0plAmounti++)
            if(
is_user_alive(plList[i]) 
            && 
get_user_team(plList[i]) == 1)
                
user_slap(plList[1], get_pcvar_num(cPower))
    }

__________________
Retired.

Last edited by Xalus; 05-06-2012 at 07:30.
Xalus 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 00:30.


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