Raised This Month: $ Target: $400
 0% 

how to make tigger entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
colossus
Member
Join Date: Sep 2013
Old 09-10-2013 , 16:50   Re: how to make tigger entity
Reply With Quote #3

One example

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <engine> #include <fakemeta> #define PLUGIN "Create Entity" #define VERSION "1.0" #define AUTHOR "colossus" new const gEntityModel[] = "models/w_medkit.mdl"; new const gEntName[] = "Ent"; // Classname public plugin_precache() {     register_plugin(PLUGIN, VERSION, AUTHOR); //....         // Start properties     register_clcmd("say /test", "CreateEntity"); //...     precache_model(gEntityModel); // precache model } public CreateEntity(id) {     new ent = create_entity("info_target");         if(!is_valid_ent(ent))         return PLUGIN_HANDLED;         static Float:origin [ 3 ], Float:angle [ 3 ], Float:fVelocity[3];     entity_set_string(ent, EV_SZ_classname, gEntName);         entity_set_model(ent, gEntityModel);         engfunc(EngFunc_GetAttachment, id , 2 , origin, angle );         VelocityByAim( id , 250 , fVelocity );         entity_set_size(ent , Float: {-8.0,-8.0,-8.0} , Float: { 0.0 , 0.0 , 0.0} );         entity_set_vector ( ent , EV_VEC_velocity, fVelocity );         entity_set_vector(ent, EV_VEC_rendercolor, Float:{ 255.0, 255.0, 255.0 });         entity_set_vector(ent, EV_VEC_origin, origin);         entity_set_int(ent, EV_INT_renderfx, kRenderFxGlowShell);         entity_set_int(ent,EV_INT_movetype, MOVETYPE_TOSS);         entity_set_int(ent, EV_INT_solid, 1);         client_print(id, print_chat, "You dropped entity");         return PLUGIN_HANDLED; } public pfn_touch(gEntityDrop, gEntityToco) {     if(!is_valid_ent(gEntityDrop) || !(get_entity_flags(gEntityDrop) & FL_ONGROUND))         return PLUGIN_HANDLED;             static szClassName[32];     entity_get_string(gEntityDrop, EV_SZ_classname, szClassName,charsmax(szClassName));             if(equal(szClassName, gEntName))     {         client_print(gEntityToco, print_chat, "You touch entity"); //....                 /* Remove entity??? uncomment this line*/         //remove_entity(gEntityDrop);     }     return PLUGIN_CONTINUE; }

Last edited by colossus; 09-10-2013 at 16:51.
colossus 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 18:47.


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