Hey,
Irgendwie kommt wenn ich mich einlogge kein Registrier o. Login Fester
Normaler weiße müsste nach dem Connect ein Fester kommen
Aber momentan nicht
public OnPlayerConnect(playerid)
{
strdel(Query,0,STR_LEN);
for(new x; pStats:x < pStats; x++) PlayerInfo[playerid][pStats:x] = 0;
GetPlayerName(playerid,PlayerInfo[playerid][pName],20);
SendClientMessage(playerid,-1,"Willkommen auf dem Server");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(player_loged_in{playerid})
{
SavePlayerData(playerid);
player_loged_in{playerid}=false;
enter_password_try{playerid}=0;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(player_loged_in{playerid}==false)return Kick(playerid);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
printf("Hallo3");
TogglePlayerSpectating(playerid,1);
SetTimerEx("LoginCamera", 100, false, "i", playerid);
printf("Hallo1");
return 1;
}
public LoginCamera(playerid)
{
printf("Hallo");
SetPlayerCameraPos(playerid,-201.4289,1372.9482,67.0541);
SetPlayerCameraLookAt(playerid,204.4058,0,0);
mysql_format(m_connect,Query,"SELECT `Password`,`LastLogin` FROM `accounts` WHERE `Name` = '%e'",PlayerName(playerid));
mysql_function_query(m_connect,Query,true,"OnPlayerCheckAccount","i", playerid);
return 1;
}
public OnPlayerCheckAccount(playerid)
{
new row, field;
cache_get_data(row,field);
if(!row)return ShowPlayerDialog(playerid, DIALOG_REGISTER_ACCEPT, DIALOG_STYLE_MSGBOX,"Registrierung",DIALOG_REGISTER_ACCEPT_TEXT,"Weiter","Abbrechen");
else{
cache_get_field_content(0,"Password",PlayerInfo[playerid][pPassword]);
cache_get_field_content(0,"LastLogin",PlayerInfo[playerid][pLastLogin]);
cache_get_field_content(0,"Ban",PlayerInfo[playerid][pBan]);
if(PlayerInfo[playerid][pBan] == 1)return Kick(playerid);
strdel(Query,0,STR_LEN);
strdel(ALLSTRING,0,sizeof(ALLSTRING));
format(ALLSTRING,64,"Passworteingabe | Letzer Login: {FF8C00}%s",PlayerInfo[playerid][pLastLogin]);
SendClientMessage(playerid,-1,"Dein Account wurde gefunden. Bitte logge dich ein.");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login",ALLSTRING,"Anmelden","Abbrechen");
}
return 1;
}
Woran liegt es??
MFG