I name Alex
Умник
Помогите пожалуйста, команда вылечить медику /heal не работает, то не тому даёт хп, то не у того забирает деньги.
PHP:
CMD:heal(playerid, params[])
{
if(player_info[playerid][pMember] == 4 || player_info[playerid][pMember] == 21)
{
if(!IsPlayerInRangeOfPoint(playerid, 40.0, -1649.0573, 2108.2302, 1503.3860) && !IsPlayerInRangeOfPoint(playerid, 40.0, 2472.7354,-2153.8464,634.2466)) return SendClientMessage(playerid, 0xFFFF00AA, "Вы должны находиться в больнице.");
{
if(GetPVarInt(playerid,"heal") > gettime()) return SendClientMessage(playerid, 0x007FFFFF, "Следующее предложение вы сможете отправить через 10 секунд!");
if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, COLOR_WHITE, "Введите: /heal [id игрока]");
if(params[0] == playerid) return SendClientMessage(playerid, COLOR_WHITE, "Вы не можете вылечить самого себя!");
if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_WHITE, "Неверный ID игрока"); new string[150];
format(string, sizeof(string), "Вы предложили %s [%d] вылечиться!", player_info[params[0]][pName], params[0]);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{FFFFFF}Мед. работник %s хочет вылечить Вас за 200 рублей.\nВы согласны?", player_info[playerid][pName]);
ShowPlayerDialog(params[0], 17000, DIALOG_STYLE_MSGBOX, " ", string, "»", "«");
SetPVarInt(playerid, "bheal", params[0]);
SetPVarInt(playerid, "pheal", playerid);
}
}
return true;
}
case 17000:
{
//if(response)
if(!response) return DeletePVar(playerid, "bheal"), DeletePVar(playerid, "pheal");
{
TransferMoney(GetPVarInt(playerid, "pheal"), -1, 200);
TransferMoney(-1, GetPVarInt(playerid, "bheal"), 200);
GameTextForPlayer(GetPVarInt(playerid, "bheal"), "~r~-200 PYЂ‡E…", 0, 3);
player_info[GetPVarInt(playerid, "bheal")][pHeal] = 100;
player_info[GetPVarInt(playerid, "bheal")][pHealthS] = 100;
SetHealth(GetPVarInt(playerid, "bheal"), 100);
new string[150], str[150];
format(string, sizeof(string), "Вы вылечили %s [%d].", player_info[GetPVarInt(playerid, "bheal")][pName], GetPVarInt(playerid, "bheal"));
SendClientMessage(GetPVarInt(playerid, "pheal"), -1, string);
format(str, sizeof(str), "Мед. работник %s [%d] вылечил пациента %s [%d].", player_info[GetPVarInt(playerid, "pheal")][pName], GetPVarInt(playerid, "pheal"), player_info[GetPVarInt(playerid, "bheal")][pName], GetPVarInt(playerid, "bheal"));
SendFMes(player_info[GetPVarInt(playerid, "pheal")][pMember], GetTeamID(GetPVarInt(playerid, "pheal")), str);
}
}
