//MySQL DATA
forward UserCheck(playerid);
public UserCheck(playerid)
{
new num_rows, num_fields;
cache_get_data(num_rows,num_fields,Handle);
SetPlayerVirtualWorld(playerid,1);
if(num_rows = 0)
{
//Register
ClearChat(playerid);
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Neuanfang","Herzlich Willkommen,\n auf unserem Game Server: bitte gebe dein Password ein.","Register","Abbrechen");
}
else
{
//Login
ClearChat(playerid);
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Anmeldung","bitte gebe dein Password ein.","Login","Abbrechen");
}
return 1;
}
stock Spielername(playerid)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
return Name;
}
public OnPlayerConnect(playerid)
{
new query[256];
mysql_format(Handle, query, sizeof(query),"SELCET * FROM accounts WHERE Name='%e'",Spielername(playerid));
mysql_tquery(Handle,query,"UserCheck","i",playerid);
ClearChat(playerid);
TogglePlayerSpectating(playerid,1);
return 1;
}
enum Data{
db_id,
pName,
pLoggedIn,
pGeschlecht,
pSkin
};
Bitte umhilfe.