.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 1 SDK (http://forums.bots-united.com/forumdisplay.php?f=33)
-   -   Looking for humans being spawned. (http://forums.bots-united.com/showthread.php?t=4728)

Austin 03-12-2005 20:35

Looking for humans being spawned.
 
I am using this to find hostages being spawned.
Code:

int Spawn_post(edict_t *pent)
{
        // are we spawning a hostage ?
        if (strcmp (STRING (pent->v.classname), "hostage_entity") == 0)
...

How do I change this to look for human players being spawned?
tx.

Whistler 04-12-2005 02:52

Re: Looking for humans being spawned.
 
tracking ClientConnect() or ClientPutInServer()?

Austin 04-12-2005 04:07

Re: Looking for humans being spawned.
 
No, i need to catch them at Spawn_post()
Because I will be tweaking the health of humans when they respawn at round start.

I guess I can simply put in log messages and look for what is obviously humans spawning, but I thought someone might know the entity type for humans/players..
tx

Whistler 04-12-2005 05:37

Re: Looking for humans being spawned.
 
the entity name of players is "player". However I don't think the DispatchSpawn() function will get called at each round.

Cheeseh 04-12-2005 14:50

Re: Looking for humans being spawned.
 
If this is a deathmatch mod... I guess you could just continuously poll through each player and check if they died, set a flag, wait till they aren't dead anymore, et voila they've respawned.

If it's round based..
you need to know how to catch a new round and call your function on every player after the round starts.

Pierre-Marie Baty 05-12-2005 06:06

Re: Looking for humans being spawned.
 
More logically, check for the time when the player entity gets

1°) teleported to another location
2°) rendered visible again

That will mean a "spawn".


All times are GMT +2. The time now is 16:46.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.