[Tutorial] [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool]
#33

As I am new to this mysql thingy, I can't answer your question, if I would I'd lie anyways.
Anyways, this my onplayerconnect and OnAccountCheck

PHP Code:
public OnPlayerConnect(playerid)
{
    new 
query[128], pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    
TogglePlayerSpectating(playerid1);
    
mysql_format(mysqlquerysizeof query"SELECT 'Password', 'ID' FROM 'accounts' WHERE 'Name' = '%e' LIMIT 1"pName);
     
mysql_tquery(mysqlquery"OnAccountCheck""i"playerid);
    
SendClientMessage(playeridCOLOR_GREEN"Awoo welcome back homie!");
    return 
1;

PHP Code:
forward OnAccountCheck(playerid);
public 
OnAccountCheck(playerid)
{
    new 
rowsfields;
    
cache_get_data(rowsfieldsmysql);
    if(
rows)
    {
        
cache_get_field_content(0"Password"PlayerInfo[playerid][pPassword], mysql129);
        
PlayerInfo[playerid][pID] = cache_get_field_content_int(0"ID");
        
ShowPlayerDialog(playeridLoginDialogDIALOG_STYLE_PASSWORD"Welcome Enter your password to login""Test Server""Login""Cancel");
    }
    else
    {
        
ShowPlayerDialog(playeridRegisterDialogDIALOG_STYLE_PASSWORD"Welcome Create a password to register""Test Server","Register""Cancel");
    }
    return 
1;

Reply


Messages In This Thread
[UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 19.05.2015, 20:48
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Konstantinos - 19.05.2015, 21:25
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 19.05.2015, 21:29
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by MikE1990 - 20.05.2015, 13:47
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by sammp - 20.05.2015, 15:03
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 20.05.2015, 15:06
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by SKAzini - 20.05.2015, 17:54
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 20.05.2015, 17:57
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Antonio144 - 28.05.2015, 17:51
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 29.05.2015, 14:25
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by BR3TT - 29.05.2015, 23:54
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by AndySedeyn - 30.05.2015, 06:11
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by BR3TT - 30.05.2015, 08:04
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by AndySedeyn - 30.05.2015, 08:27
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 30.05.2015, 08:39
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by BR3TT - 30.05.2015, 10:38
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by STONEGOLD - 11.06.2015, 01:20
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 11.06.2015, 16:34
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by STONEGOLD - 11.06.2015, 19:39
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by dudu.r.oliveira - 13.06.2015, 15:46
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Denis1 - 15.06.2015, 13:01
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 15.06.2015, 14:33
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by MD5 - 15.06.2015, 16:49
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 15.06.2015, 17:07
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by sonanclar - 16.06.2015, 01:57
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by JaydenJason - 03.07.2015, 10:14
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by AchievementMaster360 - 10.07.2015, 17:42
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 10.07.2015, 18:01
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Billeen - 20.07.2015, 14:10
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Overhaul - 20.07.2015, 14:21
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by saffierr - 18.03.2016, 13:09
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by AndySedeyn - 18.03.2016, 13:12
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by saffierr - 18.03.2016, 13:15
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by AndySedeyn - 18.03.2016, 13:29
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by saffierr - 18.03.2016, 17:07
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by AndySedeyn - 18.03.2016, 17:32
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Konstantinos - 12.06.2016, 21:36
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by WhiteGhost - 12.06.2016, 23:23
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Slawiii - 13.06.2016, 00:49
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Konstantinos - 13.06.2016, 10:13
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Problems - 16.06.2016, 16:03
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by AndySedeyn - 18.06.2016, 08:55
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Ankon - 02.07.2016, 10:55
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by faizal16 - 30.10.2016, 05:44
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Tenka - 01.12.2016, 05:15
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by AndySedeyn - 01.12.2016, 18:36
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Dorito - 04.12.2016, 09:25
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by KNIGHT786 - 07.12.2016, 13:33
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Yaa - 07.12.2016, 13:34
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by eikzdej - 14.01.2017, 01:42
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Lordzy - 14.01.2017, 04:49
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by eikzdej - 14.01.2017, 11:07
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by Lordzy - 14.01.2017, 14:00
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by justinnater - 18.01.2017, 09:48
Re: [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool] - by JudyMoody - 24.03.2018, 12:17

Forum Jump:


Users browsing this thread: 12 Guest(s)