21.06.2010, 13:32
Hello, I'm almost finished with my /heal command, but the only thing I must fix is that only players in a specific range of the player should be able to heal the player. How do I do it?
pawn Код:
if(strcmp(cmd, "/heal", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "/heal ID");
return 1;
}
new playa;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(HealInfo[playerid][pHealkit] == 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
HealInfo[playerid][pHeal] = 0;
SetPlayerHealth(playa, 100);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command");
}
}
return 1;
}