Need Help Please
#1

CMD:heal(playerid, params[])
{
if(gClass[playerid] == MEDIC)
{
new Float:HP;
GetPlayerHealth(playerid, HP);
SendClientMessage(playerid, red, "USAGE: /heal [playerid]");
new string[100]; format(string, sizeof(string),"%s has healed with 25.00 HP and Recieved 3000$ For it ", PlayerName2(playerid) );
if(HP >= 75) { SetPlayerHealth(playerid, 100.0); } else { SetPlayerHealth(playerid, HP + 25.0); }
Block_CMD[playerid][9] = true;
SetTimerEx("EnableCMD",120000,false,"dd",playerid, 9);
}
else return SendClientMessage(playerid,red,"ERROR: You have to wait 2 minutes!");
GivePlayerMoney(playerid, 3000);
return 1;
}

hello bro , can you help me please , I want to create command , for medic class ability /heal <id> = heal 25 health and get 3000 money, only heal teammate and you cant heal your self
sorry for my bad english
thanks bro
Reply
#2

this is not the we script for you section
Reply
#3

PHP код:
CMD:heal(playeridparams[])
{
  if(
gClass[playerid] == MEDIC)
  {
  new 
Float:HP;
  new 
id;
  if(
sscanf(params,"u",id)) return SendClientMessage(playeridred"USAGE: /heal [playerid]");
  if(
id == playerid) return SendClientMessage(playerid,   red"You can't perform it on yourself.");
  
GetPlayerHealth(playeridHP);
  new 
string[100]; 
  
format(stringsizeof(string),"%s has healed with 25.00 HP and Recieved 3000$ For it "PlayerName2(playerid) );
  If(
HP >= 75
  { 
  
SetPlayerHealth(id100.0); 
  } 
  else 
  { 
  
SetPlayerHealth(idHP 25.0); 
  }
  
Block_CMD[playerid][9] = true;
  
SetTimerEx("EnableCMD",120000,false,"dd",playerid9);
  }
  else return 
SendClientMessage(playerid,red,"ERROR: You have to wait 2 minutes!");
  
GivePlayerMoney(playerid3000);
  return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)