Accessories editor (Toy editor)
#1

Could someone help me to convert this old toy editor into new 0.3e toy editor? (attachment edit or whatever you call it). It has old coordinates editor, if you remember.

I've been playing with the code and I even managed to get the 0.3e toy editor, but it won't save. So I need someones help so badly.

pawn Код:
stock ShowEditMenu(playerid)
{
    if(IsPlayerAttachedObjectSlotUsed(playerid, slotselection[playerid]))
    {
        RemovePlayerAttachedObject(playerid, slotselection[playerid]);
    }
    if(PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX] == 0) {
        PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX] = 1.0;
        PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY] = 1.0;
        PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ] = 1.0;
    }

    SetPlayerAttachedObject(playerid, slotselection[playerid], PlayerToyInfo[playerid][slotselection[playerid]][ptModelID],
    PlayerToyInfo[playerid][slotselection[playerid]][ptBone], PlayerToyInfo[playerid][slotselection[playerid]][ptPosX],
    PlayerToyInfo[playerid][slotselection[playerid]][ptPosY], PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ],
    PlayerToyInfo[playerid][slotselection[playerid]][ptRotX], PlayerToyInfo[playerid][slotselection[playerid]][ptRotY],
    PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX],
    PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ]);

    new stringg[512];
    format(stringg, sizeof(stringg), "Bone (%s)\nOffset X (%f)\nOffset Y (%f)\nOffset Z (%f)\nRotation X (%f)\nRotation Y (%f)\nRotation Z (%f)\nScale X (%f)\nScale Y (%f)\nScale Z (%f)",
    HoldingBones[PlayerToyInfo[playerid][slotselection[playerid]][ptBone]],
    (PlayerToyInfo[playerid][slotselection[playerid]][ptPosX]*100),
    (PlayerToyInfo[playerid][slotselection[playerid]][ptPosY]*100),
    (PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ]*100),
    PlayerToyInfo[playerid][slotselection[playerid]][ptRotX],
    PlayerToyInfo[playerid][slotselection[playerid]][ptRotY],
    PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ],
    PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX],
    PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY],
    PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ]);
    ShowPlayerDialogEx(playerid, EDITTOYS2, DIALOG_STYLE_LIST, "Toy Menu: Edit", stringg, "Select", "Cancel");
}
pawn Код:
if((dialogid == EDITTOYS) && response)
    {
        if(PlayerToyInfo[playerid][listitem][ptModelID] == 0)
        {
            ShowPlayerDialogEx(playerid, 0, DIALOG_STYLE_MSGBOX, "Toy Menu: Edit", "Woops! You don't have anything on that slot", "OK", "");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "{AA3333}HINT:{FFFF00} Position your camera differently to better see where your editing.");
            slotselection[playerid] = listitem;
            ShowEditMenu(playerid);
        }
    }
    if((dialogid == EDITTOYS2)) {
        if(response) switch(listitem) {
            case DIALOG_ATTACH_EDITREPLACE:
        {
            if(response) EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
            else RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
            DeletePVar(playerid, "AttachmentIndexSel");
            return 1;
        }
        }
        else
        {
            new stringg[512];
            for(new x;x<MAX_PLAYERTOYS;x++)
            {
                new name[24];
                format(name, sizeof(name), "None");

                for(new i;i<sizeof(HoldingObjectsAll);i++)
                {
                    if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
                    {
                        format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
                    }
                }

                format(stringg, sizeof(stringg), "%s(%d) %s (Bone: %s)\n", stringg, x, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]);
            }
            ShowPlayerDialogEx(playerid, EDITTOYS, DIALOG_STYLE_LIST, "Select a Toy", stringg, "Select", "Cancel");
        }
    }
    if(dialogid == EDITTOYSSX)
    {
        if(response)
        {
            new Float:offset = floatstr(inputtext);
            if(offset < 0.1) offset = 0.1;
            else if(offset > 1.5) offset = 1.5;
            PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX] = offset;
        }
        ShowEditMenu(playerid);
    }
    if(dialogid == EDITTOYSSY)
    {
        if(response)
        {
            new Float:offset = floatstr(inputtext);
            if(offset < 0.1) offset = 0.1;
            else if(offset > 1.5) offset = 1.5;
            PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY] = offset;
        }
        ShowEditMenu(playerid);
    }
    if(dialogid == EDITTOYSSZ)
    {
        if(response)
        {
            new Float:offset = floatstr(inputtext);
            if(offset < 0.1) offset = 0.1;
            else if(offset > 1.5) offset = 1.5;
            PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ] = offset;
        }
        ShowEditMenu(playerid);
    }
    if(dialogid == EDITTOYSPX)
    {
        if(response)
        {
            new Float:offset = floatstr(inputtext);
            if(offset < -100) offset = 0;
            else if(offset > 100) offset = 100;
            offset = offset/100;
            PlayerToyInfo[playerid][slotselection[playerid]][ptPosX] = offset;
        }
        ShowEditMenu(playerid);
    }
    if(dialogid == EDITTOYSPY)
    {
        if(response)
        {
            new Float:offset = floatstr(inputtext);
            if(offset < -100) offset = 0;
            else if(offset > 100) offset = 100;
            offset = offset/100;
            PlayerToyInfo[playerid][slotselection[playerid]][ptPosY] = offset;
        }
        ShowEditMenu(playerid);
    }
    if(dialogid == EDITTOYSPZ)
    {
        if(response)
        {
            new Float:offset = floatstr(inputtext);
            if(offset < -100) offset = 0;
            else if(offset > 100) offset = 100;
            offset = offset/100;
            PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ] = offset;
        }
        ShowEditMenu(playerid);
    }
    if(dialogid == EDITTOYSRX)
    {
        if(response)
        {
            new Float:offset = floatstr(inputtext);
            if(offset < -100) offset = 0;
            else if(offset > 360) offset = 360;
            PlayerToyInfo[playerid][slotselection[playerid]][ptRotX] = offset;
        }
        ShowEditMenu(playerid);
    }
    if(dialogid == EDITTOYSRY)
    {
        if(response)
        {
            new Float:offset = floatstr(inputtext);
            if(offset < -100) offset = 0;
            else if(offset > 360) offset = 360;
            PlayerToyInfo[playerid][slotselection[playerid]][ptRotY] = offset;
        }
        ShowEditMenu(playerid);
    }
    if(dialogid == EDITTOYSRZ)
    {
        if(response)
        {
            new Float:offset = floatstr(inputtext);
            if(offset < -100) offset = 0;
            else if(offset > 360) offset = 360;
            PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ] = offset;
        }
        ShowEditMenu(playerid);
    }
    if(dialogid == EDITTOYSBONE)
    {
        if(response)
        {
            PlayerToyInfo[playerid][slotselection[playerid]][ptBone] = listitem+1;
        }
        ShowEditMenu(playerid);
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)