Raised This Month: $ Target: $400
 0% 

Creating entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 12-28-2009 , 21:19   Creating entity
Reply With Quote #1

I'm trying to create an entity.. I copy this from No Team Buy:
PHP Code:
new ENT_CLASS create_entity("info_map_parameter")

plugin_precache() {
        
ENT_CLASS create_entity("info_map_parameter")
        
DispatchKeyValue("info_map_parameter""buying""3")
        
DispatchSpawn(ENT_CLASS)


But didn't works.. I'm trying that the players can't buy anything .. The problem is this because if i put this:
PHP Code:
        remove_entity("armoury_entity")
        
        
ENT_CLASS create_entity("info_map_parameter")
        
DispatchKeyValue("info_map_parameter""buying""3")
        
DispatchSpawn(ENT_CLASS
The weapons in the floor (like fy_iceworld) dissapear. But if i put this:
PHP Code:
        ENT_CLASS create_entity("info_map_parameter")
         
DispatchKeyValue("info_map_parameter""buying""3")
         
DispatchSpawn(ENT_CLASS)

        
remove_entity("armoury_entity"
The weapons didn't dissapear! In some way the stuff stops the plugin.

Help, i ask for help many times but my thread allways have 1 post (mine)

I help when i can help...

Thanks
Mxnn is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-28-2009 , 21:25   Re: Creating entity
Reply With Quote #2

DispatchKeyValue("info_map_parameter", "buying", "3")

how DispatchKeyValue() is supposed to know on what entity it should apply the keyvalue ?

-> DispatchKeyValue(ENT_CLASS, "buying", "3")
__________________
Arkshine is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-28-2009 , 21:25   Re: Creating entity
Reply With Quote #3

http://www.amxmodx.org/funcwiki.php?...alue&go=search
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-28-2009 , 21:30   Re: Creating entity
Reply With Quote #4

Create your ent in plugin_precache() forward, and remove armouries in plugin_init() forward.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-28-2009 , 21:31   Re: Creating entity
Reply With Quote #5

Ah. He forgets to add public.
__________________
Arkshine is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 12-28-2009 , 21:55   Re: Creating entity
Reply With Quote #6

Yes i forget it but i have it in the code..
But can be that in the first round works the handle buy but in the second don't works?

EDIT: In the plugin_precache it works but the armoury entities didn't dissapear..
I will try to put in a function the other stuff

EDIT2: Thanks to you it works +k

Last edited by Mxnn; 12-28-2009 at 22:05.
Mxnn is offline
Reply



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 04:14.


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