Vicente_Ramirez
Умник
Здравствуйте форумчане, помогите пожалуйста с командой /fight смысл команды, вызывать другого игрока на поединок. А я бы хотел еще что бы при вводе команды нужно было указывать не только id желаемого соперника но и сумму (ставку). Ну думаю все поняли, если игрок ввел к примеру /fight [id] [5000] то ставка получится 5000вирт и проигравший игрок теряет эти 5к вирт, а победитель получает их.
За помощь с меня естественно +
Вот сама команда?:
За помощь с меня естественно +
За помощь с меня естественно +
Вот сама команда?:
PHP:
if(strcmp(cmd, "/fight", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(InRing > 0)return SendClientMessage(playerid, COLOR_GREY, "Вы уже приняли бой!");
if(PlayerBoxing[playerid] > 0)return SendClientMessage(playerid, COLOR_GREY, "Вы уже боксируете");
if(!PlayerToPoint(20.0,playerid,765.9343,0.2761,1000.7173))return SendClientMessage(playerid, COLOR_GREY, "Вы не в спортзале!");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "{FFA500}Введите{FFFFFF}: /fight [id]");
return true;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Вы неможете вызвать на бой самого себя!"); return true; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Вы предложили бой %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " %s предлагает вам бой (/use fight) чтобы принять.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
BoxOffer[giveplayerid] = playerid;
}
else return SendClientMessage(playerid, COLOR_GREY, "Игрок не около Вас!");
}
}
else return SendClientMessage(playerid, COLOR_GREY, "Игрок оффлайн!");
}
return true;
}
