/bite command
#5

Код:
CMD:bite(playerid, cmdtext[])
{
	new TargetID, Float:pos[3];
	GetPlayerPos(TargetID, pos[0], pos[1], pos[2]);
	if(IsPlayerInRangeOfPoint(playerid, 5, pos[0], pos[1], pos[2])) {
		new str[185], name[MAX_PLAYER_NAME];
		GetPlayerName(playerid, name, MAX_PLAYER_NAME);
		format(str, 184, "%s Has bitten you!, and have just started pouring your blood!", name);
		SetPlayerHealth(TargetID, -10);
		SetTimerEx("LessBlood", (1000*60)*1, true, "d", TargetID);
		SetPVarInt(TargetID, "Injured", 1);
	}
	else SendClientMessage(playerid, -1, "You are not near to any one");
	return 1;
}

forward LessBlood(playerid);
public LessBlood(playerid)
{
	if(GetPVarInt(playerid, "Injured"))
	{
		SetPlayerHealth(playerid, -20);
	}
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	if(GetPVarInt(playerid, "Injured"))
	{
		DeletePVar(playerid, "Injured");
	}
	return 1;
}
hope it works with you : D
Reply


Messages In This Thread
/bite command - by Dare Devil..... - 21.07.2012, 18:25
Re: /bite command - by thefatshizms - 21.07.2012, 18:27
Re: /bite command - by SuperViper - 21.07.2012, 19:44
Re: /bite command - by [A]ndrei - 21.07.2012, 19:47
Re: /bite command - by Youice - 21.07.2012, 20:18

Forum Jump:


Users browsing this thread: 1 Guest(s)