Raised This Month: $ Target: $400
 0% 

[resolved] create_entity() How to make an entity at user's aim.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 01-06-2007 , 21:17   [resolved] create_entity() How to make an entity at user's aim.
Reply With Quote #1

I have looked at other plugins, looked at the entity tutorial by Hawk552, but I don't understand why the code below does not work. As far as I know, this should create a player.mdl at the origin where the client's sight intersects with another ent or world.

The only output I get is the client_print(). I don't see any models.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN "Model" #define VERSION "1.0" #define AUTHOR "stupok69" #define MODEL "models/player.mdl" #define CLASSNAME "info_target" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("create", "create_function", ADMIN_BAN) } public plugin_precache() {     precache_model(MODEL) } public create_function(id, level, cid) {     if(!cmd_access(id, level, cid, 1))         return PLUGIN_HANDLED         new origin[3]         get_user_origin(id, origin, 3)         client_print(id, print_chat, "Origin: %5i : %5i : %5i", origin[0], origin[1], origin[2])         new ent = create_entity(CLASSNAME)     entity_set_origin(ent, float:origin)     entity_set_model(ent, MODEL)             return PLUGIN_HANDLED }

Last edited by stupok; 01-06-2007 at 22:55.
stupok is offline
 


Thread Tools
Display Modes

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 22:24.


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