AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Ball] (https://forums.alliedmods.net/showthread.php?t=136146)

dienvidvejs 08-23-2010 11:03

[Ball]
 
How can i make it pickable with e && pressing e again you kick it away
HELP!

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <xs>

#define PLUGIN "Ball"
#define VERSION "1.0"
#define AUTHOR "{PHILMAGROIN}"

new aimVector[3];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_touch"Ball""*""EntityOnTouch" );
    
register_concmd"amx_ball""Ball_Me"ADMIN_ADMIN );
    
register_touch("Ball""player""PlayerOnTouch");
}

public 
plugin_precache()
{
    
precache_model("models/newball.mdl");
}

public 
Ball_Me (id)
{
    new 
MyEntity create_entity"info_target" );
    new 
Float:fOrigin[3];
    {
        
entity_set_modelMyEntity"models/newball.mdl"); 
        
get_user_origin(idaimVector3);
        
IVecFVec(aimVectorfOrigin);
        {
            
set_pevMyEntitypev_classname"Ball" );
            
set_pevMyEntitypev_movetype MOVETYPE_BOUNCE );
            
set_pevMyEntitypev_solid    SOLID_BBOX  );
            
set_pevMyEntitypev_gravity  0.50 );
            
set_pevMyEntitypev_originfOrigin );
            
set_pevMyEntitypev_size50.050.050.0);
        }
    }

}

public 
EntityOnTouch ( const nEntity )
{
    static 
Float:Velocity[3];
    {
        
pevnEntitypev_velocityVelocity );
        
xs_vec_mul_scalarVelocity0.85Velocity );
        
set_pevnEntitypev_velocityVelocity );
    }
}

public 
PlayerOnTouch ( const Entityid )
{
    new 
Float:sVelocity[3];
    {
        
velocity_by_aimid480sVelocity );
        
entity_set_vectorEntityEV_VEC_velocitysVelocity );
    }



mottzi 08-23-2010 11:05

Re: [Ball]
 
use php tag pls. much easier to read ur code.

dienvidvejs 08-23-2010 11:06

Re: [Ball]
 
oky

lazarev 08-23-2010 12:45

Re: [Ball]
 
use xpaw's ball
http://forums.alliedmods.net/showpos...0&postcount=28


All times are GMT -4. The time now is 21:50.

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