Rammy
August 18, 2014, 6:15pm
#1
Seems simple enough but I’m not sure why it’s not working correctly, should I use addstring, replacestring instead…?
Basically there are 3 slots that each display at a certain position, when the player says “me”, slot1’s text changes).
// slot text
setstring slot1,Block1 Created.;
setstring slot2,Block2 Created.;
setstring slot3,Block3 Created.;
// 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);
}
if(playerchats && strequals(#c,me)) {
setstring slot1,Block4 Created.;
}
oh and I figured slots = arrays, but this seemed easier to do.
hosler
August 18, 2014, 8:09pm
#2
I think replace string is what you want
Rammy
August 18, 2014, 8:30pm
#4
Nap tried that earlier, stupid showtext displays the whole thing as a string.
yeah…
Spooon
August 18, 2014, 8:36pm
#5
Oh. I didn’t even read your post. The chat won’t change if it’s not on a timeout.
Rammy
August 18, 2014, 8:46pm
#6
I’m not sure what you mean by that?
…waiting to be spooon fed.
hosler
August 18, 2014, 8:51pm
#7
He means wrap your show text in a loop.
Rammy
August 18, 2014, 9:02pm
#8
Here’s the fix
// slot text
setstring slot1,Block1 Created.;
setstring slot2,Block2 Created.;
setstring slot3,Block3 Created.;
// 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);
}
if(playerchats && strequals(#c,/createblock1)) {
setstring slot1,Block4 Created.;
showtext 677,20,20,Verdana,b,#s(slot1); // again
}
edit: actually I might need the loop so I can keep track of the slots filled.
hosler
August 18, 2014, 9:37pm
#9
I don’t get it. You completely disregarded the advice and came up with a hackish product.
Spooon
August 18, 2014, 9:38pm
#10
What I meant was this
if (created || playerenters) {
if (!int) {
set int;
setstring slot1,Block1 Created.;
setstring slot2,Block2 Created.;
setstring slot3,Block3 Created.;
}
timeout = 0.05;
}
if (playerchats && strequals(#c,me)) setstring slot1,Block4 Created.;
if (timeout) {
showtext 677,20,20,Verdana,b,#s(slot1);
showtext 678,20,23,Verdana,b,#s(slot2);
showtext 679,20,26,Verdana,b,#s(slot3);
timeout = 0.05;
}
Rammy
August 19, 2014, 8:45am
#11
I initially tried wrapping it in a loop as you said (I’m not sure if you saw what I did before), but then I figured that just adding the showtext again would force the text to change so I went with that.