SA-MP Forums Archive
Creating a list? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Creating a list? (/showthread.php?tid=547384)



Creating a list? - Derexi - 22.11.2014

I am creating a status feature similar to ******** in my server and the statuses will be presented in a dialogue but I want to limit the list of shown statuses to 7. This means the last status on the list will have to be erased to make way for a new status. How do I limit the list so that only 7 statuses can be shown at one time?


Re: Creating a list? - Sellize - 22.11.2014

Everytime a new status is posted, move every other status variable to the next so

status 1 becomes 2 and so on.

This way you will only have 7


Re: Creating a list? - Derexi - 23.11.2014

Quote:
Originally Posted by Sellize
Посмотреть сообщение
Everytime a new status is posted, move every other status variable to the next so

status 1 becomes 2 and so on.

This way you will only have 7
This wouldn't work, would it? Because:

Status1 = Status2;
then Status2 = Status3; BUT Status2 has already been changed from its original text to the text of Status1, so every status would be made the same as Status1.


Re: Creating a list? - Derexi - 24.11.2014

Does ANYONE have an answer? :P


Re: Creating a list? - DavidBilla - 24.11.2014

No, status 1 changes to status 2
But status 2 changes only to status 3 not 1


Re: Creating a list? - Schneider - 24.11.2014

Quote:
Originally Posted by Sellize
Посмотреть сообщение
Everytime a new status is posted, move every other status variable to the next so
status 1 becomes 2 and so on.
This way you will only have 7
Do it the other way around and start at the bottom to avoid the problem Derexi mentions.

st7 = st6;
st6 = st5;
st5 = st4;
st4 = st3;
st3 = st2;
st2 = st1;
st1 = newstatus;