beenii
Well-Known Member
- Joined
- Jul 26, 2010
- Messages
- 580
- Solutions
- 1
- Reaction score
- 57
Hello I think that interesting systems could be created with a function like this
I need it for a system to change townid of my players
the truth is, I don't know how to store data in tables, to create this function
the idea of the function is the following:
be able to use the function: shuffle(numbers) and place the numbers that we need to shuffle for example:
run shuffle(1,2,3,4,5)
and to be able to individually consult the order of each number
result:
shuffle.[1]=5
shuffle.[2]=2
shuffle.[3]=1
shuffle.[4]=3
shuffle.[5]=4
use again shuffle(1,2,3,4,5,6) now with another extra number
shuffle.[1]=2
shuffle.[2]=4
shuffle.[3]=6
shuffle.[4]=5
shuffle.[5]=1
shuffle.[6]=3
obtaining the numbers in a different order, and this order is preserved until we execute the function shuffle again
It does not matter if we store the order in global storage or in mysql, or in the same script, it would help me anyway, I hope can help me
I need it for a system to change townid of my players
the truth is, I don't know how to store data in tables, to create this function
the idea of the function is the following:
be able to use the function: shuffle(numbers) and place the numbers that we need to shuffle for example:
run shuffle(1,2,3,4,5)
and to be able to individually consult the order of each number
result:
shuffle.[1]=5
shuffle.[2]=2
shuffle.[3]=1
shuffle.[4]=3
shuffle.[5]=4
use again shuffle(1,2,3,4,5,6) now with another extra number
shuffle.[1]=2
shuffle.[2]=4
shuffle.[3]=6
shuffle.[4]=5
shuffle.[5]=1
shuffle.[6]=3
obtaining the numbers in a different order, and this order is preserved until we execute the function shuffle again
It does not matter if we store the order in global storage or in mysql, or in the same script, it would help me anyway, I hope can help me