Raised This Month: $ Target: $400
 0% 

Problem when create a entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Spriite
Member
Join Date: Aug 2010
Old 02-21-2013 , 18:14   Problem when create a entity
Reply With Quote #1

Wath's wrong?
PHP Code:
public make_light(id)
{
 new 
Float:fOrigin[3];
 
pev(idpev_originfOrigin);
 
 new 
entity engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"light"));
 
 new 
origin[16];
 
formatex(origin31"%d %d %d"floatround(fOrigin[0]), floatround(fOrigin[1]), floatround(fOrigin[2]));
 
fm_set_kvd(entity"classname""light");
 
fm_set_kvd(entity"origin"origin);
 
fm_set_kvd(entity"targetname""red_light");
 
fm_set_kvd(entity"style""32");
 
fm_set_kvd(entity"_fade""1.0");
 
fm_set_kvd(entity"_light""255 000 000 200");
 
//fm_set_kvd(entity, "spawnflags", "0");
 
dllfunc(DLLFunc_Spawnentity);
 
 if(
pev_valid(entity))
  
client_print(idprint_chat"Entity working...")
}
 
stock fm_set_kvd(entity, const key[], const value[], const classname[] = "")
{
 if (
classname[0])
  
set_kvd(0KV_ClassNameclassname);
 else {
  new class[
32];
  
pev(entitypev_classname, class, sizeof class - 1);
  
set_kvd(0KV_ClassName, class);
 }
 
set_kvd(0KV_KeyNamekey);
 
set_kvd(0KV_Valuevalue);
 
set_kvd(0KV_fHandled0);
 return 
dllfunc(DLLFunc_KeyValueentity0);

The entity is created, but doesn't work.
Someone can help me?

Sorry for my bad english.

Last edited by Spriite; 02-22-2013 at 16:17.
Spriite is offline
 



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 21:39.


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