if(strcmp(cmd, "/hitman", true) == 0) {
new tmp[256];
tmp = strtok(cmdtext, idx); if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Команда /hitman [id игрока] [количество]");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Команда /hitman [id игрока] [количество]");
return 1;
}
moneys = strval(tmp);
if(moneys > GetPlayerMoney(playerid)) {
SendClientMessage(playerid, COLOR_RED, "Вы не имеете достаточного количества денег!");
return 1;
}
if(moneys < 1) {
SendClientMessage(playerid, COLOR_YELLOW, "Эй, что является Вами пробующий тянуть здесь.");
return 1;
}
if(IsPlayerConnected(giveplayerid)==0) {
SendClientMessage(playerid, COLOR_RED, "Никакой такой игрок не существует.");
return 1;
}
bounty[giveplayerid]+=moneys;
GivePlayerMoney(playerid, 0-moneys);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s has had a $%d bounty put on his head from %s (total: $%d).", giveplayer, moneys, sendername, bounty[giveplayerid]);
SendClientMessageToAll(COLOR_ORANGE, string);
format(string, sizeof(string), "You have had a $%d bounty put on you from %s (id: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_RED, string);
return 1;
}