Дак об этом никто и не забыл.
PHP код:
case D_ROULE:
{
if(response)
{
new bet, tableid = RouleTable[playerid];
if(ChooseBet[playerid] == 1) return SendClientMessage(playerid, COLOR_SILVER, "Âû óæå ñäåëàëè ñòàâêó");
if(StartRoule[tableid] == 1) return SendClientMessage(playerid, COLOR_SILVER, "Äîæäèòåñü îêàí÷àíèÿ èãðû");
{
new message[64], limit[2], dialog[128];
switch(tableid)
{
case 0,4,9: limit[0] = 5000000, limit[1] = 10000000;
case 1,5,8: limit[0] = 5000000, limit[1] = 10000000;
case 2,6,11: limit[0] = 1000000, limit[1] = 5000000;
case 3,7,10: limit[0] = 500000, limit[1] = 1000000;
}
format(message, sizeof(message), "Ìèíèìàëüíàÿ ñóìà %d âèðò, ìàêñèìàëüíàÿ - %d âèðò", limit[0], limit[1]);
format(dialog, sizeof(dialog), "{FFFFFF}Ââåäèòå âàøó ñòàâêó:\n{04B404}Ïðèìå÷àíèå: ìèíèìàëüíàÿ ñóìà %d âèðò, ìàêñèìàëüíàÿ - %d âèðò", limit[0], limit[1]);
if(sscanf(inputtext, "d", bet)) return ShowPlayerDialog(playerid, D_ROULE, DIALOG_STYLE_INPUT, "Ñòàâêà", dialog, "Äàëåå", "Îòìåíà");
if(bet < limit[0] || bet > limit[1]) return SendClientMessage(playerid, COLOR_SILVER, message);
if(PlayerInfo[playerid][pCash] < bet) return SendClientMessage(playerid, COLOR_SILVER, "Ó âàñ íåäîñòàòî÷íî äåíåã");
{
new str[12];
ChooseBet[playerid] = 1;
RouleBet[playerid] = bet;
PlayerInfo[playerid][pCash] -= bet;
DestroyDynamicObject(RouleChip[playerid]);
strmid(RouleNumber[playerid], GetRouleNumber(playerid), 0, strlen(GetRouleNumber(playerid)), sizeof(RouleNumber[]));
TextDrawSetString(RouleNumberShow[tableid][RouleGamer[playerid]], RouleNumber[playerid]);
format(str, sizeof(str), "~g~%d$", bet);
TextDrawSetString(RouleBetShow[tableid][RouleGamer[playerid]], str);
SendClientMessage(playerid, 0x74A402AA, "Âàøà ñòàâêà ïðèíÿòà");
switch(Casino[playerid])
{
case 1:
{
RouleChip[playerid] = CreateDynamicObject(1930, RouleTables[tableid][0]+RouleVertikalCoords[RouleVertikal[playerid]][0], RouleTables[tableid][1]+RouleHorizontCoords[RouleHorizont[playerid]][0], 992.335, 0.0, 0.0, 0.0);
}
case 2:
{
RouleChip[playerid] = CreateDynamicObject(1930, RouleTables[tableid][0]-RouleHorizontCoords[RouleHorizont[playerid]][0], RouleTables[tableid][1]+RouleVertikalCoords[RouleVertikal[playerid]][0], 1006.06, 0.0, 0.0, 0.0);
}
}
}
}
}
else return true;
}
PHP код:
forward EndRoule(tableid);
public EndRoule(tableid)
{
new rand = random(37), str[8], message[64], line[14];
valstr(line, rand);
format(str, sizeof(str), "%s%d", GetNumberColor(rand), rand);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
{
if(RouleTable[i] == tableid || CroupierTable[i] == tableid)
{
GameTextForPlayer(i, str, 3000, 6);
if(ChooseBet[i] == 1)
{
ChooseBet[i] = 0;
DestroyDynamicObject(RouleChip[i]);
switch(Casino[i])
{
case 1:
{
RouleChip[i] = CreateDynamicObject(1900, RouleTables[tableid][0]+RouleVertikalCoords[RouleVertikal[i]][0], RouleTables[tableid][1]+RouleHorizontCoords[RouleHorizont[i]][0], 992.335, 0.0, 0.0, 0.0);
}
case 2:
{
RouleChip[i] = CreateDynamicObject(1900, RouleTables[tableid][0]-RouleHorizontCoords[RouleHorizont[i]][0], RouleTables[tableid][1]+RouleVertikalCoords[RouleVertikal[i]][0], 1006.06, 0.0, 0.0, 0.0);
}
}
if(strfind(RouleNumber[i], "1-12", false) != -1)
{
switch(rand)
{
case 1..12:
{
PlayerInfo[i][pCash] += RouleBet[i]*3;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*3);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else if(strfind(RouleNumber[i], "2-12", false) != -1)
{
switch(rand)
{
case 13..24:
{
PlayerInfo[i][pCash] += RouleBet[i]*3;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*3);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else if(strfind(RouleNumber[i], "3-12", false) != -1)
{
switch(rand)
{
case 25..36:
{
PlayerInfo[i][pCash] += RouleBet[i]*3;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*3);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else if(strfind(RouleNumber[i], "1-18", false) != -1)
{
switch(rand)
{
case 1..18:
{
PlayerInfo[i][pCash] += RouleBet[i]*2;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*2);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else if(strfind(RouleNumber[i], "19-36", false) != -1)
{
switch(rand)
{
case 19..36:
{
PlayerInfo[i][pCash] += RouleBet[i]*2;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*2);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else if(strfind(RouleNumber[i], "Red", false) != -1)
{
switch(rand)
{
case 1,3,5,7,9,12,14,16,18,19,21,23,25,27,30,32,34,36:
{
PlayerInfo[i][pCash] += RouleBet[i]*2;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*2);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else if(strfind(RouleNumber[i], "Black", false) != -1)
{
switch(rand)
{
case 2,4,6,8,10,11,13,15,17,20,22,24,26,28,29,31,33,35:
{
PlayerInfo[i][pCash] += RouleBet[i]*2;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*2);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else if(strfind(RouleNumber[i], "Even", false) != -1)
{
switch(rand)
{
case 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36:
{
PlayerInfo[i][pCash] += RouleBet[i]*2;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*2);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else if(strfind(RouleNumber[i], "Odd", false) != -1)
{
switch(rand)
{
case 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35:
{
PlayerInfo[i][pCash] += RouleBet[i]*2;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*2);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else if(strfind(RouleNumber[i], "3-1", false) != -1)
{
switch(rand)
{
case 1,4,7,10,13,16,19,22,25,28,31,34:
{
if(RouleVertikal[i] == 2)
{
PlayerInfo[i][pCash] += RouleBet[i]*3;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*3);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
case 2,5,8,11,14,17,20,23,26,29,32,35:
{
if(RouleVertikal[i] == 4)
{
PlayerInfo[i][pCash] += RouleBet[i]*3;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*3);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
case 3,6,9,12,15,18,21,24,27,30,33,36:
{
if(RouleVertikal[i] == 6)
{
PlayerInfo[i][pCash] += RouleBet[i]*3;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*3);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
}
else if(strlen(RouleNumber[i]) >= 3 && strlen(RouleNumber[i]) <= 6)
{
new d = strfind(RouleNumber[i], line, false);
if(d != -1)
{
strmid(RouleNumber[i], RouleNumber[i], d-1, d+2, strlen(RouleNumber[i]));
for(new a = 0; a < 2; a++)
{
d = strfind(RouleNumber[i], ",", false);
if(d != -1)
{
strdel(RouleNumber[i], d, d+1);
}
}
if(strlen(RouleNumber[i]) == strlen(line))
{
PlayerInfo[i][pCash] += RouleBet[i]*9;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*9);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else if(strlen(RouleNumber[i]) >= 7 && strlen(RouleNumber[i]) <= 12)
{
new d = strfind(RouleNumber[i], line, false);
if(d != -1)
{
strmid(RouleNumber[i], RouleNumber[i], d-1, d+2, strlen(RouleNumber[i]));
for(new a = 0; a < 2; a++)
{
d = strfind(RouleNumber[i], ",", false);
if(d != -1)
{
strdel(RouleNumber[i], d, d+1);
}
}
if(strlen(RouleNumber[i]) == strlen(line))
{
PlayerInfo[i][pCash] += RouleBet[i]*5;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*5);
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
}
else
{
if(strcmp(RouleNumber[i], line, false, strlen(RouleNumber[i])) == 0)
{
if(rand != 0)
{
PlayerInfo[i][pCash] += RouleBet[i]*10;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*10);
SendClientMessage(i, COLOR_ORANGE, message);
}
else
{
PlayerInfo[i][pCash] += RouleBet[i]*11;
format(message, sizeof(message), "Âûïàëî %d. Ïîçäðàâëÿåì! Âû âûèãðàëè %d âèðò", rand, RouleBet[i]*11);
}
SendClientMessage(i, COLOR_ORANGE, message);
continue;
}
}
format(message, sizeof(message), "Âûïàëî %d. Ê ñîæàëåíèþ, âàøà ñòàâêà ïðîèãðàíà", rand);
SendClientMessage(i, COLOR_RED, message);
}
}
if(GetPlayerNearestRouleTable(i) == -1)
{
OnPlayerExitRouleTable(i, tableid);
}
}
}
StartRoule[tableid] = 0;
for(new i = 0; i < 5; i++)
{
TextDrawSetString(RouleNumberShow[tableid][i], "-------");
TextDrawSetString(RouleBetShow[tableid][i], "-------");
}
return true;
}