/Register command problem
#1

Hi. I have recently downloaded a BAdmin FS and everytime I /register it's like I didn't do anything. It should create a file on scriptfiles\BAdmin\Users but it doesn't, I don't know what I am doing wrong... help?
Reply
#2

Is it not supposed to create the file in Scriptfiles/BAdmin/Users? If so, does the BAdmin/Users file path exist in the Scriptfiles path?
Reply
#3

Quote:
Originally Posted by Shoulen
Посмотреть сообщение
Is it not supposed to create the file in Scriptfiles/BAdmin/Users? If so, does the BAdmin/Users file path exist in the Scriptfiles path?
Yes and yes. The problem is, it doesn't create, like it doesn't exist.
Reply
#4

What does the code look like?
Reply
#5

Quote:
Originally Posted by Shoulen
Посмотреть сообщение
What does the code look like?
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME];
new playerfile[100];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "BAdmin/Users/%s.ini",pname);
if(!dini_Exists(playerfile)) SendClientMessage(playerid, orange, "This username is available! Type /register to make an account.");
else if(dini_Exists(playerfile)) SendClientMessage(playerid, orange, "This username is registered! Type /login to log into your account.");
if(dini_Int(playerfile, "Banned") == 1)
{
new string1[126];
format(string1, sizeof(string1), "%s has been kicked for ban evading.", pname);
SendClientMessageToAll(red, string1);
}
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
if(logged[playerid] == 1)
{
new playerfile[100], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "BAdmin/Users/%s.ini",pname);
dini_IntSet(playerfile, "Level", level[playerid]);
dini_IntSet(playerfile, "Cash", GetPlayerMoney(playerid));
dini_IntSet(playerfile, "Score", GetPlayerScore(playerid));
}
level[playerid] = 0;
logged[playerid] = 0;
muted[playerid] = 0;
return 1;
}
Reply
#6

UPDATE: I have managed to figure it out that if I manually create the .ini file it works, it recognizes the User. The problem seems to be related in 'creating' when you join the server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)