CheckplayerHealth(playerid, 100); SetPlayerHealth(giveplayerid, 100);
if(strcmp(cmd, "/Heal", true) == 0) { if(Medic(playerid)) { new tmpcar = GetPlayerVehicleID(playerid); if(MedicCar(tmpcar)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SCM(playerid, COLOR_WHITE, "USAGE: /Heal <Player ID>"); return 1; } new giveplayerid = ReturnUser(tmp); if(giveplayerid == playerid) { SCM(playerid, COLOR_RED, "MAIN ERROR(You can't heal yourself!)"); return 1; } if(IsPlayerConnected(giveplayerid)) { if(tmpcar == GetPlayerVehicleID(giveplayerid)) { GetPlayerName(playerid, UserName, sizeof(UserName)); GetPlayerName(giveplayerid, UserName2, sizeof(UserName2)); SetPlayerHealth(giveplayerid, 100); format(Text, sizeof(Text), "** You got healed by medic %s! **", UserName); SCM(giveplayerid, COLOR_GREEN, Text); format(Text, sizeof(Text), "** You healed %s and earned $750! **", UserName2); SCM(playerid, COLOR_GREEN, Text); GivePlayerMoney(playerid, 750); } else{SCM(playerid, COLOR_RED, "MAIN ERROR(That person isn't in you'r ambulance!)");} } else{SCM(playerid, COLOR_RED, "MAIN ERROR(That player is offline!)");} } else{SCM(playerid, COLOR_RED, "MAIN ERROR(You are not in an ambulance!)");} } else{SCM(playerid, COLOR_RED, "MAIN ERROR(You are not a medic)");} return 1; }
new Float:health;
GetPlayerHealth(giveplayerid,health);
if(health >= 100.0)
{
SendClientMessage(playerid, COLOR_GREY,"That person is fully healed.");
return 1;
}
Originally Posted by chosen
pawn Код:
|
SetPlayerHealth(giveplayerid, 100);
Originally Posted by chosen
Put it above this line
pawn Код:
|