Hello everyone, this is KuRuMi^, aka DarkRaZoR^. How're y'all doing today? I'm doing great if you may ask. Okay, so I was working in my server and I seem to notice that my player's class was being modified for every player, therefore I took into a look in the code and I runned an experiment to determine the cause of it. The cause was Squirrel tables stored into my player's class. Here's how the experiment worked out.
Code: [Select]
Code: [Select]
Code: [Select]
So, I join and my data is set to the Squirrel table in the class, however, when another player joins with another nickname, their data is set to every player who has the same class. Could someone briefly explains this and a solution similar to what I want to do? Thank you for taking your time to read.
class Info
{
ID = 0;
Details = {
Name = "",
Age = 0,
Job = "Citizen"
};
}
infos <- array( GetMaxPlayers(), null );
infos[ player.ID ] = Info();
infos[ player.ID ].ID = player.ID;
infos[ player.ID ].Details.Name = player.Name;
if( player.Name != "TdZ.DarkRaZoR^" ) infos[ player.ID ].Details.Age = 15;
else infos[ player.ID ].Details.Age = 20;
So, I join and my data is set to the Squirrel table in the class, however, when another player joins with another nickname, their data is set to every player who has the same class. Could someone briefly explains this and a solution similar to what I want to do? Thank you for taking your time to read.