Вопросы

Admin1
Новичок
Спойлер

case D_CONT1:
	{
		if(!response) return 1;
		new cena = 700000;
		if(PI[playerid][pCash] < cena) return SendClientMessage(playerid, -1, "Тут слова.");
  		MysqlUpdatePlayerInt(playerid, "cash",PI[playerid][pCash]);
		ConteinerOpen(playerid,1);  //Ошибка тут(помогите плез)
		PI[playerid][pCash] -= cena;
		new string[50];
		format(string, 50, "%d", PI[playerid][pCash]);
		PlayerTextDrawSetString(playerid, PTD_CASH[playerid][10], string);
	}


вот stock
stock ConteinerOpen(playerid,cont)
{
    if(cont == 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}Ðîññèè");
    }
    if(cont == 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}Îðóæèåì");
    }
    if(cont == 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}Ãåðìàíèè");
    }
    if(cont == 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"");
    }
    if(cont == 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}Äåíüãàìè");
    }
    if(cont == 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}Ðîññèè");
    }
}

 

Помогите плеез

 

Заметка от Cawfee , создано

Пожалуйста, ознакомьтесь с информацией о том, как правильно публиковать код.

Поделиться сообщением


Ссылка на сообщение

3 ответа на этот вопрос

  • 0
Admin1
Новичок

@SCRIPTMAN

Спойлер

stock MysqlUpdatePlayerInt(playerid, field[], data)
{
    new Query[128];
    format(Query, sizeof(Query), "UPDATE "T_ACCOUNTS" SET %s = '%i' WHERE id = '%i' LIMIT 1", field, data, PI[playerid][pID]);
    return mysql_tquery(dbHandle, Query, "", "");
}

 

 

Отредактировано пользователем odosenok
Причина: заключил код в теги "Код" и "Спойлер".

Заметка от Cawfee , создано

Пожалуйста, ознакомьтесь с информацией о том, как правильно публиковать код.

Поделиться сообщением


Ссылка на сообщение
  • 0
Cawfee
Великий Гуру

@Admin1, попробуйте закомментировать весь D_CONT1 внутри switch. Ошибка сохраняется? И да, может прозвучит глупо, но Вы точно сохраняете файл после редактирования перед компиляцией?

Поделиться сообщением


