Show dead player loot
#1

I made a system to show the inventory of a dead player, and when the player takes an item from the inventory does not add the dialog, but gives the item to the player.
my code

Код:
ShowLooting( playerid )
{
    new text[ 3000 ], subtxt[ 128 ], lootslot;
    for( new items; items < MAX_ITEMS; items++)
    {
        new id = GetDeadID( playerid );
        new itemid = PlayerDeadItemID[ items ][ id ];
        if( PlayerDeadItemQnt[ items ][ id ] > 0) 
        {
            printf( "%d", items );
            DeadGet[ playerid ][ lootslot ] = id;
            DeadList[ playerid ][ lootslot ] = itemid;
            DeadQntList[ playerid ][ lootslot ] = PlayerDeadItemQnt[ items ][ id ];
            // --
            format( subtxt, sizeof subtxt, "%d\t%s\n", PlayerDeadItemQnt[ items ][ id ], ItemInfo[ itemid ][ Item_Name ]);
            strcat( text, subtxt );
            lootslot++;
        }
    }
    ShowPlayerDialog( playerid, DIALOG_LOOT, DIALOG_STYLE_LIST, "Quantia | Item ", text, "Pegar", "x");
    return 1;
}

take_OnDialogResponse( playerid, dialogid, response, listitem)
{
    if(dialogid == DIALOG_LOOT)
    {
        if(!response) return 1;
        if(response)
        {
            AddItem( playerid, ItemInfo[ DeadList[ playerid ][ listitem ] ][ Item_Name ], DeadQntList[ playerid ][ listitem ] );
            PlayerDeadItemQnt[ listitem ][ DeadGet[ playerid ][ listitem ]] --;
        }
        return 1;
    }
 
    return 0;
}
Reply


Messages In This Thread
Show dead player loot - by BHTMestre - 17.07.2017, 17:12
Re: Show dead player loot - by Paulice - 17.07.2017, 17:19
Re: Show dead player loot - by BHTMestre - 17.07.2017, 17:29
Re: Show dead player loot - by Paulice - 17.07.2017, 17:45
Re: Show dead player loot - by BHTMestre - 17.07.2017, 17:46
Re: Show dead player loot - by Paulice - 17.07.2017, 17:47
Re: Show dead player loot - by BHTMestre - 17.07.2017, 18:38
Re: Show dead player loot - by BHTMestre - 17.07.2017, 20:06
Re: Show dead player loot - by FailerZ - 17.07.2017, 20:27
Re: Show dead player loot - by Paulice - 17.07.2017, 20:31

Forum Jump:


Users browsing this thread: 1 Guest(s)