Добро пожаловать!

Зарегистрировавшись у нас, вы сможете обсуждать, делиться и отправлять личные сообщения другим участникам нашего сообщества.

Зарегистрироваться!
  • Если Вы желаете помогать развитию проекта, готовы заполнять раздел(-ы) и подсказывать другим пользователям на портале, есть возможность попасть в команду редакторов. Для этого следует обратиться в техническую поддержку
Активный
Пользователь
Регистрация
5 Июл 2024
Сообщения
340

Всем привет! Не могу понять как нужно переписывать систему крафта того, что бы показывало иконки предметов лаунчера.
Например: Прочная Ткань, вместо нее показывает просто черный квадрат
Код:
Pawn:
stock CheckCraftItems(playerid)
{
    new s,c,ids = Int_GetPlayerData(playerid, "CraftSelect");
    for(new i; i < 5; i++)
    {
        if(!CraftInfo[ids][craftNeedKolvo][i]) { c++; continue; }
        if(CraftInfo[ids][craftNeedKolvo][i]*Int_GetPlayerData(playerid, "CraftScore") <= GetCount(playerid, CraftInfo[ids][craftNeed][i])) s++;
    }
    if(s >= 5-c && s) return 1;
    return 0; //CraftScore
}
stock ShowCraft(playerid)
{
    SetPVarString(playerid, "CraftType", "Accessory");
    SetPVarInt(playerid, "CraftPage",1);
    DeletePVar(playerid, "CraftSelect");
    DeletePVar(playerid, "CraftScore");
    DeletePVar(playerid, "CraftColor");
    for(new i = 0; i < 37; i++)
    {
        DestroyPlayerTD(playerid, CraftSuper[playerid][i]);
        if( i < 5) DestroyPlayerTD(playerid, CraftNeedText[playerid][i]), DestroyPlayerTD(playerid, CraftNeedTD[playerid][i]);
        if( i < 10) DestroyPlayerTD(playerid, CraftMenuBox[playerid][i]), DestroyPlayerTD(playerid, CraftMenuText[playerid][i]);
        if( i < 12) DestroyPlayerTD(playerid, CraftColor[playerid][i]);
    }
    CraftTextDraws(playerid);
    for(new i = 0; i < 37; i++) ShowPlayerTD(playerid, CraftSuper[playerid][i]);
    SetInfoCraftPlayer(playerid);
    UpdateMenuCraft(playerid);
    craftopen{playerid} = true;
    SelectTextDraw(playerid, PI[playerid][pSelectTD]);
    return 1;
}
stock HideCraft(playerid)
{
    for(new i = 0; i < 37; i++)
    {
        DestroyPlayerTD(playerid, CraftSuper[playerid][i]);
        if( i < 5) DestroyPlayerTD(playerid, CraftNeedText[playerid][i]),DestroyPlayerTD(playerid, CraftNeedTD[playerid][i]);
        if( i < 10) DestroyPlayerTD(playerid, CraftMenuBox[playerid][i]), DestroyPlayerTD(playerid, CraftMenuText[playerid][i]);
        if( i < 12) DestroyPlayerTD(playerid, CraftColor[playerid][i]);
    }
    DeletePVar(playerid, "CraftType");
    DeletePVar(playerid, "CraftPage");
    craftopen{playerid} = false;
    CancelSelectTextDraw(playerid);
}
CraftTextDraws(playerid) //CraftSelect
{
    #include textdraws/craft
}
stock SetInfoCraftPlayer(playerid)
{
    new ids = Int_GetPlayerData(playerid, "CraftSelect");
    for(new i; i < 5; i++)
    {
        DestroyPlayerTD(playerid, CraftNeedText[playerid][i]);
        DestroyPlayerTD(playerid, CraftNeedTD[playerid][i]);

        if(!CraftInfo[ids][craftNeed][i]) continue;

        CraftNeedTD[playerid][i] = CreatePlayerTextDraw(playerid, 260.000000+(22.200012*i), 271.160461, "LD_SPAC:white");
        PlayerTextDrawLetterSize(playerid, CraftNeedTD[playerid][i], 0.480000, 1.120000);
        PlayerTextDrawTextSize(playerid, CraftNeedTD[playerid][i], 19.200001, 22.211765);
        PlayerTextDrawAlignment(playerid, CraftNeedTD[playerid][i], 1);
        PlayerTextDrawColor(playerid, CraftNeedTD[playerid][i], 0xFFFFFFFF999999FF);
        PlayerTextDrawUseBox(playerid, CraftNeedTD[playerid][i], 0);
        PlayerTextDrawBoxColor(playerid, CraftNeedTD[playerid][i], 0xFFFFFFFF80808080);
        PlayerTextDrawSetShadow(playerid, CraftNeedTD[playerid][i], 2);
        PlayerTextDrawSetOutline(playerid, CraftNeedTD[playerid][i], 0);
        PlayerTextDrawBackgroundColor(playerid, CraftNeedTD[playerid][i], 0x333333FF);
        PlayerTextDrawFont(playerid, CraftNeedTD[playerid][i], 5);
        PlayerTextDrawSetProportional(playerid, CraftNeedTD[playerid][i], 1);
        PlayerTextDrawSetSelectable(playerid, CraftNeedTD[playerid][i], 1);
        PlayerTextDrawSetPreviewModel(playerid, CraftNeedTD[playerid][i], ItemsInfo[CraftInfo[ids][craftNeed][i]][itemModel], ItemsInfo[CraftInfo[ids][craftNeed][i]][itemTxd_name]);
        PlayerTextDrawSetPreviewRot(playerid, CraftNeedTD[playerid][i], ItemsInfo[CraftInfo[ids][craftNeed][i]][itemRotation][0], ItemsInfo[CraftInfo[ids][craftNeed][i]][itemRotation][1], ItemsInfo[CraftInfo[ids][craftNeed][i]][itemRotation][2],
        ItemsInfo[CraftInfo[ids][craftNeed][i]][itemRotation][3], ItemsInfo[CraftInfo[ids][craftNeed][i]][itemTxd_name]);

        f(global_str,35, "%s %d/%d",(CraftInfo[ids][craftNeedKolvo][i]*Int_GetPlayerData(playerid, "CraftScore") <= GetCount(playerid, CraftInfo[ids][craftNeed][i]))
        ? ("~g~"):("~r~"), GetCount(playerid, CraftInfo[ids][craftNeed][i]), CraftInfo[ids][craftNeedKolvo][i]*Int_GetPlayerData(playerid, "CraftScore"));
        CraftNeedText[playerid][i] = CreatePlayerTextDraw(playerid, 269.600006+(22.200012*i), 287.081940, global_str);
        PlayerTextDrawLetterSize(playerid, CraftNeedText[playerid][i], 0.089958, 0.529030);
        PlayerTextDrawTextSize(playerid, CraftNeedText[playerid][i], 1280.000000, 1280.000000);
        PlayerTextDrawAlignment(playerid, CraftNeedText[playerid][i], 2);
        PlayerTextDrawColor(playerid, CraftNeedText[playerid][i], 0xFFFFFFFFFFFFFFFF);
        PlayerTextDrawUseBox(playerid, CraftNeedText[playerid][i], 0);
        PlayerTextDrawBoxColor(playerid, CraftNeedText[playerid][i], 0xFFFFFFFF80808080);
        PlayerTextDrawSetShadow(playerid, CraftNeedText[playerid][i], 0);
        PlayerTextDrawSetOutline(playerid, CraftNeedText[playerid][i], 0);
        PlayerTextDrawBackgroundColor(playerid, CraftNeedText[playerid][i], 0x00000000);
        PlayerTextDrawFont(playerid, CraftNeedText[playerid][i], 2);
        PlayerTextDrawSetProportional(playerid, CraftNeedText[playerid][i], 1);
        PlayerTextDrawSetSelectable(playerid, CraftNeedText[playerid][i], 0);

        ShowPlayerTD(playerid, CraftNeedTD[playerid][i]);
        ShowPlayerTD(playerid, CraftNeedText[playerid][i]);
    }
    //
    DestroyPlayerTD(playerid, CraftSuper[playerid][6]);
    f(global_str, 35 , "~g~$%d", 1000*Int_GetPlayerData(playerid, "CraftScore"));
    CraftSuper[playerid][6] = CreatePlayerTextDraw(playerid, 368.000000, 302.372223, global_str);
    PlayerTextDrawLetterSize(playerid, CraftSuper[playerid][6], 0.107949, 0.634835);
    PlayerTextDrawTextSize(playerid, CraftSuper[playerid][6], 1280.000000, 1280.000000);
    PlayerTextDrawAlignment(playerid, CraftSuper[playerid][6], 3);
    PlayerTextDrawColor(playerid, CraftSuper[playerid][6], 0xFFFFFFFFFFFFFFFF);
    PlayerTextDrawUseBox(playerid, CraftSuper[playerid][6], 0);
    PlayerTextDrawBoxColor(playerid, CraftSuper[playerid][6], 0xFFFFFFFF80808080);
    PlayerTextDrawSetShadow(playerid, CraftSuper[playerid][6], 0);
    PlayerTextDrawSetOutline(playerid, CraftSuper[playerid][6], 0);
    PlayerTextDrawBackgroundColor(playerid, CraftSuper[playerid][6], 0x00000000);
    PlayerTextDrawFont(playerid, CraftSuper[playerid][6], 2);
    PlayerTextDrawSetProportional(playerid, CraftSuper[playerid][6], 1);
    PlayerTextDrawSetSelectable(playerid, CraftSuper[playerid][6], 0);

    DestroyPlayerTD(playerid, CraftSuper[playerid][5]);
    if(PI[playerid][pVIP][0] < 6) f(global_str,35, "SUCCESS CHANCE: %d%",CraftInfo[ids][craftChance]);
    else f(global_str, 35 , "SUCCESS CHANCE: %d%",CraftInfo[ids][craftChance]*2);
    CraftSuper[playerid][5] = CreatePlayerTextDraw(playerid, 314.000000, 312.073669, global_str);
    PlayerTextDrawLetterSize(playerid, CraftSuper[playerid][5], 0.134937, 0.793544);
    PlayerTextDrawTextSize(playerid, CraftSuper[playerid][5], 1280.000000, 1280.000000);
    PlayerTextDrawAlignment(playerid, CraftSuper[playerid][5], 2);
    PlayerTextDrawColor(playerid, CraftSuper[playerid][5], 0xFFFFFFFFDA9949FF);
    PlayerTextDrawUseBox(playerid, CraftSuper[playerid][5], 0);
    PlayerTextDrawBoxColor(playerid, CraftSuper[playerid][5], 0xFFFFFFFF80808080);
    PlayerTextDrawSetShadow(playerid, CraftSuper[playerid][5], 0);
    PlayerTextDrawSetOutline(playerid, CraftSuper[playerid][5], 0);
    PlayerTextDrawBackgroundColor(playerid, CraftSuper[playerid][5], 0x00000000);
    PlayerTextDrawFont(playerid, CraftSuper[playerid][5], 2);
    PlayerTextDrawSetProportional(playerid, CraftSuper[playerid][5], 1);
    PlayerTextDrawSetSelectable(playerid, CraftSuper[playerid][5], 0);

    DestroyPlayerTD(playerid, CraftSuper[playerid][23]);
    f(global_str,35, "%s",ItemsInfo[CraftInfo[ids][craftAksID]][itemEng_name]);
    CraftSuper[playerid][23] = CreatePlayerTextDraw(playerid, 331.437500, 204.350006, global_str);
    PlayerTextDrawLetterSize(playerid, CraftSuper[playerid][23], 0.107949, 0.634835);
    PlayerTextDrawTextSize(playerid, CraftSuper[playerid][23], 1280.000000, 1280.000000);
    PlayerTextDrawAlignment(playerid, CraftSuper[playerid][23], 2);
    PlayerTextDrawColor(playerid, CraftSuper[playerid][23], 0xFFFFFFFFFFFFFFFF);
    PlayerTextDrawUseBox(playerid, CraftSuper[playerid][23], 0);
    PlayerTextDrawBoxColor(playerid, CraftSuper[playerid][23], 0xFFFFFFFF80808080);
    PlayerTextDrawSetShadow(playerid, CraftSuper[playerid][23], 0);
    PlayerTextDrawSetOutline(playerid, CraftSuper[playerid][23], 0);
    PlayerTextDrawBackgroundColor(playerid, CraftSuper[playerid][23], 0x00000000);
    PlayerTextDrawFont(playerid, CraftSuper[playerid][23], 2);
    PlayerTextDrawSetProportional(playerid, CraftSuper[playerid][23], 1);
    PlayerTextDrawSetSelectable(playerid, CraftSuper[playerid][23], 0);

    DestroyPlayerTD(playerid, CraftSuper[playerid][2]);
    CraftSuper[playerid][2] = CreatePlayerTextDraw(playerid, 257.000000, 201.350006, "LD_SPAC:white");
    PlayerTextDrawLetterSize(playerid, CraftSuper[playerid][2], 0.480000, 1.120000);
    PlayerTextDrawTextSize(playerid, CraftSuper[playerid][2], 31.875000, 36.875000);
    PlayerTextDrawAlignment(playerid, CraftSuper[playerid][2], 1);
    PlayerTextDrawColor(playerid, CraftSuper[playerid][2], 0xFFFFFFFFFFFFFFFF);
    PlayerTextDrawUseBox(playerid, CraftSuper[playerid][2], 0);
    PlayerTextDrawBoxColor(playerid, CraftSuper[playerid][2], 0xFFFFFFFF80808080);
    PlayerTextDrawSetShadow(playerid, CraftSuper[playerid][2], 2);
    PlayerTextDrawSetOutline(playerid, CraftSuper[playerid][2], 0);
    PlayerTextDrawBackgroundColor(playerid, CraftSuper[playerid][2], ItemsInfo[CraftInfo[ids][craftAksID]][itemColor]);
    PlayerTextDrawFont(playerid, CraftSuper[playerid][2], 5);
    PlayerTextDrawSetProportional(playerid, CraftSuper[playerid][2], 1);
    PlayerTextDrawSetSelectable(playerid, CraftSuper[playerid][2], 0);
    PlayerTextDrawSetPreviewModel(playerid, CraftSuper[playerid][2], ItemsInfo[CraftInfo[ids][craftAksID]][itemModel]);
    PlayerTextDrawSetPreviewRot(playerid, CraftSuper[playerid][2], ItemsInfo[CraftInfo[ids][craftAksID]][itemRotation][0], ItemsInfo[CraftInfo[ids][craftAksID]][itemRotation][1], ItemsInfo[CraftInfo[ids][craftAksID]][itemRotation][2],
    ItemsInfo[CraftInfo[ids][craftAksID]][itemRotation][3]);

    ShowPlayerTD(playerid, CraftSuper[playerid][2]);
    ShowPlayerTD(playerid, CraftSuper[playerid][23]);
    ShowPlayerTD(playerid, CraftSuper[playerid][5]);
    ShowPlayerTD(playerid, CraftSuper[playerid][6]);
    PlayerTextDrawHide(playerid, CraftSuper[playerid][3]);
    if(CheckCraftItems(playerid)) PlayerTextDrawSetSelectable(playerid, CraftSuper[playerid][3], 1);
    else PlayerTextDrawSetSelectable(playerid, CraftSuper[playerid][3], 0);
    ShowPlayerTD(playerid, CraftSuper[playerid][3]);
    //
}
stock UpdateMenuCraft(playerid)
{
    for(new i; i < 10; i++)
    {
        DestroyPlayerTD(playerid, CraftMenuText[playerid][i]);
        DestroyPlayerTD(playerid, CraftMenuBox[playerid][i]);
        CraftMenuBox[playerid][i] = CreatePlayerTextDraw(playerid, 249.300003, 199.850006+(13.111115*i), "usebox");
        PlayerTextDrawLetterSize(playerid, CraftMenuBox[playerid][i], 0.000000, 1.128367);
        PlayerTextDrawTextSize(playerid, CraftMenuBox[playerid][i], 154.500000, 0.000000);
        PlayerTextDrawAlignment(playerid, CraftMenuBox[playerid][i], 1);
        PlayerTextDrawColor(playerid, CraftMenuBox[playerid][i], 0xFFFFFFFFE1E1E1FF);
        PlayerTextDrawUseBox(playerid, CraftMenuBox[playerid][i], 1);
        PlayerTextDrawBoxColor(playerid, CraftMenuBox[playerid][i], 0x050505FF);
        PlayerTextDrawSetShadow(playerid, CraftMenuBox[playerid][i], 2);
        PlayerTextDrawSetOutline(playerid, CraftMenuBox[playerid][i], 0);
        PlayerTextDrawBackgroundColor(playerid, CraftMenuBox[playerid][i], 0x000000FF);
        PlayerTextDrawFont(playerid, CraftMenuBox[playerid][i], 0);
        PlayerTextDrawSetProportional(playerid, CraftMenuBox[playerid][i], 1);
        PlayerTextDrawSetSelectable(playerid, CraftMenuBox[playerid][i], 0);
        ShowPlayerTD(playerid, CraftMenuBox[playerid][i]);
    }
    new i,block = (Int_GetPlayerData(playerid, "CraftPage")-1)*10,ids = Int_GetPlayerData(playerid, "CraftSelect");
    new type[10],string[30];
    GetPVarString(playerid, "CraftType", type, sizeof(type));
    for(new z; z < MAX_CRAFTS; z++)
    {
        if(!CraftInfo[z][craftAksID]) continue;
        if(GetString(CraftInfo[z][craftType],type))
        {
            if(block){ block--; continue; }
            f(string, sizeof string, "%s", ItemsInfo[CraftInfo[z][craftAksID]][itemEng_name]);
            CraftMenuText[playerid][i] = CreatePlayerTextDraw(playerid, 162.000000, 201.731384+(13.111115*i), string);
            PlayerTextDrawLetterSize(playerid, CraftMenuText[playerid][i], 0.107949, 0.634835);
            PlayerTextDrawTextSize(playerid, CraftMenuText[playerid][i], 254.000000, 6.348354);
            PlayerTextDrawAlignment(playerid, CraftMenuText[playerid][i], 1);
            PlayerTextDrawColor(playerid, CraftMenuText[playerid][i], 0xFFFFFFFFFFFFFFFF);
            PlayerTextDrawUseBox(playerid, CraftMenuText[playerid][i], 0);
            PlayerTextDrawBoxColor(playerid, CraftMenuText[playerid][i], 0xFFFFFFFF80808080);
            PlayerTextDrawSetShadow(playerid, CraftMenuText[playerid][i], 0);
            PlayerTextDrawSetOutline(playerid, CraftMenuText[playerid][i], 0);
            PlayerTextDrawBackgroundColor(playerid, CraftMenuText[playerid][i], 0x00000000);
            PlayerTextDrawFont(playerid, CraftMenuText[playerid][i], 2);
            PlayerTextDrawSetProportional(playerid, CraftMenuText[playerid][i], 1);
            if(z == ids){
            PlayerTextDrawSetSelectable(playerid, CraftMenuText[playerid][i], 0);
            PlayerTextDrawHide(playerid, CraftMenuBox[playerid][i]);
            PlayerTextDrawBoxColor(playerid, CraftMenuBox[playerid][i], 0x1C1F21FF);
            ShowPlayerTD(playerid, CraftMenuBox[playerid][i]);
            }
            else PlayerTextDrawSetSelectable(playerid, CraftMenuText[playerid][i], 1);
            ShowPlayerTD(playerid, CraftMenuText[playerid][i]);
            CraftMassive[playerid][i] = z;
            i++;
            if(i == 10) break;
        }
    }
    for(new q; q < 5; q++)
    {
        new id = 33-q;
        switch(id)
        {
            case 33: string = "Accessory";
            case 32: string = "Clothes";
            case 31: string = "Chemistry";
            case 30: string = "Working";
            case 29: string = "Phone";
        }
        PlayerTextDrawHide(playerid, CraftSuper[playerid][id]);
        if(GetString(type, string))
        {
            PlayerTextDrawColor(playerid, CraftSuper[playerid][id], 0xFFFFFFFFDA9949FF);
            PlayerTextDrawSetSelectable(playerid, CraftSuper[playerid][id], 0);
        }
        else
        {
            PlayerTextDrawColor(playerid, CraftSuper[playerid][id], 0x777777FF);
            PlayerTextDrawSetSelectable(playerid, CraftSuper[playerid][id], 1);
        }
        ShowPlayerTD(playerid, CraftSuper[playerid][id]);
    }
    if(Int_GetPlayerData(playerid, "CraftColor")) DeletePVar(playerid, "CraftColor"), DestroyPlayerTD(playerid, CraftColor[playerid][11]);

    DestroyPlayerTD(playerid, CraftSuper[playerid][26]);
    f(string,sizeof string,"%d / 5",Int_GetPlayerData(playerid, "CraftPage"));
    CraftSuper[playerid][26] = CreatePlayerTextDraw(playerid, 202.000000, 332.842499, string);
    PlayerTextDrawLetterSize(playerid, CraftSuper[playerid][26], 0.107949, 0.634835);
    PlayerTextDrawTextSize(playerid, CraftSuper[playerid][26], 1280.000000, 1280.000000);
    PlayerTextDrawAlignment(playerid, CraftSuper[playerid][26], 2);
    PlayerTextDrawColor(playerid, CraftSuper[playerid][26], 0xFFFFFFFFDA9949FF);
    PlayerTextDrawUseBox(playerid, CraftSuper[playerid][26], 0);
    PlayerTextDrawBoxColor(playerid, CraftSuper[playerid][26], 0xFFFFFFFF80808080);
    PlayerTextDrawSetShadow(playerid, CraftSuper[playerid][26], 0);
    PlayerTextDrawSetOutline(playerid, CraftSuper[playerid][26], 0);
    PlayerTextDrawBackgroundColor(playerid, CraftSuper[playerid][26], 0x00000000);
    PlayerTextDrawFont(playerid, CraftSuper[playerid][26], 2);
    PlayerTextDrawSetProportional(playerid, CraftSuper[playerid][26], 1);
    PlayerTextDrawSetSelectable(playerid, CraftSuper[playerid][26], 0);

    ///
    ShowPlayerTD(playerid, CraftSuper[playerid][26]);
}
UpdateCraftCounts(playerid)
{
    new string[10];
    DestroyPlayerTD(playerid, CraftSuper[playerid][9]);
    f(string, sizeof string, "%d", Int_GetPlayerData(playerid, "CraftScore"));
    CraftSuper[playerid][9] = CreatePlayerTextDraw(playerid, 288.885254, 329.710571, string);
    PlayerTextDrawLetterSize(playerid, CraftSuper[playerid][9], 0.107949, 0.634835);
    PlayerTextDrawTextSize(playerid, CraftSuper[playerid][9], 312.885254, 6.348354);
    PlayerTextDrawAlignment(playerid, CraftSuper[playerid][9], 1);
    PlayerTextDrawColor(playerid, CraftSuper[playerid][9], 0x777777FF);
    PlayerTextDrawUseBox(playerid, CraftSuper[playerid][9], 0);
    PlayerTextDrawBoxColor(playerid, CraftSuper[playerid][9], 0xFFFFFFFF80808080);
    PlayerTextDrawSetShadow(playerid, CraftSuper[playerid][9], 0);
    PlayerTextDrawSetOutline(playerid, CraftSuper[playerid][9], 0);
    PlayerTextDrawBackgroundColor(playerid, CraftSuper[playerid][9], 0x00000000);
    PlayerTextDrawFont(playerid, CraftSuper[playerid][9], 2);
    PlayerTextDrawSetProportional(playerid, CraftSuper[playerid][9], 1);
    PlayerTextDrawSetSelectable(playerid, CraftSuper[playerid][9], 1);
    ShowPlayerTD(playerid, CraftSuper[playerid][9]);
}
 
Активный
Пользователь
Регистрация
5 Июл 2024
Сообщения
340
Сверху