AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Replace spawns? (https://forums.alliedmods.net/showthread.php?t=85881)

VMAN 02-17-2009 10:03

Replace spawns?
 
First off, I am aware of the Map Spawns Editor plugin, but I don't want to use that because I only need to fix the spawns on one of my maps.


So what I want to do is first strip all the spawns. I think this should take care of that.

PHP Code:

tspawns engfunc(EngFunc_FindEntityByStringent"classname""info_player_deathmatch");
        
engfunc(EngFunc_RemoveEntitytspawns);
ctspawns engfunc(EngFunc_FindEntityByStringent"classname""info_player_start");
        
engfunc(EngFunc_RemoveEntityctspawns); 

Now I am having trouble setting the new spawns.


Is it possible to store the new tspawns and the new ctspawns in their own array?


EX: My two ct spawns

-943 -367 190 0 1 0
-949 -113 190 0 1 0

my two t spawns

-955 138 190 0 1 0
-961 420 190 0 1 0


And then have some function like foreach line in the array create a new spawn and set the angle?

Sorry if this is confusing

Exolent[jNr] 02-17-2009 18:49

Re: Replace spawns?
 
Quote:

Originally Posted by VMAN (Post 763226)
First off, I am aware of the Map Spawns Editor plugin, but I don't want to use that because I only need to fix the spawns on one of my maps.

Then use a per-map plugins.ini for that map and enable Map Spawns Editor for that map.

BFK_GoNER 02-18-2009 05:39

Re: Replace spawns?
 
Alternatively, you could change the map entities directly using ripent. It extracts the entities list and parameters from .bsp, which you can change easily and import back into the map. The clients won't have to download any extra files because the entities list is sent to them each time anyway.

How to use:
1) Put the .bsp map file and ripent.exe in the same folder
2) Run ripent with keys: -extract -texdata1 YourMapName
3) Edit the .ent file, in your case change the entities' locations
4) Import the list back into .bsp by ripent with keys: -import -texdata1 YourMapName
5) Restart the server

You can add/delete/change any other entities you like, not only info_player_deathmatch and info_player_start. Check this website for more info.

Download ripent: here or here or here or here

VMAN 03-30-2009 23:19

Re: Replace spawns?
 
I've done what exolent recommended.

However, can you please just show me some example code that can do this?


All times are GMT -4. The time now is 16:52.

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