So basically, I have three commands: /createblock1, /createblock2 and /createblock3
Whichever one I say first should display it’s text in the first slot,
second in the second slot and third in the third slot…
What it’s currently doing is it’s displaying everything in the first slot.
So if I type /createblock1, that gets put in the first
then if I type /createblock2, that replaces the first and puts itself there too,
and same for /createblock3…
I had booleans set up to keep track of the slots filled,
but it doesn’t look like it’s working for me.
Any suggestions? :ohdear:
[CODE]
// slots
setstring slot1,x;
setstring slot2,x;
setstring slot3,x;
slot1Filled = false;
slot2Filled = false;
slot3Filled = false;
// slot position
if(playerenters) {
showtext 677,20,20,Verdana,b,#s(slot1);
showtext 678,20,23,Verdana,b,#s(slot2);
showtext 679,20,26,Verdana,b,#s(slot3);
}
// first block
if(playerchats && strequals(#c,/createblock1)) {
if(slot1Filled == false) {
slot1Filled = true;
setstring slot1,Block1 Created.;
showtext 677,20,20,Verdana,b,#s(slot1); // again
}
if(slot1Filled == true && slot2Filled == false) {
slot2Filled = true;
setstring slot2,Block1 Created.;
showtext 677,20,20,Verdana,b,#s(slot2);
}
if(slot2Filled == true && slot3Filled == false) {
slot3Filled = true;
setstring slot3,Block1 Created.;
showtext 677,20,20,Verdana,b,#s(slot3);
}
}
// second block
if(playerchats && strequals(#c,/createblock2)) {
if(slot1Filled == false) {
slot1Filled = true;
setstring slot1,Block2 Created.;
showtext 677,20,20,Verdana,b,#s(slot1);
}
if(slot1Filled == true && slot2Filled == false) {
slot2Filled = true;
setstring slot2,Block2 Created.;
showtext 677,20,20,Verdana,b,#s(slot2);
}
if(slot2Filled == true && slot3Filled == false) {
slot3Filled = true;
setstring slot3,Block2 Created.;
showtext 677,20,20,Verdana,b,#s(slot3);
}
}
// third block
if(playerchats && strequals(#c,/createblock3)) {
if(slot1Filled == false) {
slot1Filled = true;
setstring slot1,Block3 Created.;
showtext 677,20,20,Verdana,b,#s(slot1);
}
if(slot1Filled == true && slot2Filled == false) {
slot2Filled = true;
setstring slot2,Block3 Created.;
showtext 677,20,20,Verdana,b,#s(slot2);
}
if(slot2Filled == true && slot3Filled == false) {
slot3Filled = true;
setstring slot3,Block3 Created.;
showtext 677,20,20,Verdana,b,#s(slot3);
}
}[/CODE]
As I said in my last post, I was thinking of using an array to keep track of the slots, but this seemed easier so I stuck with this.