Hallo. Habe grade ein Login/Register System gemacht.
Allerdings wenn ich in den Server geh, kann ich nur auf "Spawn" drücken, also es erscheint kein Login / Register dialog..
Dialoge:
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
OnPlayerConecct:
//Login/Register
new name[MAX_PLAYER_NAME],query[128];
GetPlayerName(playerid,name,sizeof(name));
format(query,sizeof(query),"SELECT id FROM user WHERE username='%s'",name);
mysql_function_query(dbhandle,query,true,"OnUserCheck","i",playerid);
return 1;
OnUserCheck:
public OnUserCheck(playerid)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==0)
{
//Registrierung
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrierung","Gib bitte dein gewünschtes Passwort ein:","Okay","Abbrechen");
}
else
{
//Login
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"RP Login","Gib bitte dein Passwort ein:","Okay","Abbrechen");
}
return 1;
}
MFG