Advertisement
ColdWar-Pawn

Box Creation | JustSecond

Mar 23rd, 2013
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.24 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4. #include < engine >
  5.  
  6.  
  7. public plugin_init()
  8. {
  9.     register_plugin( "Entity Test", "v0.1", "+ColdWar" )
  10.     register_clcmd( "say /test", "ClCmd_Test" );
  11.    
  12.     register_touch( "box", "player", "Fwd_BoxTouch" );
  13. }
  14.  
  15. public Fwd_BoxTouch( box, client )
  16. {
  17.     // Do Stuff
  18.     remove_entity( box );
  19. }
  20.  
  21. public ClCmd_Test( client )
  22. {
  23.     new entity = create_entity( "info_target" );
  24.    
  25.     if( !is_valid_ent( entity ) )
  26.     {
  27.         log_amx( "Failed to create ENTITY." )
  28.         client_print( client, print_chat, "[AMXX] Failed to create Entity ^"info_target^"" );
  29.         return 1;
  30.     }
  31.    
  32.     new Float: g_flOrigin[ 3 ];
  33.     entity_get_vector( client, EV_VEC_origin, g_flOrigin );
  34.     g_flOrigin[ 0 ] += 20.0;
  35.     entity_set_origin( client, g_flOrigin );
  36.    
  37.    
  38.     entity_set_string( entity, EV_SZ_classname, "box" );
  39.     g_flOrigin[ 0 ] -= 20.0;
  40.    
  41.     entity_set_model( entity, "models/box.mdl" );
  42.     entity_set_size( entity, Float: { -2.-, -2.0, -2.0 }, Float: { 5.0, 5.0, 5.0 } );
  43.     entity_set_int( entity, EV_INT_solid, SOLID_TRIGGER );
  44.     entity_set_int( entity, EV_INT_movetype, MOVETYPE_TOSS );
  45.     entity_set_int( entity, EV_INT_iuser2, 2 );
  46.     entity_set_origin( entity, g_flOrigin );
  47.     entity_set_float( entity, EV_FL_takedamage, DAMAGE_NO );
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement