Raised This Month: $ Target: $400
 0% 

how to get entity id??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
0920357689
Senior Member
Join Date: Apr 2008
Old 05-12-2010 , 19:30   how to get entity id??
Reply With Quote #1

why some time will get error ent_id ?

PHP Code:
  new Ent create_entity("info_target")
  new 
ent_name[32]
  
format(ent_name31"ct_%d",id)
  
entity_set_string(EntEV_SZ_classnameent_name)
 
  
entity_set_int(EntEV_INT_solidSOLID_TRIGGER);
  
entity_set_model(EntModel_ct);
  
entity_set_size(EntFloat:{-165.0, -165.0, -165.0}, Float:{165.0165.0165.0});
  
entity_set_origin(EntvOrigin);
 
  new 
ent_id = -1;
  
ent_id find_ent_by_class end_ident_name )
  if(
ent_id != -1)
  {
 
core
  


other question

find_ent_by_class AND find_ent_by_target

what differ ??


my english too bad >_<sorry

Last edited by 0920357689; 05-12-2010 at 19:34.
0920357689 is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-12-2010 , 19:59   Re: how to get entity id??
Reply With Quote #2

find_ent_by_class finds an entity by its classname while find_ent_by_target finds an entity by its target.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-13-2010 , 05:35   Re: how to get entity id??
Reply With Quote #3

Quote:
how to get entity id??
Funny you ask that because in your example you use already this id : "Ent"...
Now to retrieve an id in another function based on the classname, find_ent_by_class is properly used.
__________________
Arkshine 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 03:32.


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