AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Spawn entities classnames. (https://forums.alliedmods.net/showthread.php?t=132540)

fezh 07-15-2010 20:02

Spawn entities classnames.
 
Now I don't have enough time to test so I'd like to ask if it's possible to replace the terrorist's spawn entities classnames by ct's ones (info_player_deathmatch and info_player_start respectively). What I thought about is hooking FM_Spawn pre and replacing the classname there (with some checks obviously). Will it work?

Sylwester 07-16-2010 00:30

Re: Spawn entities classnames.
 
If you want to swap team spawns, then check this plugin:
http://forums.alliedmods.net/showthread.php?p=897057

ot_207 07-16-2010 02:39

Re: Spawn entities classnames.
 
Basically I can only think of 2 methods, have not tested them!
Before FM_Spawn to change its classname or in FM_AllocString. Other than that I do not know.

joropito 07-16-2010 14:03

Re: Spawn entities classnames.
 
Quote:

Originally Posted by ot_207 (Post 1241077)
Basically I can only think of 2 methods, have not tested them!
Before FM_Spawn to change its classname or in FM_AllocString. Other than that I do not know.

Everything must be done at precache.

I suggets to hook FM_CreateEntity or FM_CreateNamedEntity (pre) and supercede with your own entity.

Also you can hook keyvalues to save it and then at spawn (post) create a new spawnpoint for the other team in same location and delete de first one (I suggets to set FL_KILLME).

xPaw 07-16-2010 17:55

Re: Spawn entities classnames.
 
Code:
public pfn_keyvalue( iEntity ) {     new szClassName[ 32 ], szKeyName[ 32 ], szValue[ 32 ];     copy_keyvalue( szClassName, 31, szKeyName, 31, szValue, 32 );         if( equal( szClassName, "info_player_deathmatch" ) )         DispatchKeyValue( iEntity, "classname", "info_player_start" ); }
Should work

joropito 07-18-2010 14:00

Re: Spawn entities classnames.
 
Currently I'm trying to do something like this but with custom entities.

I have a map with non-standard classnames (func_xpaw for example)

Then, in my plugin I want to get those func_xpaw and convert to other entity (func_wall, func_door, etc).

I've tried to hook CreateNamedEntity, but is not called at map load (at precache).

Does anyone knows how to hook them?


All times are GMT -4. The time now is 07:09.

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