Jump to content

[REZOLVAT] Problema comanda /areaheal


fkbarca
 Share

Recommended Posts

  • Administrator

Stock

stock GetName(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof name);
	return name;
}

Comanda

YCMD:areaheal(playerid, params[], help)
{
	if(PlayerData[playerid][Admin] < 4) return SendClientMessage(playerid, COLOR_WHITE, AdminOnly);

	new range;
	if(sscanf(params, "d", range)) return SendClientMessage(playerid,COLOR_WHITE, "/areaheal <range>");

	new Float: pos[3], string[128];
	GetPlayerPos(playerid, pos[0], pos[1], pos[2]);

	foreach(new jucator : Player)
	{
		if(IsPlayerInRangeOfPoint(jucator, range, x, y, z))
		{
			SetPlayerHealth(jucator, 100.0);

            format(string, sizeof string, "AdmBot: Toti jucatorii aflati in regiunea de %d metri, au primit heal de la admin-ul %s.", range, GetName(playerid));
            SendClientMessage(jucator, COLOR_NEWS, string);			
		}
	}
	
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...