Webpage Registration
#1

I have been scripting with my own RP gamemode using a MySQL.
We have been developing tons of ideas for the future UCP, PHP+MySQL.

We are now advancing to the idea, where in players have to register to our webpage & the Testers+ will approve it. However, How can i check if the pAccess is 0 or blah-blah, IN-GAME? If you need questions regardless on how our approval system is gonna work throughout the webpage, FERCOPRO will be replying you ~ The UCP Registration isn't done yet and we are just getting started.
Reply
#2

Yeah thats it, as Jake Elite said, if you guys got a doubt we can answer you.
Reply
#3

You could add the account into the database with a variable (let's call it PlayerApproved) =0.

When a tester+ confirms the registration, you set PlayerApproved to 1.

Then when the player goes ingame, you can check for rows in MYSQL where username = username and PlayerApproved = 1.
Reply
#4

The thing is, how can i do that i am still having some slight (little) problems with the MySQL.

How can i transfer the normal registration to the one with the pApprove var etc.

PHP код:
new query[200];
format(querysizeof(query), "SELECT * FROM `players` WHERE `username` = '%s' LIMIT 1"GetName(playerid));
mysql_query(query);
mysql_store_result();
new 
rows mysql_num_rows();

if(
rows)
{
    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD""col_lb"Login"""col_w"This account is registered to our database.\nInsert your password to login to your account.\n"col_r"If this is not your account, logged out and change your nickname.""Login""");
}
else
{
    
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD""col_lb"Register"""col_w"This account is not registered to our database.\nEnter your own password to create a new account.""Register""");
}
mysql_free_result(); 
Reply
#5

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
The thing is, how can i do that i am still having some slight (little) problems with the MySQL.

How can i transfer the normal registration to the one with the pApprove var etc.
PHP код:
new query[200];
format(querysizeof(query), "SELECT * FROM `players` WHERE `username` = '%s' LIMIT 1"GetName(playerid));
mysql_query(query);
mysql_store_result();
new 
rows mysql_num_rows();
new 
pApprove cache_get_field_content_int(0,"pApprove");
if(
rows)
{
    if(
pApprove == 0)
    {
        
//Player exists, but has not been approved yet.
    
}else{
        
//Player exists and HAS been approved.
        
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD""col_lb"Login"""col_w"This account is registered to our database.\nInsert your password to login to your account.\n"col_r"If this is not your account, logged out and change your nickname.""Login""");
    }
}
else
{
//Player does not exist.
    
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD""col_lb"Register"""col_w"This account is not registered to our database.\nEnter your own password to create a new account.""Register""");
}
mysql_free_result(); 
Taking the result for the pApprove variable and checking it in your code. Using cache, get the pApprove value from the database. if the player does exist, check if the account has also been approved.
Reply
#6

I am not using the Threaded Version of MySQL, mind if you show me the non threaded one?
Reply
#7

What do you mean by non-threaded? Are you using MYSQL Plugin R7?
Reply
#8

By i mean non threaded, I mean the older version, I am using R5-R6
Reply
#9

Something tells me you didn't script your gamemode. Otherwise you'd know how to do this.

So, when they register(on the website) and a tester+ approves it, set a variable - pApproved - to the account. This will then allow them to log in ingame.

So when they're ingame, you check if pApproved is set to 1. If it is, let them log in. This will only work if you're using the same database.
Reply
#10

I have to admit some parts of the gamemode are copy/pasted somewhere in the Tutorial Section, but yeah i scripted some of them (~ I left out some credits to the original author, I didn't just copy/pasted them however some of them are heavily modified by me, 20% (at least) of the script are copy/pasted).

The problem is how could i fetch / read the data for the Approval Part if they aren't registered etc.? It might cause error on the mySQL debug?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)