20.05.2014, 18:43
on player connect
LogRegCheck:
if rows, ShowPlayerDialog login dialog..
if !rows kick player, i have a php register system..
login dialog:
PHP код:
mysql_format(sqldb, query, sizeof(query), "SELECT * FROM users WHERE nev = '%e' LIMIT 0,1", GetName(playerid));
mysql_tquery(sqldb, query, "LogRegCheck", "i", playerid);
if rows, ShowPlayerDialog login dialog..
if !rows kick player, i have a php register system..
login dialog:
PHP код:
if(dialogid == LOGIN_DIALOG)
{
if(!response) return Kick(playerid);
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, LOGIN_DIALOG, DIALOG_STYLE_PASSWORD, "Red River RPG", "Нrd be a jelszvad a folytatбshoz!", "Tovбbb", "Mйgsem");
if(strcmp(inputtext, PlayerInfo[playerid][pJelszo], true) == 0)
{
PlayerTextDrawShow(playerid, PlayerText:LGRPG);
SendClientMessage(playerid, COLOR_SIKERES, "Sikeres bejelentkezйs!");
SpawnPlayer(playerid);
}
else
{
SendClientMessage(playerid, COLOR_ADMWARN, "Rossz jelszу!");
ShowPlayerDialog(playerid, LOGIN_DIALOG, DIALOG_STYLE_PASSWORD, "Red River RPG", "Нrd be a jelszvad a folytatбshoz!", "Tovбbb", "Mйgsem");
}
return 1;
}