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-06-2012 , 09:55   Re: distance between 2 players
Reply With Quote #6

Firewall shouldn't have anything todo with it, I think.

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

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

/* Changelog:
    [v1.0]
        - Beta Version
        
    [v1.1]
        - Added 'Terrorist Slap' Delay
*/

new cStatuscRadiuscPowercDelay
new Float:playerDelay[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Register: Cvars
    
cStatus        register_cvar("radiusslap_status""1");
    
cRadius        register_cvar("radiusslap_radius""30.0");
    
cPower        register_cvar("radiusslap_power""15");
    
    
cDelay        register_cvar("radiusslap_delay""0.5");
}
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
        
        new 
Float:gTime get_gametime()
        for(new 
0plAmounti++) {
            if(
is_user_alive(plList[i]) 
            && 
get_user_team(plList[i]) == 1
            
&& !is_user_bot(plList[i])
            && 
playerDelay[plList[i]] < gTime) {
                
user_slap(plList[1], get_pcvar_num(cPower))
                
playerDelay[plList[i]] = gTime get_pcvar_float(cDelay)
            }
        }
    }

I added a delay, for Terrorist Slap.

I didn't rlly get what u needed, if u want. Just type in in 'Dutch' for me :p
__________________
Retired.

Last edited by Xalus; 05-06-2012 at 09:57.
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