what's wrong ?
#1

hello i have this commands in script :
pawn Код:
CMD:shopsword(playerid, params[])
{
    if (PlayerInfo[playerid][pShopTech] < 1 && PlayerInfo[playerid][pAdmin] < 1338)
    {
        SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
        return 1;
    }

    new string[128], giveplayerid, slot, invoice[64];
    if(sscanf(params, "uds[64]", giveplayerid, slot, invoice)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /shopsword [playerid] [slot(0-4)] [invoice #]");

    PlayerToyInfo[giveplayerid][slot][ptModelID] = 3028;
    PlayerToyInfo[giveplayerid][slot][ptBone] = 1;
    PlayerToyInfo[giveplayerid][slot][ptPosX] = 20.0;
    PlayerToyInfo[giveplayerid][slot][ptPosY] = -12.0;
    PlayerToyInfo[giveplayerid][slot][ptPosZ] = 25.0;
    PlayerToyInfo[giveplayerid][slot][ptRotX] = 0.0;
    PlayerToyInfo[giveplayerid][slot][ptRotY] = 50.0;
    PlayerToyInfo[giveplayerid][slot][ptRotZ] = 0.0;
    format(string, sizeof(string), "You have been given a sword toy in slot %d, use /toys to manage it", slot);
    SendClientMessageEx(giveplayerid, COLOR_LIGHTGREEN, string);
    format(string, sizeof(string), "You have given %s a sword toy in slot %d", GetPlayerNameEx(giveplayerid), slot);
    SendClientMessageEx(playerid, COLOR_LIGHTGREEN, string);
    format(string, sizeof(string), "[SHOPM4] %s has given %s a sword toy - Invoice %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), invoice);
    Log("logs/shoplog.log", string);
    return 1;
}
in game its :

Код:
why its -12000 and 2000 and 25000 ?!?
Reply
#2

We are not fairies ! show this format toys menu
Reply
#3

what ? that commands would give me toy with those pos/rot
but its gives another pos -12000 exccept of -12 why ?
and its gives right at 50.0 rot
Reply
#4

show us your dialog-line
Reply
#5

pawn Код:
if((dialogid == TOYS) && response)
    {
        if(listitem == 0)
        {
            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]]);
            }
            ShowPlayerDialog(playerid, WEARTOY, DIALOG_STYLE_LIST, "Select a Toy", stringg, "Select", "Cancel");
        }
        else if(listitem == 1)
        {
            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]]);
            }
            ShowPlayerDialog(playerid, EDITTOYS, DIALOG_STYLE_LIST, "Select a Toy", stringg, "Select", "Cancel");
        }
        else if(listitem == 2)
        {
            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]]);
            }
            ShowPlayerDialog(playerid, DELETETOY, DIALOG_STYLE_LIST, "Select a Toy", stringg, "Delete", "Cancel");
        }
    }

    if((dialogid == EDITTOYS) && response)
    {
        if(PlayerToyInfo[playerid][listitem][ptModelID] == 0)
        {
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Toy Menu: Edit", "Woops! You don't have anything on that slot", "OK", "");
        }
        else
        {
            SendClientMessageEx(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)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, EDITTOYSBONE, DIALOG_STYLE_LIST, "Select a Bone", "Spine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearm\nRight forearm\nLeft clavicle\nRight clavicle\nNeck\nJaw", "Select", "Cancel");
            }
            else if(listitem == 1)
            {
                ShowPlayerDialog(playerid, EDITTOYSPX, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an X Offset from -100 to 100 (Ex: 55, or 33.4)", "Enter", "Cancel");
            }
            else if(listitem == 2)
            {
                ShowPlayerDialog(playerid, EDITTOYSPY, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an Y Offset from -100 to 100 (Ex: 55, or 33.4)", "Enter", "Cancel");
            }
            else if(listitem == 3)
            {
                ShowPlayerDialog(playerid, EDITTOYSPZ, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an Z Offset from -100 to 100 (Ex: 55, or 33.4)", "Enter", "Cancel");
            }
            else if(listitem == 4)
            {
                ShowPlayerDialog(playerid, EDITTOYSRX, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an X Rotation from 0 to 360 (Ex: 90, or 270.4)", "Enter", "Cancel");
            }
            else if(listitem == 5)
            {
                ShowPlayerDialog(playerid, EDITTOYSRY, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an Y Rotation from 0 to 360 (Ex: 90, or 270.4)", "Enter", "Cancel");
            }
            else if(listitem == 6)
            {
                ShowPlayerDialog(playerid, EDITTOYSRZ, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an Z Rotation from 0 to 360 (Ex: 90, or 270.4)", "Enter", "Cancel");
            }
        }
        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]]);
            }
            ShowPlayerDialog(playerid, EDITTOYS, DIALOG_STYLE_LIST, "Select a Toy", stringg, "Select", "Cancel");
        }
    }
    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);
    }
    if((dialogid == WEARTOY) && response)
    {
        if(PlayerToyInfo[playerid][listitem][ptModelID] == 0)
        {
            ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Toy Menu: Attach/Deattach", "Woops! You don't have anything to put on from that slot", "OK", "");
        }
        else
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
            {
                new name[24];
                format(name, sizeof(name), "None");

                for(new i;i<sizeof(HoldingObjectsAll);i++)
                {
                    if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][listitem][ptModelID])
                    {
                        format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
                    }
                }
                format(string, sizeof(string), "Successfully dettached %s (Bone: %s) (Slot: %d)", name, HoldingBones[PlayerToyInfo[playerid][listitem][ptBone]], listitem);
                SendClientMessageEx(playerid, COLOR_RED, string);
                RemovePlayerAttachedObject(playerid, listitem);
            }
            else
            {
                SetPlayerAttachedObject(playerid, listitem, PlayerToyInfo[playerid][listitem][ptModelID], PlayerToyInfo[playerid][listitem][ptBone], PlayerToyInfo[playerid][listitem][ptPosX], PlayerToyInfo[playerid][listitem][ptPosY], PlayerToyInfo[playerid][listitem][ptPosZ], PlayerToyInfo[playerid][listitem][ptRotX], PlayerToyInfo[playerid][listitem][ptRotY], PlayerToyInfo[playerid][listitem][ptRotZ], 1, 1, 1);
                new name[24];
                format(name, sizeof(name), "None");

                for(new i;i<sizeof(HoldingObjectsAll);i++)
                {
                    if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][listitem][ptModelID])
                    {
                        format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
                    }
                }
                format(string, sizeof(string), "Successfully attached %s (Bone: %s) (Slot: %d)", name, HoldingBones[PlayerToyInfo[playerid][listitem][ptBone]], listitem);
                SendClientMessageEx(playerid, COLOR_RED, string);
            }
        }
    }

    if((dialogid == DELETETOY) && response)
    {
        PlayerToyInfo[playerid][listitem][ptModelID] = 0;
        PlayerToyInfo[playerid][listitem][ptBone] = 0;
        PlayerToyInfo[playerid][listitem][ptPosX] = 0.0;
        PlayerToyInfo[playerid][listitem][ptPosY] = 0.0;
        PlayerToyInfo[playerid][listitem][ptPosZ] = 0.0;
        PlayerToyInfo[playerid][listitem][ptPosX] = 0.0;
        PlayerToyInfo[playerid][listitem][ptPosY] = 0.0;
        PlayerToyInfo[playerid][listitem][ptPosZ] = 0.0;
        if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
        {
            RemovePlayerAttachedObject(playerid, listitem);
        }
        format(string, sizeof(string), "You have deleted your toy in slot %d", listitem);
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Toy Menu", string, "OK", "");
    }
Reply
#6

So?.....
Reply
#7

nothing found so far. is there another dialog with the offsets?
Reply
#8

no i dont think
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)