Master account system issue with double logins.
#1

So I have made a master account system. (You login with Stefhan, then pick a character e.g Sean Johnson and your name is set to it.)

This causes other players to be able to connect with Stefhan and even though he is already online, you can join and spawn with another or the same character, because the name isn't taken. Obviously this isn't ment to happen.

How do I prevent this? I put this on OnPlayerConnect but it doesn't work and gives me this error.

PHP Code:
public OnPlayerConnect(playerid)
{
    foreach(new 
i:Player)
    {
        new 
name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        if(
Account[i][Username] == name)
        {
            
SendClientMessage(playeridCOLOR_ERROR"Someone is already connected with this account.") && SendClientMessage(playeridCOLOR_INFO"Please login with a different username.");
            
SetTimerEx("KickTimer"200false"i"playerid);
        }
    }
    return 
1;

PHP Code:
error 033: array must be indexed (variable "name"
Reply


Messages In This Thread
Master account system issue with double logins. - by Stefhan - 14.04.2019, 12:24
Re: Master account system issue with double logins. - by Boarden - 14.04.2019, 12:43
Re: Master account system issue with double logins. - by Stefhan - 14.04.2019, 12:52

Forum Jump:


Users browsing this thread: 1 Guest(s)