Косой_Карлик
Умник
хочу сделать команду чтобы /dice1 работаел так типа, я подхожу к столу и прописываю /dice 301 и сумму и играю в кости с ботом, но че то не работает вообще я помоему не правильно ставлю проверки или вообще не так делаю как можно сделать /dice 301 и ставку от 100000 до 5000000 помогите пожалуйста
Код:
CMD:dice1(playerid, params[])
{
new price_dice;
if(sscanf(params, "ii", 301, price_dice))
return SendClientMessage(playerid, -1, !"Используйте: /dice [ID] [Ставка]");
if(!(1 <= price_dice <= 5000000))
return SendClientMessage(playerid, COLOR_GREY, !"Ошибка: Сумма ставки от 1 до 5 000 000.");
if(301 == playerid)
return SendClientMessage(playerid, COLOR_GREY, !"Ошибка: ID Указан не верно.");
new
dice_one = (random(6) + 1),
dice_two = (random(6) + 1),
string[110]
;
corr(string, "тест и %s бросили кости. Результат: {CC9900}%i:%i",PlayerInfo[playerid][pNames], dice_one, dice_two);
ProxDetector(playerid, 20.0, COLOR_PURPLE, string);
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 4500, 1);
SetTimerEx("KostiTime", 4500, false, "i", playerid);
PlayerPlaySound(playerid, 33401, 0.0, 0.0, 0.0);
switch(dice_two)
{
case 1: SetPlayerAttachedObject(playerid, 1, 1851, 1, 0.062400, 0.453750, 0.000000, 360.0000, 90.0000, 0.0000);
case 2: SetPlayerAttachedObject(playerid, 1, 1851, 1, 0.062400, 0.453750, 0.000000, 360.0000, 180.0000, 0.0000);
case 3: SetPlayerAttachedObject(playerid, 1, 1851, 1, 0.062400, 0.453750, 0.000000, 360.0000, 360.0000, 90.0000);
case 4: SetPlayerAttachedObject(playerid, 1, 1851, 1, 0.062400, 0.453750, 0.000000, 360.0000, 360.0000, 270.0000);
case 5: SetPlayerAttachedObject(playerid, 1, 1851, 1, 0.062400, 0.453750, 0.000000, 360.0000, 360.0000, 0.0000);
case 6: SetPlayerAttachedObject(playerid, 1, 1851, 1, 0.062400, 0.453750, 0.000000, 360.0000, 270.0000, 0.0000);
}
if(dice_one > dice_two)
{
SendMes(playerid, 0xFF6600AA, "К сожалению, Вы проиграли!");
}
else if(dice_one < dice_two)
{
GiveMoney(playerid, price_dice);
SendMes(playerid, 0x63cb00FF, "Поздравляем, Вы выиграли!");
}
else
{
SendMes(playerid, COLOR_ORANGE, "Игра закончилась в ничью!");
}
corr(string, "Выпало: %i", dice_two);
SetPlayerChatBubble(playerid, string, 0xFF9900AA, 20.0, 3000);
return 1;
}
