SA-MP Forums Archive
Error spawning as zombie - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error spawning as zombie (/showthread.php?tid=651341)



Error spawning as zombie - Graphyt - 18.03.2018

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?


Re: Error spawning as zombie - MadeMan - 18.03.2018

Set team to zombie ?


Re: Error spawning as zombie - Graphyt - 18.03.2018

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.


Re: Error spawning as zombie - MadeMan - 18.03.2018

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


Re: Error spawning as zombie - Graphyt - 18.03.2018

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.


Re: Error spawning as zombie - MadeMan - 18.03.2018

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


Re: Error spawning as zombie - Graphyt - 18.03.2018

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.


Re: Error spawning as zombie - Zeus666 - 18.03.2018

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




Re: Error spawning as zombie - Graphyt - 18.03.2018

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;