Guten Abend,
Wieso funktioniert das public nicht
( Theard_OnPlayerResponse)
public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields);
printf("Query with result id %d has finished! (Connection ID %d | Query: %s)",resultid,connectionHandle,query);
switch(resultid)
{
case Theard_OnCheckPlayer:
{
if(num_rows)
{
ShowPlayerDialog(extraid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Bitte gebe dein Passwort an","Einloggen","Abbrechen");
}
else
{
ShowPlayerDialog(extraid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Registrierung","Bitte gebe dein Passwort an","Weiter","Abbrechen");
}
return 1;
}
case Theard_OnPlayerResponse:
{
if(num_rows != 0)
{
pInfo[extraid][pAdmin] = cache_get_field(0,"AdminScore");
pInfo[extraid][SQLid] = cache_get_field(0,"ID");
pInfo[extraid][pChar] = cache_get_field(0,"Char");
setPlayerMoney(extraid,cache_get_field(0,"Money"),0);
setPlayerScore(extraid,cache_get_field(0,"Score"));
if(pInfo[extraid][pChar] == 0)
{
pInfo[extraid][pChar] = 101;
}
pInfo[extraid][pLoggedin] = 1;
SpawnPlayer(extraid);
return 1;
}
else
{
ShowPlayerDialog(resultid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Passwort Falsch!\n\nBitte gebe dein Passwort an","Einloggen","Abbrechen");
}
return 1;
}
default:
{
}
}
return 1;
}
mysql log:
Code
[17:08:18] >> mysql_connect(127.0.0.1, root, selfmade::samp, ******) on port 3306[17:08:18] CMySQLHandler::CMySQLHandler() - constructor called.[17:08:18] CMySQLHandler::CMySQLHandler() - Connecting to "127.0.0.1" | DB: "selfmade::samp" | Username: "root"[17:08:18] CMySQLHandler::Connect() - Connection was successful.[17:08:18] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.[17:08:48] >> mysql_query_callback( Connection handle: 1 )[17:08:48] Passing query SELECT `User` FROM `accounts_main` WHERE `User`='Fabi.StaR' | sii[17:08:48] ProcessQueryThread(OnQueryFinish) - Query was successful. (SELECT `User` FROM `accounts_main` WHERE `User`='Fabi.StaR')[17:08:48] ProcessQueryThread(OnQueryFinish) - Data caching enabled.[17:08:48] CMySQLHandler::StoreResult() - Result was stored.[17:08:48] CMySQLHandler::FreeResult() - Result was successfully free'd.[17:08:48] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()[17:08:48] OnQueryFinish(sii) - Threaded function called.[17:08:48] >> cache_get_data( Connection handle: 1 )[17:08:48] ProcessTick() - The cache has been cleared.[17:08:51] >> mysql_query_callback( Connection handle: 1 )[17:08:51] Passing query SELECT * FROM `accounts_main` VALUES `User`='Fabi.StaR' AND `Password`=md5('23021997') LIMIT 1 | sdi[17:08:51] CMySQLHandler::ProcessQueryThread() - Error will be triggered to OnQueryError()