SA-MP Forums Archive
HELP How can i stop using the normal file system and just use the mySQL data bas - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HELP How can i stop using the normal file system and just use the mySQL data bas (/showthread.php?tid=115672)



HELP How can i stop using the normal file system and just use the mySQL data bas - Jimmyhead521 - 25.12.2009

Hello, I have mySQL on my server installed but it still creates the normal *.ini file userdata and I don't want that i just want mySQL!
Please help?


Re: HELP How can i stop using the normal file system and just use the mySQL data bas - Martin_M - 25.12.2009

I think your registration system left with Dini.
Change it to MySQL registration.


Re: HELP How can i stop using the normal file system and just use the mySQL data bas - Jimmyhead521 - 25.12.2009

yes i have... its got both lol shall i delete the ini login system?


Re: HELP How can i stop using the normal file system and just use the mySQL data bas - Jimmyhead521 - 25.12.2009

Old script.... I've removed the following ing red and below is the script im using now..
Quote:

//-------------------------------[Login]--------------------------------------------------------------------------
if (strcmp(cmd, "/login", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
new tmppass[64];
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /login [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
return 1;
}
if (strcmp(cmd, "/register", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "/accounts/%s.ini", sendername);
new File: hFile = fopen(string, io_read)
if (hFile)

{
SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
fclose(hFile);
return 1;
}
new tmppass[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /register [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
return 1;
}
//----------------------------------[ooc]-----------------------------------------------

Changed....
Quote:

//-------------------------------[Login]--------------------------------------------------------------------------
if (strcmp(cmd, "/login", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
new tmppass[64];
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /login [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
return 1;
}
if (strcmp(cmd, "/register", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
return 1;
}
{
SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
return 1;
}
new tmppass[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /register [password]");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
return 1;
}
//----------------------------------[ooc]-----------------------------------------------

It compiled really well but I now cant register using the above script. any ideas??


Re: HELP How can i stop using the normal file system and just use the mySQL data bas - Martin_M - 25.12.2009

Well. You must to remove Dini registration and build MySQL registration. I'm too right now studying MySQL. My advice to you - find some a good scripter, who is friendly and learn MySQL and start to script with him. I'm doing like that and it helps.