OnPlayerDeath Problem
#1

Код:
	if(team[playerid] == TEAM_HUMAN)
	{
 		ZombieSetup(playerid);
 		team[playerid] = TEAM_ZOMBIE;
	    SetPlayerTeam(playerid,TEAM_ZOMBIE);
	}
Why is the player when he is human still human when he make suicide?
Reply
#2

That looks okay, can you show us the ZombieSetup function?
Reply
#3

Код:
stock ZombieSetup(playerid)
{
    team[playerid] = TEAM_ZOMBIE;
    TogglePlayerControllable(playerid,0);
	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid,4,1);
	SetPlayerTeam(playerid,TEAM_ZOMBIE);
	SetPlayerColor(playerid,COLOR_ZOMBIE);
    TogglePlayerControllable(playerid,1);
	new zskin = random(3);
 	switch(zskin) {
  		case 0:SetPlayerSkin(playerid,162);
    	case 1:SetPlayerSkin(playerid,134);
     	case 2:SetPlayerSkin(playerid,137);
	}
	return 1;
}
Reply
#4

Use this :-
pawn Код:
if(team[playerid] == TEAM_HUMAN)
    {
        ZombieSetup(playerid);
    }
As it already got : SetPlayerTeam.
Reply
#5

When the player make suicide and he is human he die, but then he spawns as Human again and is not Zombie then.
Reply
#6

I Edited my Post, Hope it will Help.
Reply
#7

The only reason I would think of would be that it gets never called, just put a debug print before the if statment and test it
Reply
#8

is this under if(killerid != INVALID_PLAYER_ID)? cause if it is then it wont get called cause the player hasnt suicided but killed. You must put


pawn Код:
if(team[playerid] == TEAM_HUMAN)
    {
        ZombieSetup(playerid);
        team[playerid] = TEAM_ZOMBIE;
        SetPlayerTeam(playerid,TEAM_ZOMBIE);
    }
under OnPlayerDeath in order for the the player to change when he suicides.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)