hi,
While working on a simple(should be simple) adminchat script. i Discovered a annoying issue i cannot solve.
The script stores the messages in a textfile.
After typing a message or entering the adminchat it loads the messages from the file. This works as it should be.
But the right sequence of those messages are totally lost.
Example: When you write a message : "2". and the next message is "1". That message will load above the previous message "2". And the message after that: "3". Load below "2".
Could someone give me a helping hand?
Fun fact: I have created a AdminLog system and i cannot solve this LOL.
hi, i have a weird issue with getting data from the array's.
I have convert some Var's with ToNum(). But somehow it doesnt save/get the data from the previous Var from the array i've set.
Has it something todo with the For - EndFor loop?? Because the previous projects with array works flawless.
ENDFOR openPrivButton( "ServerRulesClose",70,$AP_HT+19,60,5,5,-1,16, "^3OK",AdminPanelOther2); #This doesnt work if you copy this code hahah EndSub
Sub ServerRuleSet( $id, $argv ) $Rule[ToNum(trim(subStr( $id,14 )))] = $argv; #ToNum(trim(subStr( $id,14 ))) = trim first 14 chars and convert it to ToNum() SetServerRules(0,0); EndSub ?>
I know it is something easy, but i cannot find it. LOL
Looked at it, scratched my head a few times, had a couple of goes at it, scratched my head a bit more and then came up with the solution.
It turned out that the array was cleared every time a value was added (I used dumpvar(name_of_the_array)) to monitor that.
Adding a simple "". before the $argv was added, solved that issue.
Sub SetServerRules($keyflags,$id) $AP_HT = 52; #Local Var closeadminpanelother2(); #A close function openPrivButton( "ServerRulesChangeTitle",70,$AP_HT+10,60,4,4,-1,96, "^2blablahblah %nl%^2WAAAW new line blablabnla!");
openPrivButton( "ServerRulesClose",70,$AP_HT+19,60,5,5,-1,16, "^3OK",AdminPanelOther2); #This doesnt work if you copy this code hahah EndSub
Sub ServerRuleSet( $id, $argv ) $Rule[ToNum(trim(subStr( $id,14 )))] = "".$argv; #ToNum(trim(subStr( $id,14 ))) = trim first 14 chars and convert it to ToNum() SetServerRules(0,0); EndSub