AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Spawns question? Need Help ! (https://forums.alliedmods.net/showthread.php?t=41039)

jopmako 07-08-2006 02:40

Spawns question? Need Help !
 
Code:

public plugin_init(){
 
  new ent, max_ts,entity
  new Float:origin[3]
  while ((ent = find_ent_by_class(ent, "info_player_deathmatch")))
    max_ts++
 
  while (max_ts<32){
    entity = create_entity("info_player_deathmatch")
    // set origin here
    entity_set_origin (entity,origin)
    max_ts++
    }
}

In a map 22 spawn point for player.
The above code can create a new spawn point to 32,but also doesnot allow for player join.
Is seem HL engine does not refresh the changing.

I try to put this code in plugin_precache(),it works.
But max_ts = 0 ??? ,in plugin_precache can't count the entity .

Any one help? thanks.

Emp` 07-08-2006 14:44

Re: Spawns question? Need Help !
 
wouldnt really do it in plugin_precache...

the spawn ents prolly have more settings which makes them useable. you should use/make a plugin that gets all the info about spawn points, then set that info on your fake spawn ents.

VEN 07-09-2006 08:43

Re: Spawns question? Need Help !
 
Quote:

the spawn ents prolly have more settings
DispatchSpawn of the created entity should solve such issue.

jtp10181 07-09-2006 10:53

Re: Spawns question? Need Help !
 
wtf does this have to do with superhero? - moving post

jopmako 07-09-2006 15:41

Re: Spawns question? Need Help !
 
Quote:

Originally Posted by VEN
DispatchSpawn of the created entity should solve such issue.

DispatchSpawn(ents)
Not work also.

jopmako 07-12-2006 16:56

Re: Spawns question? Need Help !
 
help help? thanks.

commonbullet 07-13-2006 01:27

Re: Spawns question? Need Help !
 
You must know you're creating spawns at the origin (0,0,0); which will cause players to get stuck and die at spawn.
I guess the missing part, "// set origin here", is relevant for checking the problem.

jopmako 07-14-2006 05:21

Re: Spawns question? Need Help !
 
Quote:

Originally Posted by commonbullet
You must know you're creating spawns at the origin (0,0,0); which will cause players to get stuck and die at spawn.
I guess the missing part, "// set origin here", is relevant for checking the problem.

Thank you for your respond,but,you may not unstand what i am saying,
because for my bad english,so sorry.

---------
example:

Server load a map de_train , base this map only for 22 players
I want to setup for 32 players

I make a plugin use add ent and set origin and more player can join in, it work fine.

How can you do that whitout use plugin_precache() ,So more player can join in.
Becurse, in plugin_precache() i cannt count the original spawns i need to used.

thanks.

Orangutanz 07-14-2006 07:58

Re: Spawns question? Need Help !
 
You MUST create this in precache, things you need:

Code:
spawn = create_entity("info_player_deathmatch") // Terrorist /* or spawn = create_entity("info_player_start") */ // CT set_entity_origin(spawn, SOMEORIGIN) set_pev(spawn, pev_angles, SOMEANGLES) dispatch_spawn(spawn)
Failure on doing = no new spawn, since the HL engine caches them in precache. If you say it doesn't work, I'll slap you!!! I already have this method tried and tested been working for many months, since the mod I'm working on destroys old and places in new.

Quote:

Originally Posted by jopmako
How can you do that whitout use plugin_precache() ,So more player can join in.
Becurse, in plugin_precache() i cannt count the original spawns i need to used.

Why do you need to do that?

Only solution here is physically storing how many spawns are on each map then you can work it out in precache. As you said you know de_train has 22 spawns so thats 11 CT and 11 T, just means storing all this info in your script I'm afraid.

There is a more hacky way:
create 32 spawn points (precache)
store misc data in iuser4 (still precache)
plugin_init check total amount of spawns
then start removing ones you added since they have a unique key (iuser4)

jopmako 07-14-2006 10:02

Re: Spawns question? Need Help !
 
Quote:

Only solution here is physically storing how many spawns are on each map then you can work it out in precache. As you said you know de_train has 22 spawns so thats 11 CT and 11 T, just means storing all this info in your script I'm afraid.
spawn= 24 ,it is my misstake when the post. haha

Quote:

Why do you need to do that?
whitout use plugin_precache()
I make a plugin use add ent and set origin and more player can join in, it work fine.
But must setup howmany (t ot ct) need to be add in plugin_precache().

Quote:

There is a more hacky way:
create 32 spawn points (precache)
store misc data in iuser4 (still precache)
plugin_init check total amount of spawns
then start removing ones you added since they have a unique key (iuser4)
good ideas , i know how to do now, thanks a lot.:up: :up: :up:


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

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