#1  
Old 05-20-2010, 09:57 AM
dpvDuncan Offline
Civilian
 
Join Date: Sep 2009
Posts: 2
Default ChangeClientTeam

Hello,

For some players, I would like that when a human dies, he then spawns as a human again.

I already managed to save his position in the "player_death" event, i also managed to teleport this player in the "player_spawn" event. In the same time, i managed to change his skin so that he appears as a human and i changed his team from zombie to human.

My problem is that, when the player upraises he keeps the zombie gameplay. So the human can't take weapons and the player still sees his hands as zombie's hands.

My 2 questions are :
* Does somebody knows a method to spawn a player as a human in zombie panic source? It would be the simplest.
* Or does somebody knows how to change the team correctly?

Thank you
Reply With Quote
  #2  
Old 05-20-2010, 10:55 AM
Sammy-ROCK! Offline

ZPS Team Lead
Developer
 
Join Date: Apr 2008
Location: Brazil, Rio de Janeiro.
Posts: 1,590
Default

You have to notify the GameManager that the player is now a human. There are virtual functions that can be easily called with SDKTools.
Reply With Quote
  #3  
Old 05-21-2010, 09:15 AM
dpvDuncan Offline
Civilian
 
Join Date: Sep 2009
Posts: 2
Default

Thanks a lot, i didn't know SDKTools, it's the second plugin i'm developing.
I managed to use virtual functions but i still have my problem, indeed i don't know if i'm calling the wrong function.

Here are the virtual functions I have used:
21 CHL2MP_Player::Spawn(void)
86 CHL2MP_Player::ChangeTeam(int)

I've also tried :
ForceRespawn
ZPASpawn
HandleCommand_JoinTeam
InitialSpawn

With the Spawn function, the player spawns on his team map spawn points. Thus, I first have to change the players team from zombie to human. But when I switch the player from the zombies to the humans, the hands of the player still appear as zombie's hands.

In fact I need a function which could be called SpawnAsHuman(void). The killed player would spawn as human as in the beginning of the round.
Reply With Quote
  #4  
Old 05-21-2010, 02:44 PM
Sammy-ROCK! Offline

ZPS Team Lead
Developer
 
Join Date: Apr 2008
Location: Brazil, Rio de Janeiro.
Posts: 1,590
Default

It's on CHL2MPRules.
Reply With Quote
  #5  
Old 06-02-2010, 04:34 AM
Will2Tango's Avatar
Will2Tango Offline
Survivor
 
Join Date: Jul 2009
Location: zpo_shreddingfield
Posts: 163
Default

I have been trying to swap teams properly for months, and at last thanks to Sammy I have made progress!
I have managed to find...

ChangeToHuman(CHL2MP_Player *)
ChangeToZombie(CHL2MP_Player *)
ChangeToObserver(CHL2MP_Player *)

But... they do not seem to do anything for me

I'm not sure if i am using the wrong virtual offset or passing it the wrong value, the "CHL2MP_Player" has thrown me, if only it were a void or int
Could you point me in the right direction once again please Sammy
Thanks for all your guidance!
Reply With Quote
  #6  
Old 06-02-2010, 12:26 PM
Sammy-ROCK! Offline

ZPS Team Lead
Developer
 
Join Date: Apr 2008
Location: Brazil, Rio de Janeiro.
Posts: 1,590
Default

How are you using that?
Reply With Quote
  #7  
Old 06-02-2010, 03:35 PM
Will2Tango's Avatar
Will2Tango Offline
Survivor
 
Join Date: Jul 2009
Location: zpo_shreddingfield
Posts: 163
Default

I've tryed afew variations of an sdkcall, im not sure about that paramiter...

Code:
	StartPrepSDKCall(SDKCall_Player);
	PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, "MakeZombie");
	//PrepSDKCall_AddParameter(SDKType_CBasePlayer, SDKPass_Pointer);
	hMakeZombie = EndPrepSDKCall();
Its not an EntData off set again is it? I'll be trying that one tomorrow
Thanks Sammy
Reply With Quote
  #8  
Old 06-02-2010, 05:50 PM
Sammy-ROCK! Offline

ZPS Team Lead
Developer
 
Join Date: Apr 2008
Location: Brazil, Rio de Janeiro.
Posts: 1,590
Default

Why are you calling on a player if the offset is from gamerules?
Reply With Quote
  #9  
Old 06-03-2010, 12:02 AM
Will2Tango's Avatar
Will2Tango Offline
Survivor
 
Join Date: Jul 2009
Location: zpo_shreddingfield
Posts: 163
Default

ha ha, Good question... for some reason it made sence in my head, i can see how daft that is now! and that explains why it did nothing for me, as always you are a great help! i should be able to crack it now. (finally)
Thank you very much Sammy!
Reply With Quote
  #10  
Old 06-03-2010, 08:28 AM
Sammy-ROCK! Offline

ZPS Team Lead
Developer
 
Join Date: Apr 2008
Location: Brazil, Rio de Janeiro.
Posts: 1,590
Default

glad to help xP
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -8. The time now is 12:43 PM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Style by © Mathew Summerfield
All Zombie Panic related images and material © Monochrome