Message Panels : Aide Technique : script pour changer la texture d'un vĂȘtement |
<< | <First | < | <prev. | > | next.> | >> | Last> | Rep | Reply | ^ | Discussion ^ | v | Discussion v | Del | Delete the discussion |
Samuro | Samuro | 28/09 | Sent: 28/09/2024 21:00:54 | 1 / 1 | Message 1 from 1 |
// script pour changer la texture d'un vĂȘtement // clothes texture changing script void set (string texture) { set_mesh_texture (mesh_nr => 1, texture => texture); } void set_texture_nr (int text_nr) { string(32) name = ""; int nr = 0; for (;;) { name = item_name (name); if (name == "") break; if (item_type (name) == "TEX") { if (text_nr == nr) { set (name); if (is_worn ()) save_data_to_inventory (index => "textur", value => itos(nr)); break; } nr++; } } } event touch () { key k = touched_avatar(); string(32) name = ""; int nr = 0; string(1024) s; if (!same_key (k, object_owner())) return; s = ""; for (;;) { name = item_name (name); if (name == "") break; if (item_type (name) == "TEX") { if (s > "") s = s + ","; s = s + name + ":" + itos(nr++); } } display_menu (k, s); } event menu_selected (key avatar, int menu_id) { set_texture_nr (menu_id); } event start() { if (is_worn()) load_data_from_inventory (index => "textur"); } event inventory_data_arrived (string index, string value) { if (value == "") set_texture_nr (0); else set_texture_nr (stoi(value)); } |
<< | <First | < | <prev. | > | next.> | >> | Last> | Rep | Reply | ^ | Discussion ^ | v | Discussion v | Del | Delete the discussion |