Raised This Month: $ Target: $400
 0% 

Spawns question? Need Help !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 07-08-2006 , 02:40   Spawns question? Need Help !
Reply With Quote #1

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.

Last edited by jopmako; 07-08-2006 at 02:51.
jopmako is offline
Send a message via MSN to jopmako
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 07-08-2006 , 14:44   Re: Spawns question? Need Help !
Reply With Quote #2

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.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
VEN
Veteran Member
Join Date: Jan 2005
Old 07-09-2006 , 08:43   Re: Spawns question? Need Help !
Reply With Quote #3

Quote:
the spawn ents prolly have more settings
DispatchSpawn of the created entity should solve such issue.
VEN is offline
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 07-09-2006 , 15:41   Re: Spawns question? Need Help !
Reply With Quote #4

Quote:
Originally Posted by VEN
DispatchSpawn of the created entity should solve such issue.
DispatchSpawn(ents)
Not work also.
jopmako is offline
Send a message via MSN to jopmako
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-09-2006 , 10:53   Re: Spawns question? Need Help !
Reply With Quote #5

wtf does this have to do with superhero? - moving post
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 07-12-2006 , 16:56   Re: Spawns question? Need Help !
Reply With Quote #6

help help? thanks.
jopmako is offline
Send a message via MSN to jopmako
commonbullet
Veteran Member
Join Date: Oct 2005
Old 07-13-2006 , 01:27   Re: Spawns question? Need Help !
Reply With Quote #7

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.

Last edited by commonbullet; 07-13-2006 at 01:32.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 07-14-2006 , 05:21   Re: Spawns question? Need Help !
Reply With Quote #8

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.
jopmako is offline
Send a message via MSN to jopmako
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 07-14-2006 , 07:58   Re: Spawns question? Need Help !
Reply With Quote #9

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)

Last edited by Orangutanz; 07-14-2006 at 08:12.
Orangutanz is offline
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 07-14-2006 , 10:02   Re: Spawns question? Need Help !
Reply With Quote #10

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.
jopmako is offline
Send a message via MSN to jopmako
Reply



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:59.


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