Raised This Month: $ Target: $400
 0% 

Creating Entity Help(Searched none work.)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ninja_Munkey
Junior Member
Join Date: Jun 2005
Old 06-08-2005 , 10:18   Creating Entity Help(Searched none work.)
Reply With Quote #1

Okay first of all here is the code I am using.
Code:
// ******************************************************************
// Credits **********************************************************
// <-Ninja_Munkey-> *************************************************
// All the people at http://www.AMXModX.org/forums ******************
// ******************************************************************
// Plugin Summon Creator ********************************************
// ******************************************************************

#include <amxmodx>
#include <amxmisc>
#include <string>
#include <fun>
#include <engine>

// **************************
// Begin Plugin INT
// **************************
public plugin_precache()
{
	if (file_exists("models/Summon/spider.mdl"))
	precache_model("models/Summon/spider.mdl")
	return PLUGIN_CONTINUE;
}

// **************************
// End Plugin INT
// **************************

// **************************
// Begin Plugin INT
// **************************
public plugin_init()
{
	register_plugin("Summon Creator", "0.1.0", "<-Ninja_Munkey->")
	register_clcmd("say /Summon", "SummonSpider(id)")
	return PLUGIN_CONTINUE;
}

// **************************
// End Plugin INT
// **************************

// **************************
// Begin SummonSpider
// **************************
public SummonSpider(id){

// **************************
// Create Basic Entity
// **************************
new entid
entid = create_entity("summoned_spider")

// **************************
// Set its classname
// **************************
entity_set_string(entid, EV_SZ_classname, "summon_spider")

// **************************
// Set its Model
// **************************
entity_set_model(entid, "models/summon/spider.mdl")

// **************************
// Set its origin
// **************************
new Float:origin[3]
entity_get_vector(id,EV_VEC_origin,origin);
entity_set_origin(entid, origin)

// **************************
// Set some basic properties
// **************************
entity_set_int(entid, EV_INT_solid, 1)
entity_set_int(entid, EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_edict(entid, EV_ENT_aiment, id)

// **************************
// Set to follow
// **************************
new entWeapon
entWeapon = create_entity("info_target")
entity_set_int(entWeapon, EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_int(entWeapon, EV_INT_solid, SOLID_NOT)
entity_set_edict(entWeapon, EV_ENT_aiment, entid)

// **************************
// Set creater health & armor
// **************************
	entity_set_int(entid, EV_FL_armortype, 50)
	entity_set_int(entid, EV_FL_health, 50)
}
// ************************** 
// End SummmonSpider
// **************************
I have the model set and everything, yet it still doesn't show up, what am I doing wrong?
Ninja_Munkey is offline
Silverice146
Member
Join Date: Mar 2005
Location: In a box
Old 06-08-2005 , 15:33  
Reply With Quote #2

hmm not sure but first of all

Code:
#include <string>

^wtf is that i know thats in C++ but not in small, its not even in the include folder



Code:
"SummonSpider(id)"

some pro correct me if im wrong, but u dont need the (id) in there
__________________
Silverice146 is offline
Send a message via AIM to Silverice146
n0obie4life
Veteran Member
Join Date: Dec 2004
Old 06-08-2005 , 23:43  
Reply With Quote #3

www.amxmodx.org/funcwiki.php

The core told me that there is such a thing called string.inc in the core >.<
__________________
Plugins:
none

n0obie4life is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-09-2005 , 03:40  
Reply With Quote #4

You don't need to include it.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
mobytoss
Senior Member
Join Date: Jun 2004
Location: On my TS server
Old 06-18-2005 , 16:55  
Reply With Quote #5

Perhaps your problem is you havent given it a think (I dunno, i've never really done one without a think). Look up register_think() and entity_set_float(entid, EV_FL_nextthink, ... etc.)

Have a look at Twilight's guide to making an NPC if you don't know what i'm on about. Search "How to: make the perfect NPC".
__________________
"As we know, There are known knowns. There are things we know we know. We also know There are known unknowns. That is to say We know there are some things We do not know. But there are also unknown unknowns, The ones we don't know We don't know."
mobytoss is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 06-18-2005 , 20:38  
Reply With Quote #6

This might give you an idea, it's sorta the same thing for creating the initial model, I wish I still had my code from my "clone" stuff...

http://forums.alliedmods.net/showthread.php?t=7553
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
LynX
Veteran Member
Join Date: Oct 2004
Old 06-19-2005 , 04:36  
Reply With Quote #7

Loooooooooolll o0
Why dont u guys see the problem, and I do? o0

Here, this is the summon code for teh little brat which I want to sqeeze with mine leg ( read : SPIDER ).

Code:
// ****************************************************************** // Credits ********************************************************** // <-Ninja_Munkey-> ************************************************* // All the people at <a href="http://www.AMXModX.org/forums" target="_blank" rel="nofollow noopener">http://www.AMXModX.org/forums</a> ****************** // ****************************************************************** // Plugin Summon Creator ******************************************** // ****************************************************************** #include <amxmodx> #include <amxmisc> #include <string> #include <fun> #include <engine> // ************************** // Begin Plugin INT // ************************** public plugin_precache() {    if (file_exists("models/Summon/spider.mdl"))    precache_model("models/Summon/spider.mdl")    return PLUGIN_CONTINUE; } // ************************** // End Plugin INT // ************************** // ************************** // Begin Plugin INT // ************************** public plugin_init() {    register_plugin("Summon Creator", "0.1.0", "<-Ninja_Munkey->")    register_clcmd("say /Summon", "SummonSpider(id)")    return PLUGIN_CONTINUE; } // ************************** // End Plugin INT // ************************** // ************************** // Begin SummonSpider // ************************** new SpiderEnt[32] public SummonSpider(id){ // ************************** // Create Basic Entity // ************************** SpiderEnt[id] = create_entity("info_target") // you can change info_target to env_model if it doesnt work // ************************** // Set its classname // ************************** entity_set_string(SpiderEnt[id], EV_SZ_classname, "summon_spider") // ************************** // Set its Model // ************************** entity_set_model(SpiderEnt[id], "models/summon/spider.mdl") // ************************** // Set its origin // ************************** new Float:origin[3] entity_get_vector(id,EV_VEC_origin,origin); entity_set_origin(SpiderEnt[id], origin) // ************************** // Set some basic properties // ************************** entity_set_int(SpiderEnt[id], EV_INT_solid, 1) entity_set_int(SpiderEnt[id], EV_INT_movetype, MOVETYPE_FOLLOW) entity_set_edict(SpiderEnt[id], EV_ENT_aiment, id) // ************************** // Set to follow // ************************** new entWeapon entWeapon = create_entity("info_target") entity_set_int(entWeapon, EV_INT_movetype, MOVETYPE_FOLLOW) entity_set_int(entWeapon, EV_INT_solid, SOLID_NOT) entity_set_edict(entWeapon, EV_ENT_aiment, SpiderEnt[id]) // ************************** // Set creater health & armor // **************************    entity_set_int(SpiderEnt[id], EV_FL_armortype, 50)    entity_set_int(SpiderEnt[id], EV_FL_health, 50)    return PLUGIN_HANDLED } // ************************** // End SummmonSpider // **************************

And, btw, if you use so called "avatar" system, which takes bones&animations of current player model ( avatar system works so it places a model over the current model, which acts like current model ), I think maybe ur bones are incorrect.
Well, test the code, and lemme know if it doesn't compiles/runs well ingame/etc.
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
mobytoss
Senior Member
Join Date: Jun 2004
Location: On my TS server
Old 06-19-2005 , 04:47  
Reply With Quote #8

Ahhhh I see now. He created a 'summoned_spider' entity, rather than an 'info_target'. *slaps forehead*
__________________
"As we know, There are known knowns. There are things we know we know. We also know There are known unknowns. That is to say We know there are some things We do not know. But there are also unknown unknowns, The ones we don't know We don't know."
mobytoss is offline
LynX
Veteran Member
Join Date: Oct 2004
Old 06-19-2005 , 05:11  
Reply With Quote #9

Quote:
Originally Posted by mobytoss
Ahhhh I see now. He created a 'summoned_spider' entity, rather than an 'info_target'. *slaps forehead*
Yeah...
And one more thing - now he can remove that entity due to array ^^
If it was done his way of creating ,he couldnt remove it since it went out of scope :p
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
mobytoss
Senior Member
Join Date: Jun 2004
Location: On my TS server
Old 06-19-2005 , 05:20  
Reply With Quote #10

Wait... Isn't yours going to go outta array?
You've got it at [32], but all the settings are added to [id] rather than [id-1] :O
__________________
"As we know, There are known knowns. There are things we know we know. We also know There are known unknowns. That is to say We know there are some things We do not know. But there are also unknown unknowns, The ones we don't know We don't know."
mobytoss is offline
Reply


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 16:49.


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