Posts: 191
Threads: 37
Joined: Mar 2017
Reputation:
0
Okay so first i was i/a on scripting for a while and now i came back so basicly i dont really have any idea where i left my things , i started testing group system ingame and i found something wrong with it , heres the thing.
If i create 2 groups for example
G 1 named Leos Group - first logged acc
G 2 named Lazys Group - second logged acc
While im still ingame it works but once i quit with both accounts and then login with second acc i get the infos of group 1 , and if i login with first acc i get second's group info
Can you please help me , let me know which code part do you need so i can bring them up.
Also the saving system is MYSQL
Table are
1- ID / 2- GroupName / 3 - GroupLeader which saves the ID/name and the owner.
Posts: 228
Threads: 25
Joined: Jan 2015
Reputation:
0
You're asking which code part but you haven't provided your code, so how do you expect someone to see an issue without having the code?
Posts: 1,801
Threads: 21
Joined: Mar 2008
Reputation:
0
You should post the code for when the group is created (command I guess), how it's saved and of course how it is loaded.
Posts: 191
Threads: 37
Joined: Mar 2017
Reputation:
0
please help me i really need this
Posts: 6,242
Threads: 8
Joined: Jun 2008
OnPlayerDisconnect doesn't have code to make the 'groups' for that ID, removed?
This is more a common rookie mistake, as everything, upon disconnection, should be set to invalid IDs so this doesn't happen.
Case in point, is when you have an admin system, if there's a disconnection it HAS to be cleared, or the next person to connect will have admin status.
Posts: 191
Threads: 37
Joined: Mar 2017
Reputation:
0
I have set the Playerinfo groupid to -1 while he quits at OnPlayerDisconnect but not GroupInfo[playerid][GroupID](cuz it doesnt really do anything) Now if i set GroupID to -1 and create new group it stays -1 all the time even when i quit , i dont really see where's the problem right now, i've debugged the /g showing the ID of PlayerInfo[playerid][pGroup] and its same with the DB's one but GroupInfo[playerid][groupID] its not its either 0 or -1
Posts: 6,242
Threads: 8
Joined: Jun 2008
Quote:
Originally Posted by LazzyBoy
I have set the Playerinfo groupid to -1 while he quits at OnPlayerDisconnect but not GroupInfo[playerid][GroupID](cuz it doesnt really do anything) Now if i set GroupID to -1 and create new group it stays -1 all the time even when i quit , i dont really see where's the problem right now, i've debugged the /g showing the ID of PlayerInfo[playerid][pGroup] and its same with the DB's one but GroupInfo[playerid][groupID] its not its either 0 or -1
|
Код:
PlayerInfo[playerid][pGroup] = groupid;
That line is causing -1 to be the new group tag...
You really need to be looking at this code more.