22.12.2014, 21:09
all code 

PHP код:
CMD:sethp(playerid, params[])
{
if(PlayerInfo[playerid][pRank] == 2.6)
new string[128],targetid,Float:Heal,Pname[MAX_PLAYER_NAME],Iname[MAX_PLAYER_NAME];
GetPlayerName(playerid,Pname,sizeof(Pname));
GetPlayerName(targetid,Iname,sizeof(Iname));
if(sscanf(params, "ud", targetid,Heal))
{
SendClientMessage(playerid,-1,"USAGE: /SetHealth (Player Name/ID) (Health)");
return 1;
}
if(!IsPlayerConnected(targetid))
{
format(string,sizeof(string),"The Player ID (%d) is not connected to the server. You cannot heal them.",targetid);
SendClientMessage(playerid,-1,string);
return 1;
}
SetPlayerHealth(playerid,Heal);
format(string,sizeof(string),"You Have Set %s(%d) Health To %d",Iname,targetid,Heal);
SendClientMessage(playerid,-1,string);
format(string,sizeof(string),"%s(%d) Has Set Your Health To %d",Pname,playerid,Heal);
SendClientMessage(targetid,-1,string);
SetPlayerHealth(targetid, health);
}
return 1;
}