function changeIt(changer : player, id : text):
if {list::*} is set:
set {_loop} to {_id} parsed as an integer
loop {list::*}:
if loop-number is {_loop}:
set {_id} to loop-value
delete {list::*}
exit loop
else:
set {_id} to {_id} parsed as integer
send "%{_id}%" to {_changer}
set {_itemP} to the first element out of objects in column "echange_item" from result of query "SELECT echange_item FROM offres_hde WHERE id = '%{_id}%'" and close
set {_numbV} to the first element out of objects in column "item_nombre" from result of query "SELECT item_nombre FROM offres_hde WHERE id = '%{_id}%'" and close
set {_itemV} to the first element out of objects in column "item_vente" from result of query "SELECT item_vente FROM offres_hde WHERE id = '%{_id}%'" and close
set {_numbP} to the first element out of objects in column "echange_nombre" from result of query "SELECT echange_nombre FROM offres_hde WHERE id = '%{_id}%'" and close
send "%{_itemP}% %{_numbV}% %{_itemV}% %{_numbP}%" to {_changer}
if number of {_itemP} in {_changer}'s inventory < {_numbP}:
set {_msgAnnul} to {@NoSuffItems}
replace all "[prix]" in {_msgAnnul} with "%{_itemIdP}%"
broadcast "bite"
annuler({_changer}, "%{_msgAnnul}%")
stop
remove {_numbP} of {_itemP} from {_changer}'s inventory
give {_numbV} of {_itemV} to {_changer}
annuler({_changer}, {@SuccEchange})
command /hde:
trigger:
add objects in column "id" from result of query "SELECT id FROM offres_hde LIMIT 0,45" and close to {_ID::*}
add objects in column "pseudo_vendeur" from result of query "SELECT pseudo_vendeur FROM offres_hde LIMIT 0,45" and close to {_vendeur::*}
add objects in column "item_id" from result of query "SELECT item_id FROM offres_hde LIMIT 0,45" and close to {_idV::*}
add objects in column "item_nombre" from result of query "SELECT item_nombre FROM offres_hde LIMIT 0,45" and close to {_numbV::*}
add objects in column "item_name" from result of query "SELECT item_name FROM offres_hde LIMIT 0,45" and close to {_nameV::*}
add objects in column "item_enchantements" from result of query "SELECT item_enchantements FROM offres_hde LIMIT 0,45" and close to {_enchantV::*}
add objects in column "echange_id" from result of query "SELECT echange_id FROM offres_hde LIMIT 0,45" and close to {_idP::*}
add objects in column "echange_nombre" from result of query "SELECT echange_nombre FROM offres_hde LIMIT 0,45" and close to {_numbP::*}
add objects in column "echange_enchantements" from result of query "SELECT echange_enchantements FROM offres_hde LIMIT 0,45" and close to {_enchantP::*}
open chest with 6 rows named {@NomMenuHDE} to player
format slot 48 of player with egg named "&bVendre" to close then run [send {@VendreMenu}]
format slot 50 of player with stick named "&r%{_nombreOffres}% offres en ventes" to be unstealable
format slot 53 of player with 2 arrows named "&rPage &a2" to be unstealable
set {_count} to 0
set {_count1} to 1
loop 45 times:
if {_idV::%{_count1}%} is not set:
stop
add {_count1} to {list::*}
set {_item} to "%{_idV::%{_count1}%}%" parsed as item
set {_itemP} to "%{_idP::%{_count1}%}%" parsed as item
if {_enchantP::%{_count1}%} is "NULL":
set {_enchantsP} to ""
else:
replace all "/" in {_enchantP::%{_count1}%} with "||&7"
set {_enchantsP} to "||&7echanté(e)(s)||&7%{_enchantP::%{_count1}%}%"
if {_nameV::%{_count1}%} is "NULL":
if {_enchantV::%{_count1}%} is "NULL":
format slot {_count} of player with {_numbV::%{_count1}%} of {_item} with lore "||||&eVendu par: &7%{_vendeur::%{_count1}%}%||&eContre: &7%{_numbP::%{_count1}%}% %{_itemP}%%{_enchantsP}%" to close then run [changeIt(player, loop-number)]
else:
replace all "/" in {_enchantV::%{_count1}%} with "||&7"
format slot {_count} of player with {_numbV::%{_count1}%} of {_item} with lore "&7%{_enchantV::%{_count1}%}%||||&eVendu par: &7%{_vendeur::%{_count1}%}%||&eContre: &7%{_numbP::%{_count1}%}% %{_itemP}%%{_enchantsP}%" to close then run [changeIt(player, loop-number)]
else:
if {_enchantV::%{_count1}%} is "NULL":
format slot {_count} of player with {_numbV::%{_count1}%} of {_item} named "&b&o%{_nameV::%{_count1}%}%" with lore "||||&eVendu par: &7%{_vendeur::%{_count1}%}%||&eContre: &7%{_numbP::%{_count1}%}% %{_itemP}%%{_enchantsP}%" to close then run [changeIt(player, loop-number)]
else:
replace all "/" in {_enchantV::%{_count1}%} with "||&7"
format slot {_count} of player with {_numbV::%{_count1}%} of {_item} named "&b&o%{_nameV::%{_count1}%}%" with lore "&7%{_enchantV::%{_count1}%}%||||&eVendu par: &7%{_vendeur::%{_count1}%}%||&eContre: &7%{_numbP::%{_count1}%}% %{_itemP}%%{_enchantsP}%" to close then run [changeIt(player, loop-number)]
add 1 to {_count}
add 1 to {_count1}
J'ai pas testé mais sa devrais marcher. Donne moi en des nouvelles