public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_REGISTER)
{
if(response)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>3)
{
new query[600],wachtwoord[35],playerserial[128],playerip[32];
//register function
gpci(playerid,playerserial,sizeof(playerserial));
GetPlayerIp(playerid,playerip,32);
mysql_escape_string(inputtext,wachtwoord,dbhandle);
format(query,sizeof(query),"INSERT INTO user (username,password,power,level,skin,money,radio,freq1,freq2,freq3,freq4,freq5,playerteam,regip,reggpci,rpoints,playertime,bank)VALUES ('%s','%s','0','1','20','10000','0','666666','666666','666666','666666','666666','255','%s','%s','0','0','10000')",name,wachtwoord,playerip,playerserial);
mysql_function_query(dbhandle,query,false,"","",playerid);
new query1[128];
mysql_escape_string(inputtext,wachtwoord,dbhandle);
format(query1,sizeof(query1),"SELECT * FROM user WHERE username='%s' AND password ='%s'",name,wachtwoord);
mysql_function_query(dbhandle,query1,true,"OnPasswordResponse","i",playerid);
}
}
else
{
Kick(playerid);
}
if(dialogid==DIALOG_LOGIN)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],wachtwoord[35];
GetPlayerName(playerid,name,sizeof(name));
mysql_escape_string(inputtext,wachtwoord,dbhandle);
format(query,sizeof(query),"SELECT * FROM user WHERE username='%s' AND password ='%s'",name,wachtwoord);
mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
}
else
{
//niks ingegevoert
SendClientMessage(playerid,COLOR_RED,"Please enter your password.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Please enter your password","Confirm","Cancel");
}
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_REGISTER)
{
if(response)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>3)
new query[600],wachtwoord[35],playerserial[128],playerip[32];
//register function
gpci(playerid,playerserial,sizeof(playerserial));
GetPlayerIp(playerid,playerip,32);
mysql_escape_string(inputtext,wachtwoord,dbhandle);
format(query,sizeof(query),"INSERT INTO user (username,password,power,level,skin,money,radio,freq1,freq2,freq3,freq4,freq5,playerteam,regip,reggpci,rpoints,playertime,bank)VALUES ('%s','%s','0','1','20','10000','0','666666','666666','666666','666666','666666','255','%s','%s','0','0','10000')",name,wachtwoord,playerip,playerserial);
mysql_function_query(dbhandle,query,false,"","",playerid);
new query1[128];
mysql_escape_string(inputtext,wachtwoord,dbhandle);
format(query1,sizeof(query1),"SELECT * FROM user WHERE username='%s' AND password ='%s'",name,wachtwoord);
mysql_function_query(dbhandle,query1,true,"OnPasswordResponse","i",playerid);
}
else
{
Kick(playerid);
}
if(dialogid==DIALOG_LOGIN)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],wachtwoord[35];
GetPlayerName(playerid,name,sizeof(name));
mysql_escape_string(inputtext,wachtwoord,dbhandle);
format(query,sizeof(query),"SELECT * FROM user WHERE username='%s' AND password ='%s'",name,wachtwoord);
mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
}
else
{
//niks ingegevoert
SendClientMessage(playerid,COLOR_RED,"Please enter your password.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Please enter your password","Confirm","Cancel");
}
}
}
Why there is no indentation?
Try this : PHP код:
|
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_REGISTER)
{
if(response)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>3)
new query[600],wachtwoord[35],playerserial[128],playerip[32];
//register function
gpci(playerid,playerserial,sizeof(playerserial));
GetPlayerIp(playerid,playerip,32);
mysql_escape_string(inputtext,wachtwoord,dbhandle);
format(query,sizeof(query),"INSERT INTO user (username,password,power,level,skin,money,radio,freq1,freq2,freq3,freq4,freq5,playerteam,regip,reggpci,rpoints,playertime,bank)VALUES ('%s','%s','0','1','20','10000','0','666666','666666','666666','666666','666666','255','%s','%s','0','0','10000')",name,wachtwoord,playerip,playerserial);
mysql_function_query(dbhandle,query,false,"","",playerid);
new query1[128];
mysql_escape_string(inputtext,wachtwoord,dbhandle);
format(query1,sizeof(query1),"SELECT * FROM user WHERE username='%s' AND password ='%s'",name,wachtwoord);
mysql_function_query(dbhandle,query1,true,"OnPasswordResponse","i",playerid);
}
else
{
Kick(playerid);
}
}
if(dialogid==DIALOG_LOGIN)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],wachtwoord[35];
GetPlayerName(playerid,name,sizeof(name));
mysql_escape_string(inputtext,wachtwoord,dbhandle);
format(query,sizeof(query),"SELECT * FROM user WHERE username='%s' AND password ='%s'",name,wachtwoord);
mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
}
else
{
//niks ingegevoert
SendClientMessage(playerid,COLOR_RED,"Please enter your password.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Please enter your password","Confirm","Cancel");
}
}
}
PHP код:
|