SA-MP Forums Archive
Why is this happanening? - 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: Why is this happanening? (/showthread.php?tid=607312)



Why is this happanening? - danielpalade - 17.05.2016

For some reason, whenever a player registers, some of its variables are set to some random values.
I have searched the script, and I didn't find anything near to those values. Also, it happens randomly, its not for every player.


Re: Why is this happanening? - Stinged - 18.05.2016

Are you resetting the variables when the player connects or disconnects?


Re: Why is this happanening? - shourya12 - 18.05.2016

can you show the codes of onplayerconnect and onplayerdisconnect?

would be helpful.


Re: Why is this happanening? - danielpalade - 18.05.2016

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Are you resetting the variables when the player connects or disconnects?
Yes I am.


Re: Why is this happanening? - BornHuman - 19.05.2016

I've had this issue before too. I never pinpointed the exact cause but my friend mentioned something about timers. Do you heavily rely on timers in your gamemode?


Re: Why is this happanening? - Vince - 19.05.2016

Variables being overwritten may be related to stack overflow. Run crashdetect.


Re: Why is this happanening? - justjamie - 19.05.2016

wow nice info
we can do something with this

.


Re: Why is this happanening? - danielpalade - 19.05.2016

Quote:
Originally Posted by justjamie
Посмотреть сообщение
wow nice info
we can do something with this

.
If I knew what the problem was or where it could be, I could probably give you some code.
But right now, I can't. Isn't that logical?


Re: Why is this happanening? - Nin9r - 19.05.2016

Can you set manually a value for all the variables on register? pVar1] = yourvalue etc.?


Re: Why is this happanening? - danielpalade - 19.05.2016

Quote:
Originally Posted by Nin9r
Посмотреть сообщение
Can you set manually a value for all the variables on register? pVar1] = yourvalue etc.?
I have the function ResetPlayerVariables wich set's the variables to it's default values.
This function is called when the player connects.
I could add it to the registration but I don't know, I'm afraid that it will do some harm.