AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Replacing CT spawns with Ts (https://forums.alliedmods.net/showthread.php?t=229422)

Xalus 11-07-2013 11:57

Replacing CT spawns with Ts
 
I'm trying to replace CT spawn to T spawns,
so Ts randomly spawn also on the (old) CT spawn

PHP Code:

new intEntity
    
while((intEntity engfunc(EngFunc_FindEntityByStringintEntity"classname""info_player_start")) != 0)
    {
        
set_pev(intEntitypev_classname"info_player_deathmatch")
    } 

Doesnt seems to work, any ideas?

lein 11-07-2013 12:09

Re: Replacing CT spawns with Ts
 
You can collect the spawn points.
Then
PHP Code:


RegisterHam
(Ham_Spawn"player""fw_PlayerSpawn_Post"1)


SpawnOrigin SpawnPoint[random_num(0MapMaxSpawns)]
while((
ent engfunc(EngFunc_FindEntityInSphereent,SpawnOrigin,60.0))) {
    
SpawnOrigin SpawnPoint[random_num(0MapMaxSpawns)]
}
engfunc(EngFunc_SetOriginidSpawnOrigin


Xalus 11-07-2013 12:23

Re: Replacing CT spawns with Ts
 
I think that would be a badway if it could be possible like how I wanted it.
But yh, it should be plan #2 (btw ur code is totaly wrong anwyay)

ConnorMcLeod 11-07-2013 12:59

Re: Replacing CT spawns with Ts
 
Do this at entities Spawn, or change origins, anything you do on classname is not taken in account if done after precache.

MPNumB 11-08-2013 10:47

Re: Replacing CT spawns with Ts
 
What about hooking where they are attempted to be created and with what angle, block their creation (so players wont die when 2 spawn in the same spot), and create an opposed team spawn in its place with saved angle as well?

---

Also what about buyzones, hostages, hostage_rescue_spots, bomb_plants, bomb_plants_other_entity, vip_rescue_spots, terrorist_escape_spots? I once had idea like that, but this factors kind of made me rethink it.
P.S. Yea, entity names aren't that, but at least you know what I mean.

ConnorMcLeod 11-08-2013 12:01

Re: Replacing CT spawns with Ts
 
Change their classname at spawn should be enough, if and only if you want to change all spawns.

Else, or for other entities, you can easily read the .bsp file and store all entities that gonna be created


All times are GMT -4. The time now is 23:15.

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