09.05.2010, 23:29
pawn Код:
if(strcmp(cmd, "/bite", true) ==0)
{
if(team[playerid] != 2)
{
SendClientMessage(playerid, COLOR_YELLOW, "You dont want to bite people, you are Human.");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /bite [playerid]");
return 1;
}
if(!IsNumeric(tmp)) target = ReturnPlayerID(tmp); else target = strval(tmp);
if(GetDistanceBetweenPlayers(playerid,target) > 2)
{
SendClientMessage(playerid, COLOR_YELLOW, "Target is to far away.");
return 1;
}
GetPlayerName(target, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(team[playerid] == 2)
{
new Float:hp;
if(team[target] == 1 || team[target] <= 2) return SendClientMessage(playerid,COLOR_RED,"That player is not a human.");
format(string, sizeof(string), "You were infected by %s.", sendername);
SendClientMessage(target, COLOR_RED, string);
format(string, sizeof(string), "You infected %s.", giveplayer);
SendClientMessage(playerid, COLOR_GREEN, string);
GameTextForPlayer(target, "Infected!", 2500, 3);
SendClientMessage(target, COLOR_RED, "You have been infected! Get to the hospital for the antidote! ");
SendClientMessage(target, COLOR_YELLOW, "Reach the red checkpoint before you die and become a zombie. ");
SetPlayerCheckpoint(target, 1606.983154, 1822.565551, 10.820312, 8.0);
infected[target] = 1;
GetPlayerHealth(target,hp);
SetPlayerHealth(playerid, 100);
GameTextForPlayer(target, "~r~YOU ARE INFECTED!!!", 2500, 3);
GameTextForPlayer(playerid, "~g~BITE (HEAL)!", 2500, 3);
}
return 1;
}