Raised This Month: $ Target: $400
 0% 

Spawn entities classnames.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 07-15-2010 , 20:02   Spawn entities classnames.
Reply With Quote #1

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?
__________________
"There is no knowledge, that is not power"
fezh is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 07-16-2010 , 00:30   Re: Spawn entities classnames.
Reply With Quote #2

If you want to swap team spawns, then check this plugin:
http://forums.alliedmods.net/showthread.php?p=897057
__________________
Impossible is Nothing
Sylwester is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 07-16-2010 , 02:39   Re: Spawn entities classnames.
Reply With Quote #3

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.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 07-16-2010 at 02:44.
ot_207 is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-16-2010 , 14:03   Re: Spawn entities classnames.
Reply With Quote #4

Quote:
Originally Posted by ot_207 View Post
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).
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-16-2010 , 17:55   Re: Spawn entities classnames.
Reply With Quote #5

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
__________________
xPaw is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-18-2010 , 14:00   Re: Spawn entities classnames.
Reply With Quote #6

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?
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
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 07:09.


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