AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Create a entity and save it. (https://forums.alliedmods.net/showthread.php?t=135374)

fireattack 08-15-2010 11:44

Create a entity and save it.
 
PHP Code:

new aimVector[3]
public 
plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR);
 
register_concmd"amx_entity""createaentity");
}
public 
createaentity (id)
{
 new 
LoL create_entity"info_target" );
 new 
Float:fOrigin[3];
 {
  
entity_set_modelLoL"models/themodel.mdl"); 
  
get_user_origin(idaimVector3);
  
IVecFVec(aimVectorfOrigin);
  {
   
set_pevLoLpev_classname"AnEntity" );;
   
set_pevLoLpev_solid    SOLID_BBOX  );
  }
 }


Well, with the entity spawned, how i can save it by nvault?

Arkshine 08-15-2010 11:46

Re: Create a entity and save it.
 
Saving an entity in nvault ? It doesn't make sense. What do you want to do exactly ?

fireattack 08-15-2010 11:50

Re: Create a entity and save it.
 
When you spawn the entity, the entity keep saved if you change the map or make a restart.

Hunter-Digital 08-15-2010 19:06

Re: Create a entity and save it.
 
You can't save actual entities, they also are not transfered from map to map, they're all deleted and respawned in the new map... you must spawn them using a plugin and you can load from a file, sql or nvault some variable data... like it's origin in the map.

Mxnn 08-15-2010 19:23

Re: Create a entity and save it.
 
You can save the origins in a .txt and when the plugin starts you ask for the origins in that file. If exists, spawn it.

fireattack 08-16-2010 13:28

Re: Create a entity and save it.
 
Quote:

Originally Posted by Mxnn (Post 1272031)
You can save the origins in a .txt and when the plugin starts you ask for the origins in that file. If exists, spawn it.

Nice idea, I'll try.

Hunter-Digital 08-16-2010 23:39

Re: Create a entity and save it.
 
Quote:

Originally Posted by Mxnn (Post 1272031)
You can save the origins in a .txt and when the plugin starts you ask for the origins in that file. If exists, spawn it.

That's what I said...
Quote:

Originally Posted by Hunter-Digital (Post 1272011)
You can't save actual entities, they also are not transfered from map to map, they're all deleted and respawned in the new map... you must spawn them using a plugin and you can load from a file, sql or nvault some variable data... like it's origin in the map.



All times are GMT -4. The time now is 22:02.

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