Keeping track of reconnecting players before map change
1 Attachment(s)
Ok, thats it, my eyes are like footballs after trying to find the reason of a bug in my script. A lot of stuff is going on and working, except for keeping track of returning players.
When a player triggers a goal model his authid is saved in the array finishContainer in function goal_touch. When someone is connecting a client_authorized loops through finishContainer to see if the player reconnected. Its a random error, sometimes it works, and sometimes not. finishContainer is a global array defined Code:
The authid is saved in function goal_touch Code:
And the loop in Code:
If the authid is stored in finishContainer it calls msgToReconnect, which shows a welcome back message. But, it do it with new players to sometimes. In these cases finishContainer[loopId] = 0. How can finishContainer[loopId] which is 0 be equal to authid :?: :?: :?: which clearly contains the authid? Am I doing something wrong returning the array content from goal_touch? I would really appreciate help with this problem. Its one of the last parts before cleaning it up and releasing it. Thx /Lt |
equali returns 0 if it didn't find anything, 1 if it did. you are checking to see if it does not equal -1, so this condition will always return true. you are confusing this with containi in which it returns -1 when nothing is found but sometimes 0 if something is.
|
Quote:
|
Code:
Solved :!: Changed the for loop. Slot 0 of finishContainer[loopId] was empty. The for loop never reached 1. Probably something I should know with arrays, but well, i learned now. |
| All times are GMT -4. The time now is 20:26. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.