Error spawning as zombie
#1

So i have this
PHP код:
CMD:kill(playerid)
{
    if(
team[playerid] == TEAM_HUMAN)
    {
        
SetPlayerHealth(playerid,0.0);
        
SendClientMessage(playerid,-1,""chat" You've killed yourself");
    }
    else return 
SendClientMessage(playerid,-1,""chat" You cannot kill yourself if you are an 'Zombie'");
    return 
1;

What i want to do? when a human uses /kill he should be spawned as zombie, not as human again. Some help please?
Reply
#2

Set team to zombie ?
Reply
#3

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Set team to zombie ?
Yep, only humans are allowed to use this command, when they will use it, when they will spawn they will have to spawn as zombies, not as humans again.
Reply
#4

pawn Код:
team[playerid] = TEAM_ZOMBIE;
?
Reply
#5

If i change to TEAM_ZOMBIE i won`t be able to use the /kill command because zombies are not allowed to use it, what i want is when a human uses the /kill command, they have to respawn as zombies not as humans.
Reply
#6

So I am suggesting that when a human uses the /kill command, you set their team to zombie.
Reply
#7

Well, what if i`m not there to do it? They will simply use /kill command to deny death and respawn back as human to continue playing.
Reply
#8

PHP код:
CMD:kill(playerid

    if(
team[playerid] == TEAM_HUMAN
    { 
        
SetPlayerHealth(playerid,0.0); 
        
SendClientMessage(playerid,-1,""chat" You've killed yourself"); 
        
SetTeamZombie(pkayerid) ==== your variable
    

    else return 
SendClientMessage(playerid,-1,""chat" You cannot kill yourself if you are an 'Zombie'"); 
    return 
1

Reply
#9

Solved!

I changed it like this:

PHP код:
CMD:kill(playerid)
{
    if(
team[playerid] == TEAM_HUMAN)
    {
        
SetPlayerHealth(playerid,0.0);
        
SendClientMessage(playerid,-1,""chat" You've killed yourself");
        
SetPlayerTeam(playerid,TEAM_ZOMBIE);
        
team[playerid] = TEAM_ZOMBIE;
    }
    else return 
SendClientMessage(playerid,-1,""chat" You cannot kill yourself if you are an 'Zombie'");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)