Raised This Month: $ Target: $400
 0% 

Question Reguarding Playerspawn Event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 08-15-2010 , 15:34   Question Reguarding Playerspawn Event
Reply With Quote #1

I know the most efficient way of grabbing the playerspawn forward is though ham, but I have found that it is not always successful. I know that on new rounds, players who didn't die technically don't respawn, but I was curious if it is possible to grab the event on new rounds as well without using get_players. I was thinking of using ResetHUD, but will that work?
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-15-2010 , 15:37   Re: Question Reguarding Playerspawn Event
Reply With Quote #2

Use ham_spawn post. In the forward, check if user alive and that will correctly hook spawn.

Untested
PHP Code:
Register_HamHam_Spawn "player" "fw_Spawn" );

public 
fw_Spawnid )
{
     if ( 
is_user_alive id ) )
          
//player spawned

__________________
Bugsy is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 08-15-2010 , 15:47   Re: Question Reguarding Playerspawn Event
Reply With Quote #3

That's exactly what I use.

RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn_Post", 1)
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-15-2010 , 15:54   Re: Question Reguarding Playerspawn Event
Reply With Quote #4

is_user_alive() is a must like said Bugsy. You use it, right?
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-15-2010 , 16:01   Re: Question Reguarding Playerspawn Event
Reply With Quote #5

Quote:
Originally Posted by Tirant View Post
players who didn't die technically don't respawn
Yes, they do.
Ham_Spawn is called.

Look at multiplay gamerules : http://code.google.com/p/cs-sdk/sour..._gamerules.cpp

Function : void CHalfLifeMultiplay::RestartRound()
Is called at each new round.

line 514 is called for each player : pPlayer->RoundRespawn();
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-15-2010 , 16:13   Re: Question Reguarding Playerspawn Event
Reply With Quote #6

( Just a side-note you can use the search box, very useful like : http://www.google.com/codesearch?q=R...G=Search+Trunk )
__________________
Arkshine is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 08-15-2010 , 17:05   Re: Question Reguarding Playerspawn Event
Reply With Quote #7

if (!is_user_alive(id) || !cs_get_user_team(id))
return

Thanks for the link!
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Reply


Thread Tools
Display Modes

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 21:52.


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