Reviving
#4

This should work
Код:
CMD:revive(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1)
	{
		SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
		return 1;
	}
	new toplayerid;
	if(!sscanf(params, "u", toplayerid))
	{
		if(IsPlayerConnected(toplayerid))
		{
		    if(toplayerid != INVALID_PLAYER_ID)
			{
		        if(PlayerJustDied[toplayerid] == 1)
				{
	                if(PlayerCalledEMS[playerid] == 0)
					{
     	    			KillTimer(DeathTimer(toplayerid));
	                    SetPlayerHealth(toplayerid, 100);
						SetPlayerArmour(toplayerid, 0);
						ClearAnimations(toplayerid);
						PlayerJustDied[toplayerid] = 0;
	     				TextDrawHideForPlayer(toplayerid, Text:DieText);
		       	 		TextDrawHideForPlayer(toplayerid, Text:InjuredText);
						SendClientMessage(toplayerid, COLOR_WHITE, "   Revived by admin !");
						format(string, sizeof(string), "{FF0000}AdmWarning{FFFFFF}: %s has revived %s.",PlayerRPName(playerid),PlayerRPName(toplayerid));
						ABroadCast(COLOR_WHITE,string,1);
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GRAD1, "   The player is awaiting a paramedic !");
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GRAD1, "   Player is not injured !");
				}
		    }
		}
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "USAGE: '/revive [playerid/PartOfName]'");
	}
	return 1;
}
Reply


Messages In This Thread
Reviving - by xdarren - 16.10.2013, 14:55
Re: Reviving - by xdarren - 16.10.2013, 16:21
Re: Reviving - by xdarren - 16.10.2013, 19:44
Re: Reviving - by DStreet - 16.10.2013, 20:16
Re: Reviving - by xdarren - 16.10.2013, 21:07
Re: Reviving - by xdarren - 16.10.2013, 21:21

Forum Jump:


Users browsing this thread: 1 Guest(s)