Ссылка на сообщение
Гость
Эта тема закрыта для публикации ответов.
  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

  • Похожий контент

    • patrickk
      От patrickk
      Всем привет, решил написать dm сервер и довольно хорошим получился, даже на голову выше Goat dm. Оставил не решенную проблему тем что  у меня есть 4 локации с rp run и cj run ну а как добавить cj бег на те локации не знаю и как эта система работает. Надеюсь мне помогут знающие люди
    • Samolet
      От Samolet
      Здраствуйте, cоздаю копию Arizona на ОМП, опен мультиплеер, загрузил и подключил бд, но сервер не хочет вот лог :[2026-10-20T21:03:32+0300] [Info] Log file reloaded. Starting open.mp server (1.5.8.3079) from commit c6759bd8d265171ae3d86598895a23d5a8d92a3b Loading component $CAPI.so Successfully loaded component C-API (1.5.8.3079) with UID 10467dd8d4c56fc6 Loading component LegacyConfig.so Successfully loaded component LegacyConfig (1.5.8.3079) with UID 24ef6216838f9ffc Loading component NPCs.so Successfully loaded component NPCs (1.5.8.3079) with UID 3d0e59e87f4e90bc Loading component Recordings.so Successfully loaded component Recordings (1.5.8.3079) with UID 871144d399f5f613 Loading component Checkpoints.so Successfully loaded component Checkpoints (1.5.8.3079) with UID 44a937350d611dde Loading component TextDraws.so Successfully loaded component TextDraws (1.5.8.3079) with UID 9b5dc2b1d15c992a Loading component Pawn.so Successfully loaded component Pawn (1.5.8.3079) with UID 78906cd9f19c36a6 Loading component GangZones.so Successfully loaded component GangZones (1.5.8.3079) with UID b3351d11ee8d8056 Loading component Actors.so Successfully loaded component Actors (1.5.8.3079) with UID c81ca021eae2ad5c Loading component Pickups.so Successfully loaded component Pickups (1.5.8.3079) with UID cf304faa363dd971 Loading component Dialogs.so Successfully loaded component Dialogs (1.5.8.3079) with UID 44a111350d611dde Loading component Objects.so Successfully loaded component Objects (1.5.8.3079) with UID 59f8415f72da6160 Loading component Console.so Successfully loaded component Console (1.5.8.3079) with UID bfa24e49d0c95ee4 Loading component TextLabels.so Successfully loaded component TextLabels (1.5.8.3079) with UID a0c57ea80a009742 Loading component Variables.so Successfully loaded component Variables (1.5.8.3079) with UID 75e121848bc01fa2 Loading component Databases.so Successfully loaded component Databases (1.5.8.3079) with UID 80092e7eb5821a96 Loading component LegacyNetwork.so Successfully loaded component RakNetLegacyNetwork (1.5.8.3079) with UID ea9799fd79cf8442 Loading component CustomModels.so Successfully loaded component CustomModels (1.5.8.3079) with UID 15e3cb1e7c77ffff Loading component Menus.so Successfully loaded component Menus (1.5.8.3079) with UID 621e219eb97ee0b2 Loading component Vehicles.so Successfully loaded component Vehicles (1.5.8.3079) with UID 3f1f62ee9e22ab19 Loading component Classes.so Successfully loaded component Classes (1.5.8.3079) with UID 8cfb3183976da208 Loading component Timers.so Successfully loaded component Timers (1.5.8.3079) with UID 2ad8124c5ea257a3 Loaded 22 component(s) from /home/gs113492/components Executing Server Config... [2026-10-20T21:03:33+0300] [Info] Loading plugin: crashdetect.so [2026-10-20T21:03:33+0300] [Info] CrashDetect plugin 4.19 [2026-10-20T21:03:33+0300] [Info] Loading plugin: mapandreas.so [2026-10-20T21:03:33+0300] [Info] Loading plugin: streamer.so [2026-10-20T21:03:33+0300] [Info] *** Streamer Plugin v2.9.4 by Incognito loaded *** [2026-10-20T21:03:33+0300] [Info] Loading plugin: sscanf.so [2026-10-20T21:03:33+0300] [Info] [2026-10-20T21:03:33+0300] [Info] =============================== [2026-10-20T21:03:33+0300] [Info] sscanf plugin loaded. [2026-10-20T21:03:33+0300] [Info] Version: 2.8.3 [2026-10-20T21:03:33+0300] [Info] (c) 2018 Alex "Y_Less" Cole [2026-10-20T21:03:33+0300] [Info] =============================== [2026-10-20T21:03:33+0300] [Info] Loading plugin: TOTP.so [2026-10-20T21:03:33+0300] [Info] TOTP plugin v1.0.1 by Games loaded. [2026-10-20T21:03:33+0300] [Info] Loading plugin: mysql_static.so [2026-10-20T21:03:33+0300] [Info] >> plugin.mysql: R39-6 successfully loaded. [2026-10-20T21:03:33+0300] [Info] Loading plugin: libpawn_json.so [2026-10-20T21:03:34+0300] [Error] Function not registered: YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_RegAlias [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_Reset [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_RegHandler [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_Delete [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_New [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_IgnoreBits [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_Init [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_SendRPC [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_SendPacket [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_WriteValue [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_ReadValue [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_ReadValue [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Info] [debug] BS_WriteValue [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendPacket [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendRPC [2026-10-20T21:03:34+0300] [Info] [debug] PR_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_IgnoreBits [2026-10-20T21:03:34+0300] [Info] [debug] BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Info] [debug] BS_New [2026-10-20T21:03:34+0300] [Info] [debug] BS_Delete [2026-10-20T21:03:34+0300] [Info] [debug] PR_RegHandler [2026-10-20T21:03:34+0300] [Info] [debug] BS_Reset [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] PC_RegAlias [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_ReadValue [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Info] [debug] BS_WriteValue [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendPacket [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendRPC [2026-10-20T21:03:34+0300] [Info] [debug] PR_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_IgnoreBits [2026-10-20T21:03:34+0300] [Info] [debug] BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Info] [debug] BS_New [2026-10-20T21:03:34+0300] [Info] [debug] BS_Delete [2026-10-20T21:03:34+0300] [Info] [debug] PR_RegHandler [2026-10-20T21:03:34+0300] [Info] [debug] BS_Reset [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] PC_RegAlias [2026-10-20T21:03:34+0300] [Info] Legacy Network started on ***.**.**.***:2717. Помогите пожалуйста