Problem writing a simple login/register thing
#1

Hello, so I started scripting again.
So I am planning to remake one of my servers but this time withouth anything downloaded (especially the admin system), so I made a login / Register system based on a tutorial I saw here (I basically copied the code, but I know what's happening in the code so...)

So the problem is, when I connect, and I click spawn the game flashes and I get the message 'stay within the world boundaries', already deleted the addplayerclass and requestclass things, but still the same problem...

Here's the OnPlayerConnect code:
pawn Код:
public OnPlayerConnect(playerid)
{
    new file[64],PlayerName[25];//Creating a variable where we can store the file path, and the variable to store the player's name.
    GetPlayerName(playerid,PlayerName,sizeof PlayerName);//Storing the players name in the PlayerName variable.
    format(file,sizeof file,"Admin/%s.ini",PlayerName);//Storing the file path with the players name.
    if(!fexist(file))//Checking if the file exists
    {//Here goes the stuff you want to do if the user is not registered.
        SendClientMessage(playerid, COLOR_RED ,"You are not registered! Please use /register <password>");
    }
    else
    {//Here goes the stuff you want to do if the user is registered.
        SendClientMessage(playerid, COLOR_RED ,"You are registered! Use /login <password>");
    }
    return 1;
}
Do you know what could be wrong?
Thanks in advance
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)