Thraenkost
Lapis Toplayıcısı
- Mesajlar
- 936
- En iyi cevaplar
- 1
- Beğeniler
- 400
- Puanları
- 1,080
- Ruh hali
Beyler şimdi biz envanterindeki eşyaları ve giydiği zırhları nasıl bir list variableye kaydedebiliriz ?
command /inv:
trigger:
set {_count} to 0
loop 36 times:
set {inv.%player%.%{_count}%.main} to slot {_count} of player's inventory
message "{inv.%player%.%{_count}%.main} is %{inv.%player%.%{_count}%.main}%"
add 1 to {_count}
command /inv:
trigger:
set {_count} to 0
loop 36 times:
set {inv.%player%.%{_count}%.main} to slot {_count} of player's inventory
message "{inv.%player%.%{_count}%.main} is %{inv.%player%.%{_count}%.main}%"
add 1 to {_count}
set {inv.%player%.helmet.main} to player's helmet
set {inv.%player%.chest.main} to player's chestplate
set {inv.%player%.legs.main} to player's leggings
set {inv.%player%.feet.main} to player's boots
command /inv:
trigger:
set {_count} to 0
loop 36 times:
set {inv.%player%.%{_count}%.main} to slot {_count} of player's inventory
message "{inv.%player%.%{_count}%.main} is %{inv.%player%.%{_count}%.main}%"
add 1 to {_count}
set {inv.%player%.helmet.main} to player's helmet
set {inv.%player%.chest.main} to player's chestplate
set {inv.%player%.legs.main} to player's leggings
set {inv.%player%.feet.main} to player's boots
clear player's inventory
wait 3 seconds
command /inv:
trigger:
set {_count} to 0
loop 36 times:
set {inv.%player%.%{_count}%.main} to slot {_count} of player's inventory
message "{inv.%player%.%{_count}%.main} is %{inv.%player%.%{_count}%.main}%"
add 1 to {_count}
set {inv.%player%.helmet.main} to player's helmet
set {inv.%player%.chest.main} to player's chestplate
set {inv.%player%.legs.main} to player's leggings
set {inv.%player%.feet.main} to player's boots
clear player's inventory
wait 3 seconds
set {_count} to 0 #Setting count back to 0 so we can re-use it for the next counter
loop 36 times:
set slot {_count} of player's inventory to {inv.%player%.%{_count}%.main}
add 1 to {_count}
Tamam saolasınSsFightsS Sendemi Araştırmayı Bıraktın [Kötü Anlamda Anlama Sadece Espriydi]
Storing the inventory (prt.1)
From here on out it becomes a bit more complicated. You will need a different variable for each slot of the inventory, even if they are empty, so you can preserve the placement of items in the inventory. In these examples I will be using public variables so you can access the variables from anywhere in your skript if you wish.
PHP:command /inv: trigger: set {_count} to 0 loop 36 times: set {inv.%player%.%{_count}%.main} to slot {_count} of player's inventory message "{inv.%player%.%{_count}%.main} is %{inv.%player%.%{_count}%.main}%" add 1 to {_count}
Storing the inventory (prt.2)
Now that you have the main inventory slots set, you will now need to get the armor slots. This part is pretty straightforward, all you have to do is create four variables that store the player's armor. I just replaced the {_count} with the type of armor.
PHP:command /inv:[/B][/B][/B] [B][B][B] trigger:[/B][/B][/B] [B][B][B] set {_count} to 0[/B][/B][/B] [B][B][B] loop 36 times:[/B][/B][/B] [B][B][B] set {inv.%player%.%{_count}%.main} to slot {_count} of player's inventory[/B][/B][/B] [B][B][B] message "{inv.%player%.%{_count}%.main} is %{inv.%player%.%{_count}%.main}%"[/B][/B][/B] [B][B][B] add 1 to {_count}[/B][/B][/B] [B][B][B] set {inv.%player%.helmet.main} to player's helmet[/B][/B][/B] [B][B][B] set {inv.%player%.chest.main} to player's chestplate[/B][/B][/B] [B][B][B] set {inv.%player%.legs.main} to player's leggings[/B][/B][/B] [B][B][B] set {inv.%player%.feet.main} to player's boots
Not : Alıntıdır
Linkide Atayım Belki Yardımcı Olur : https://dev.bukkit.org/bukkit-plugi...s/71969-how-to-save-an-inventory-of-a-player/
Ö.d Sen Linke Bak Ben Yavaş Yavaş Düzeltmeye Çalışıyorum MesajıTamam saolasın