Raised This Month: $32 Target: $400
 8% 

Solved CreateEntityByName


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 11-28-2017 , 17:47   CreateEntityByName
Reply With Quote #1

I get this error on my plugin, when I call CreateEntityByName native. How can I check, if the map is running or not?

PHP Code:
[SMException reportedCannot create new entity when no map is running 
__________________

Last edited by Spirit_12; 11-30-2017 at 01:17.
Spirit_12 is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-28-2017 , 18:28   Re: CreateEntityByName
Reply With Quote #2

Simple, dont try create any entity before map load like OnMapStart, OnPluginStart...

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 11-29-2017 , 14:50   Re: CreateEntityByName
Reply With Quote #3

You generally create enitities during the round_start event.
__________________
Neuro Toxin is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 11-29-2017 , 16:09   Re: CreateEntityByName
Reply With Quote #4

I use

PHP Code:
HookEvent("round_start_post_nav"eRoundStartPostNav);

public 
eRoundStartPostNav(Handle:hEvent, const String:sName[], bool:bDontBroadcast)
{


Never got issues from using that, if you still get issues try a 1sec timer or check if any one is alive ingame.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-29-2017 , 16:57   Re: CreateEntityByName
Reply With Quote #5

What exactly do you need to do?

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 11-29-2017 , 19:47   Re: CreateEntityByName
Reply With Quote #6

Quote:
Originally Posted by Lux View Post
I use
Never got issues from using that, if you still get issues try a 1sec timer or check if any one is alive ingame.
Entities were being removed/created after the round start event, but that didn't do the trick. I added a 3 second timer and that fixed the issue for me.
__________________
Spirit_12 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 11-30-2017 , 00:10   Re: CreateEntityByName
Reply With Quote #7

HookEvent( "round_start", Hook_RoundStartPost, EventHookMode_Post );

That's how I did it and works for me.
hmmmmm is offline
bald14
Member
Join Date: Aug 2021
Old 09-23-2021 , 08:27   Re: CreateEntityByName
Reply With Quote #8

Quote:
Originally Posted by Lux View Post
I use

PHP Code:
HookEvent("round_start_post_nav"eRoundStartPostNav);

public 
eRoundStartPostNav(Handle:hEvent, const String:sName[], bool:bDontBroadcast)
{


Never got issues from using that, if you still get issues try a 1sec timer or check if any one is alive ingame.
specifically how can you clarify for me ?
sorry i'm not good at this and my english is bad too
bald14 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 09-23-2021 , 10:01   Re: CreateEntityByName
Reply With Quote #9

I think this is an exclusive event to L4D series, if you have this problem in another game, probably would use a different event or the other tips provided above.
__________________

Last edited by Marttt; 09-23-2021 at 10:01.
Marttt is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 09-24-2021 , 05:59   Re: CreateEntityByName
Reply With Quote #10

"round_start" event has a problem in CS: S, CS:GO and probably in other Source games. Sometimes it is fired before entities are clean-up, thus all entities created in the post hook may be deleted right away. It is enough to add a timer with 1 frame delay to avoid this problem.
kadet.89 is offline
Send a message via Skype™ to kadet.89
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 12:08.


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