21.09.2014, 07:35
Best SetHealth Command :
pawn Код:
new string[128],ID,Float:Heal,Pname[MAX_PLAYER_NAME],Iname[MAX_PLAYER_NAME];
GetPlayerName(playerid,Pname,sizeof(Pname));
GetPlayerName(ID,Iname,sizeof(Iname));
if(sscanf(params, "ud", ID,Heal))
{
SendClientMessage(playerid,-1,"USAGE: /SetHealth (Player Name/ID) (Health)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The Player ID (%d) is not connected to the server. You cannot heal them.",ID);
SendClientMessage(playerid,-1,string);
return 1;
}
SetPlayerHealth(playerid,heal);
format(string,sizeof(string),"You Have Set %s(%d) Health To %d",Iname,ID,Heal);
SendClientMessage(playerid,-1,string);
format(string,sizeof(string),"%s(%d) Has Set Your Health To %d",Pname,playerid,Heal);
SendClientMessage(ID,-1,string);