Raised This Month: $ Target: $400
 0% 

Find out when an entity is created.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 01-03-2007 , 20:06   Find out when an entity is created.
Reply With Quote #1

My first tought was:
Code:
register_forward(FM_CreateNamedEntity,"createent")
But this doesnt seem to return the id of the entity that is being created.

Does anyone knows a way to do this?



Thanks,

Ramono
__________________
Um, hi.
Ramono is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 01-03-2007 , 23:18   Re: Find out when an entity is created.
Reply With Quote #2

What about FM_CreateEntity?
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 01-04-2007 , 09:47   Re: Find out when an entity is created.
Reply With Quote #3

Quote:
Originally Posted by Orangutanz View Post
What about FM_CreateEntity?
Doesnt return the value either

Quote:
Originally Posted by sawce View Post
Code:
/* Returns the original return value of an engine function. 
 * This is only valid in forwards that were registered as post.
 *
 * get_orig_retval() - no params, retrieves integer return value
 * get_orig_retval(&Float:value) - retrieves float return value by reference
 * get_orig_retval(value[], len) - retrives string return value
 */
native get_orig_retval({Float,_}:...)
Could either do that (inside of createnamedentity/createentity post calls), or hook createnamedentity/createentity, supercede it, create your own entity, and force that return value, but thats kinda bad to do incase other plugins are looking for those forwards to get return values too.
It returns "0"

Edit: it does work, forgot to set post to 1

++k to both
__________________
Um, hi.

Last edited by Ramono; 01-04-2007 at 09:52.
Ramono is offline
sawce
The null pointer exception error and virtual machine bug
Join Date: Oct 2004
Old 01-03-2007 , 23:23   Re: Find out when an entity is created.
Reply With Quote #4

Code:
/* Returns the original return value of an engine function. 
 * This is only valid in forwards that were registered as post.
 *
 * get_orig_retval() - no params, retrieves integer return value
 * get_orig_retval(&Float:value) - retrieves float return value by reference
 * get_orig_retval(value[], len) - retrives string return value
 */
native get_orig_retval({Float,_}:...)
Could either do that (inside of createnamedentity/createentity post calls), or hook createnamedentity/createentity, supercede it, create your own entity, and force that return value, but thats kinda bad to do incase other plugins are looking for those forwards to get return values too.
__________________
fyren sucks
sawce 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 22:29.


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