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; }
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 ] ); HERE REMOVE DIALOG'S SELECTED ITEM! } return 1; } return 0; }
ItemYouPickedUp[the player's ID][slot of item][id] = 0; [ ... ]
Reset the array? Example:
PHP код:
|
Friend, I want when the player takes the item, disappear from the dialog
|
Friend, that's what you should do to make it disappear from the dialog.
|
Make a Boolean variable (Add it to your existing enum) to determine if that inventory slot is in use. Make it in use (true) when the player receive an item..
When the player drop the item..Make the slot (false) Then here when you are looping though them add another check of it to check if the variable in use (true). That's it |