Raised This Month: $ Target: $400
 0% 

Registering cl_cmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mankind
Member
Join Date: Jun 2009
Old 06-24-2011 , 13:07   Re: Registering cl_cmd
Reply With Quote #1

It's the same plugin im trying to turn on and off.

And the plugin im trying to do this is :

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

#pragma semicolon 1
#define VERSION "1.0"

new Floatthroworigin[3];
new 
Floatdroporigin[3];

public 
plugin_init()
{
    
register_plugin("Drop Distance"VERSION"Drekes");
    
    
register_touch("weaponbox""worldspawn""Fwd_Weapon_Touch");
    
    
register_clcmd("drop""cmd_drop");
}

public 
cmd_drop(id)
    
entity_get_vector(idEV_VEC_originthroworigin);
    
public 
Fwd_Weapon_Touch(weaponworld)
{
    
entity_get_vector(weaponEV_VEC_origindroporigin);
    
    
check_distance();
}

public 
check_distance()
{
    new 
Floatdistance get_distance_f(throworigindroporigin);
    
    
client_print(0print_chat"Drop distance: %.1f"distance);

So it would be something like this ?

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

#pragma semicolon 1
#define VERSION "1.0"

new Floatthroworigin[3];
new 
Floatdroporigin[3];

public 
plugin_init()
{
    
register_clcmd("say /toss""cmdSpray")

    
register_plugin("Drop Distance"VERSION"Drekes");
    
    
register_touch("weaponbox""worldspawn""Fwd_Weapon_Touch");
    
    
register_clcmd("drop""cmd_drop");
}
public 
cmdSpray(id)
{
          if( 
cs_get_user_team(id) == CS_TEAM_CT )
          {

public 
cmd_drop(id)
    
entity_get_vector(idEV_VEC_originthroworigin);
    
public 
Fwd_Weapon_Touch(weaponworld)
{
    
entity_get_vector(weaponEV_VEC_origindroporigin);
    
    
check_distance();
}

public 
check_distance()
{
    new 
Floatdistance get_distance_f(throworigindroporigin);
    
    
client_print(0print_chat"Drop distance: %.1f"distance);

Ehh, I tried but dont realy seem to do this.

Last edited by Mankind; 06-24-2011 at 18:59.
Mankind is offline
Reply



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 23:33.


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