forward ConteinerOpen(playerid,count);
public ConteinerOpen(playerid,count)
{
count += GetPVarInt(playerid,"count");
if(GetPVarInt(playerid,"count") == 1)
{
new rand = random(110);
switch(rand)
{
case 0..10:
{
SendClientMessage(playerid, -1, "Вам ничего не выпало");
}
case 11..40:
{
SendClientMessage(playerid, -1, "Вам выпал автомобиль ВАЗ");
global_string = "";
mysql_format(dbHandle, global_string, 500, "\
INSERT INTO `ownable_cars` (c_model, c_x, c_y, c_z, c_a, c_class, c_owner, c_fuel, c_color1, c_color2, c_lock, c_price) VALUES \
('404', '0', '0', '0', '0', '1', '%s', '45', '1', '1', '1', '2000000')",
GetName(playerid));
mysql_tquery(dbHandle, global_string, "", "");
}
case 41..100:
{
SendClientMessage(playerid, -1, "Вам выпал автомобиль Lada Калина");
global_string = "";
mysql_format(dbHandle, global_string, 500, "\
INSERT INTO `ownable_cars` (c_model, c_x, c_y, c_z, c_a, c_class, c_owner, c_fuel, c_color1, c_color2, c_lock, c_price) VALUES \
('411', '0', '0', '0', '0', '1', '%s', '45', '1', '1', '1', '2000000')",
GetName(playerid));
mysql_tquery(dbHandle, global_string, "", "");
}
case 101..105:
{
new rand1 = random(500000) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d рублей", rand1);
SendClientMessage(playerid, -1, textpobeda);
TransferMoney(-1, playerid, rand1);
}
case 106..110:
{
SendClientMessage(playerid, -1, "Вам выпал автомобиль ВАЗ 2109");
global_string = "";
mysql_format(dbHandle, global_string, 500, "\
INSERT INTO `ownable_cars` (c_model, c_x, c_y, c_z, c_a, c_class, c_owner, c_fuel, c_color1, c_color2, c_lock, c_price) VALUES \
('492', '0', '0', '0', '0', '1', '%s', '45', '1', '1', '1', '2000000')",
GetName(playerid));
mysql_tquery(dbHandle, global_string, "", "");
}
}
SendClientMessage(playerid, -1, "Вы открыли контейнер из {008080}России");
}
else if(GetPVarInt(playerid,"count") == 2)
{
new rand = random(220);
switch(rand)
{
case 0..10:
{
SendClientMessage(playerid, -1, "Вам ничего не выпало");
}
case 11..40:
{
GivePlayerWeaponAC(playerid, 27, 1000);
}
case 41..100:
{
GivePlayerWeaponAC(playerid, 33, 1000);
}
case 101..105:
{
new rand1 = random (500000) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d рублей", rand1);
SendClientMessage(playerid, -1, textpobeda);
TransferMoney(-1, playerid, rand1);
}
case 106..140:
{
GivePlayerWeaponAC(playerid, 9, 1);
}
case 141..180:
{
GivePlayerWeaponAC(playerid, 31, 2000);
}
case 181..220:
{
GivePlayerWeaponAC(playerid, 24, 500);
}
}
SendClientMessage(playerid, -1, "Вы открыли контейнер с {008080}Оружием");
}
else if(GetPVarInt(playerid,"count") == 3)
{
new rand = random(110);
switch(rand)
{
case 0..10:
{
SendClientMessage(playerid, -1, "Вам ничего не выпало");
}
case 11..40:
{
SendClientMessage(playerid, -1, "Вам выпал автомобиль BMX X5");
global_string = "";
mysql_format(dbHandle, global_string, 500, "\
INSERT INTO `ownable_cars` (c_model, c_x, c_y, c_z, c_a, c_class, c_owner, c_fuel, c_color1, c_color2, c_lock, c_price) VALUES \
('400', '0', '0', '0', '0', '1', '%s', '45', '1', '1', '1', '2000000')",
GetName(playerid));
mysql_tquery(dbHandle, global_string, "", "");
}
case 41..100:
{
SendClientMessage(playerid, -1, "Вам выпал автомобиль BMW 535i");
global_string = "";
mysql_format(dbHandle, global_string, 500, "\
INSERT INTO `ownable_cars` (c_model, c_x, c_y, c_z, c_a, c_class, c_owner, c_fuel, c_color1, c_color2, c_lock, c_price) VALUES \
('466', '0', '0', '0', '0', '1', '%s', '45', '1', '1', '1', '2000000')",
GetName(playerid));
mysql_tquery(dbHandle, global_string, "", "");
}
case 101..110:
{
new rand1 = random (500000) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d рублей", rand1);
SendClientMessage(playerid, -1, textpobeda);
TransferMoney(-1, playerid, rand1);
}
}
SendClientMessage(playerid, -1, "Вы открыли контейнер из {008080}Германии");
}
else if(GetPVarInt(playerid,"count") == 4)
{
new rand = random(110);
new stringg[128];
switch(rand)
{
case 0..10:
{
SendClientMessage(playerid, -1, "Вам ничего не выпало");
}
case 11..40:
{
new rand1 = random (50) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d "SERVER_COINS"", rand1);
SendClientMessage(playerid, -1, textpobeda);
format(stringg, sizeof(stringg), "UPDATE "T_ACCOUNTS" SET credits=%d WHERE name='%s'", PI[playerid][pElegantCoins]+rand1, GetName(playerid));
mysql_tquery(dbHandle, stringg, "", "");
PI[playerid][pElegantCoins] += rand1;
}
case 41..100:
{
new rand1 = random (100) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d "SERVER_COINS"", rand1);
SendClientMessage(playerid, -1, textpobeda);
format(stringg, sizeof(stringg), "UPDATE "T_ACCOUNTS" SET credits=%d WHERE name='%s'", PI[playerid][pElegantCoins]+rand1, GetName(playerid));
mysql_tquery(dbHandle, stringg, "", "");
PI[playerid][pElegantCoins] += rand1;
}
case 101..108:
{
new rand1 = random (200) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d "SERVER_COINS"", rand1);
SendClientMessage(playerid, -1, textpobeda);
format(stringg, sizeof(stringg), "UPDATE "T_ACCOUNTS" SET credits=%d WHERE name='%s'", PI[playerid][pElegantCoins]+rand1, GetName(playerid));
mysql_tquery(dbHandle, stringg, "", "");
PI[playerid][pElegantCoins] += rand1;
}
case 109..110:
{
new rand1 = random (5000) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d "SERVER_COINS"", rand1);
SendClientMessage(playerid, -1, textpobeda);
format(stringg, sizeof(stringg), "UPDATE "T_ACCOUNTS" SET credits=%d WHERE name='%s'", PI[playerid][pElegantCoins]+rand1, GetName(playerid));
mysql_tquery(dbHandle, stringg, "", "");
PI[playerid][pElegantCoins] += rand1;
}
}
SendClientMessage(playerid, -1, "Вы открыли контейнер с {008080}"SERVER_COINS"");
}
else if(GetPVarInt(playerid,"count") == 5)
{
new rand = random(110);
switch(rand)
{
case 0..10:
{
SendClientMessage(playerid, -1, "Вам ничего не выпало");
}
case 11..40:
{
new rand1 = random (7000000) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d рублей", rand1);
SendClientMessage(playerid, -1, textpobeda);
TransferMoney(-1, playerid, rand1);
}
case 41..100:
{
new rand1 = random (5000000) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d рублей", rand1);
SendClientMessage(playerid, -1, textpobeda);
TransferMoney(-1, playerid, rand1);
}
case 101..105:
{
new rand1 = random (50000) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d рублей", rand1);
SendClientMessage(playerid, -1, textpobeda);
TransferMoney(-1, playerid, rand1);
}
case 106..110:
{
new rand1 = random (10000000) + 1;
new textpobeda[128];
format(textpobeda, sizeof(textpobeda), "Вам выпало %d рублей", rand1);
SendClientMessage(playerid, -1, textpobeda);
TransferMoney(-1, playerid, rand1);
}
}
SendClientMessage(playerid, -1, "Вы открыли контейнер с {008080}Деньгами");
}
else if(GetPVarInt(playerid,"count") == 6)
{
new rand = random(110);
switch(rand)
{
case 0..10:
{
SendClientMessage(playerid, -1, "Вам ничего не выпало");
}
case 11..40:
{
SendClientMessage(playerid, -1, "Вам выпал автомобиль 1");
global_string = "";
mysql_format(dbHandle, global_string, 500, "\
INSERT INTO `ownable_cars` (c_model, c_x, c_y, c_z, c_a, c_class, c_owner, c_fuel, c_color1, c_color2, c_lock, c_price) VALUES \
('434', '0', '0', '0', '0', '1', '%s', '45', '1', '1', '1', '2000000')",
GetName(playerid));
mysql_tquery(dbHandle, global_string, "", "");
}
case 41..100:
{
SendClientMessage(playerid, -1, "Вам выпал автомобиль 2");
global_string = "";
mysql_format(dbHandle, global_string, 500, "\
INSERT INTO `ownable_cars` (c_model, c_x, c_y, c_z, c_a, c_class, c_owner, c_fuel, c_color1, c_color2, c_lock, c_price) VALUES \
('451', '0', '0', '0', '0', '1', '%s', '45', '1', '1', '1', '2000000')",
GetName(playerid));
mysql_tquery(dbHandle, global_string, "", "");
}
case 101..105:
{
SendClientMessage(playerid, -1, "Вам выпал автомобиль 3");
global_string = "";
mysql_format(dbHandle, global_string, 500, "\
INSERT INTO `ownable_cars` (c_model, c_x, c_y, c_z, c_a, c_class, c_owner, c_fuel, c_color1, c_color2, c_lock, c_price) VALUES \
('494', '0', '0', '0', '0', '1', '%s', '45', '1', '1', '1', '2000000')",
GetName(playerid));
mysql_tquery(dbHandle, global_string, "", "");
}
}
SendClientMessage(playerid, -1, "Вы открыли контейнер из {008080}России");
}
}