Raised This Month: $ Target: $400
 0% 

Problem when create a entity


Post New Thread Reply   
 
Thread Tools Display Modes
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
Old 02-25-2013, 14:58
Spriite
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Spriite
Member
Join Date: Aug 2010
Old 03-07-2013 , 06:50   Re: Problem when create a entity
Reply With Quote #2

Bump...
Spriite is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 03-07-2013 , 10:11   Re: Problem when create a entity
Reply With Quote #3

PHP Code:
 new Float:fOrigin[3];
 
pev(idpev_originfOrigin);

 new 
origin[16];
 
formatex(origin31"%d %d %d"floatround(fOrigin[0]), floatround(fOrigin[1]), floatround(fOrigin[2]));
 
fm_set_kvd(entity"origin"origin); 
I think this must be:
PHP Code:
 new Float:fOrigin[3];
 
pev(idpev_originfOrigin);

 
fm_set_kvd(entity"origin"fOrigin); 
And try to spawn the entity before all fm_set_kvd

Last edited by didoWEE; 03-07-2013 at 10:15.
didoWEE is offline
Spriite
Member
Join Date: Aug 2010
Old 03-07-2013 , 14:36   Re: Problem when create a entity
Reply With Quote #4

Noops, the value must be a string.
Spriite is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 03-07-2013 , 19:50   Re: Problem when create a entity
Reply With Quote #5

Do you want to create a light effect? Because you can't, it's built into the map compilation
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Reply


Thread Tools
Display Modes

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