Object won't attach to player
#1

Well, on my dialog response, instead of attaching an object to player, nothing happens. The dialog just closes down.

pawn Код:
if(dialogid == 73)
    {
        if(!response) return 1;
        ObjectBoneSelection[playerid] = listitem + 1;

        if(PlayerInfo[playerid][pDonator] < 1)
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9);
           
            if(ObjectSlotSelection[playerid] == 0)
            {
                 SetPlayerAttachedObject(playerid, 9, PlayerInfo[playerid][pObject1], ObjectBoneSelection[playerid]);
                 EditAttachedObject(playerid, 9);
                 return 1;
            }
            if(ObjectSlotSelection[playerid] == 1)
            {
                 SetPlayerAttachedObject(playerid, 9, PlayerInfo[playerid][pObject2], ObjectBoneSelection[playerid]);
                 EditAttachedObject(playerid, 9);
                 return 1;
            }
            if(ObjectSlotSelection[playerid] == 2)
            {
                 SetPlayerAttachedObject(playerid, 9, PlayerInfo[playerid][pObject3], ObjectBoneSelection[playerid]);
                 EditAttachedObject(playerid, 9);
                 return 1;
            }
            if(ObjectSlotSelection[playerid] == 3)
            {
                 SetPlayerAttachedObject(playerid, 9, PlayerInfo[playerid][pObject4], ObjectBoneSelection[playerid]);
                 EditAttachedObject(playerid, 9);
                 return 1;
            }
            if(ObjectSlotSelection[playerid] == 4)
            {
                 SetPlayerAttachedObject(playerid, 9, PlayerInfo[playerid][pObject5], ObjectBoneSelection[playerid]);
                 EditAttachedObject(playerid, 9);
                 return 1;
            }
        }
    }


This is the dialog that sets ObjectSlotSelection variable
pawn Код:
if(dialogid == 72)
    {
        if(!response) return 1;
        if(listitem == 0 && PlayerInfo[playerid][pObject1] < 1) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] That slot is emtpy.");
        if(listitem == 1 && PlayerInfo[playerid][pObject2] < 1) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] That slot is emtpy.");
        if(listitem == 2 && PlayerInfo[playerid][pObject3] < 1) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] That slot is emtpy.");
        if(listitem == 3 && PlayerInfo[playerid][pObject4] < 1) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] That slot is emtpy.");
        if(listitem == 4 && PlayerInfo[playerid][pObject5] < 1) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] That slot is emtpy.");
   
        ObjectSlotSelection[playerid] = listitem;
        new msgstr2[1024];
        for(new x;x<sizeof(AttachmentBones);x++)
        {
            format(msgstr2, sizeof(msgstr2), "%s%s\n", msgstr2, AttachmentBones[x]);
        }
        ShowPlayerDialog(playerid, 73, DIALOG_STYLE_LIST, \
        "{FF0000}Bone Selection", msgstr2, "Select", "Cancel");
        return 1;
   
    }
Reply


Messages In This Thread
Object won't attach to player - by Makaveli93 - 24.06.2012, 14:45
Re: Object won't attach to player - by Jonny5 - 24.06.2012, 15:14
Re: Object won't attach to player - by Grand_Micha - 24.06.2012, 15:28

Forum Jump:


Users browsing this thread: 1 Guest(s)