SA-MP Forums Archive
Doesn't work - 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: Doesn't work (/showthread.php?tid=349244)



Doesn't work - sanrock - 08.06.2012

I have made a human command so if you kill a human you can be zombie but it keeps saying you need to kill

here the codes
pawn Код:
CMD:human(playerid)
{
    if(gTeam[playerid] == TEAM_HUMAN)
    {
         SendClientMessage(playerid, COLOR_RED, "You are already a human");
    }
    else
    {
        if(PlayerInfo[playerid][Cantransform] == 1)
        {
            ForceClassSelection(playerid);
            SetPlayerHealth(playerid, 0);
        }
        else return SendClientMessage(playerid, 0xFF2222FF, "You need to first kill a human to transform into one");
    }
    return 1;
}
onplayerdeath
pawn Код:
if (gTeam[killerid] == TEAM_ZOMBIE)
    {
        SendClientMessage(killerid, COLOR_RED, "You can now become human, use /human to change if you want to");
        PlayerInfo[killerid][Cantransform] = 1;
    }
pawn Код:
enum pInfo
{
    Kills,
    Deaths,
    Cantransform,
    Rank
}
Whats wrong?


Re: Doesn't work - sanrock - 08.06.2012

bump


Re: Doesn't work - leonardo1434 - 08.06.2012

try now

pawn Код:
enum pInfo
{
    Kills,
    Deaths,
    Cantransform,
    Rank
}

CMD:human(playerid)
{

    if(gTeam[playerid] == TEAM_HUMAN) {
        SendClientMessage(playerid, COLOR_RED, "You are already a human");
    }
    if(PlayerInfo[playerid][Cantransform] == 1) return SendClientMessage(playerid, 0xFF2222FF, "You need to first kill a human to transform into one");
    {
        SetPlayerHealth(playerid, 0);
        PlayerInfo[killerid][Cantransform] = 0;
        ForceClassSelection(playerid);
    }
    return 1;
}


onplayerdeath
if (gTeam[killerid] == TEAM_ZOMBIE)
{
    SendClientMessage(killerid, COLOR_RED, "You can now become human, use /human to change if you want to");
    PlayerInfo[killerid][Cantransform] = 1;
}