Loop on tags. - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Loop on tags. (/Thread-Loop-on-tags) |
Loop on tags. - rastrero - 01-22-2016 03:57 PM Hi Need to know something Imagine i got all this tags tag.enemy.player1=<player_Uid> tag.enemy.player2=<player_Uid> tag.enemy.player3=<player_Uid> tag.enemy.player4=<player_Uid> tag.enemy.player5=<player_Uid> tag.any=1 tag.asdas=1 Now I want to do a loop among enemy group tag. How do I this? RE: Loop on tags. - darksun84 - 01-22-2016 07:24 PM I don't understand, you can loop through similar tags by using this PHP Code: for 1 5 http://wiki.sphere.torfo.org/index.php/ATTACKER RE: Loop on tags. - rastrero - 01-23-2016 01:42 AM Ok, I knew that way but its not the way im looking for. Anyway thx. RE: Loop on tags. - darksun84 - 01-23-2016 02:59 AM What you mean then ? RE: Loop on tags. - rastrero - 01-23-2016 04:46 AM Im doing my own "guild system" I need to safe the members list, enemy, friends, allys, etc etc. so I want to safe them on tags but Im not sure how to do it. It this way better? Tag0.exampleMembers= <Uid> <uid> <uid> <uid> OR its better at the other way? ok, Im going to use lists better. Ty all anyway. RE: Loop on tags. - karma - 01-23-2016 06:11 AM If you access frequently to these values you can consider using MySQL. The way you are suggesting (but using commas as separators instead of blank spaces) may be better than having an high number of tags, if you have a reasonable limit of chars/enemies etc so that in any case the tag won't be too long. You can use these functions (the code can be improved, it is old and i don't use it now, i think it works though): Code: [FUNCTION array_get] //item, source (0 based) Anyways, take in mind that guildstones and townstones already have properties to store these values: http://wiki.sphere.torfo.org/index.php/Special_Items#Guild.2FTown_Members Also, check the current code in the "stones" folder, most of the stuff regarding guild/townstones is scripted. RE: Loop on tags. - Sirocco - 02-08-2016 06:04 PM make it self with sources Code: [FUNCTION f_arraysort] |