29.08.2012, 14:05
(
Последний раз редактировалось _Khaled_; 29.08.2012 в 14:43.
)
Okay
If you need definitions, let me know
pawn Код:
CMD:heal(playerid,params[])
{
#pragma unused params
new string[128];
new pname[MAX_PLAYER_NAME];
new id;
if(sscanf(params, "u", id))
{
SendClientMessage(playerid,COLOR_ERROR,"Usage: /heal (Player Name/ID)");
return 1;
}
new Float:phealth;
GetPlayerHealth(id,phealth);
/*if(IsFrozen[playerid] == 1)
{
SendClientMessage(playerid,COLOR_RED,"You cannot use this command while you're frozen.");
return 1;
}*/
if(gTeam[playerid] != TEAM_MEDIC)
{
SendClientMessage(playerid,COLOR_RED,"Only medics can heal other players.");
return 1;
}
if(!IsPlayerConnected(id))
{
format(string,sizeof(string),"The Player is not connected to the server.");
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
if(id == playerid)
{
SendClientMessage(playerid,COLOR_RED,"You cannot heal yourself with this command. use /healme");
return 1;
}
/*if(GetDistanceBetweenPlayers(playerid,id) > 6)
{
format(string,sizeof(string),"%s(%d) is not close enough to heal them.",pname,id);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}*/
if(phealth == 100)
{
SendClientMessage(playerid,COLOR_RED,"Their health is already full. You don't need to heal them.");
return 1;
}
/*if(GetPlayerMoney(id) < SkillPrice[playerid])
{
SendClientMessage(playerid,COLOR_RED,"That player does not have enough money on them to pay your price.");
return 1;
}*/
format(string,sizeof(string),"You have healed %s(%d) for a price of $%d. Make sure they are happy.",pname,id,SkillPrice[playerid]);
SendClientMessage(playerid,COLOR_PURPLE,string);
GivePlayerMoney(playerid,SkillPrice[playerid]);
format(string,sizeof(string),"You have been healed by %s(%d) for a price of $%d.",pname,playerid,SkillPrice[playerid]);
SendClientMessage(id,COLOR_PURPLE,string);
GivePlayerMoney(id,-SkillPrice[playerid]);
SetPlayerHealth(id,100);
//CalledForMedic[I] =0;
//format(string,sizeof(string),"3[MEDIC ACTION] %s(%d) has restored %s(%d)'s health by using /heal.",PlayerName(playerid),playerid,PlayerName(ID),ID);
//IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}