Ich versuche einemöglichkeeit zu scripten um Accounts aus MYSQL zu laden
doch nach dem ich mein PW eingegeben habe schmiert der Server ab und keine der
printf Messeges sind in der server log einer ne Ahnung???
Benutze diese Hilfe
MySQL INC -> ADreNaLiNe's SAMP MySQL Plugin
if(dialogid == LOGGIN)
{
if(response == 1)
{
new namestring[256];
format (namestring,sizeof(namestring),"Name='%s'",PlayerName(playerid));
if (QueryMySQL("*","spieler",namestring,"")>0)
{
while(samp_mysql_fetch_row(mysqlresult))
{
Account[playerid][Name]=GetMySQLField("Name");
printf("%s",Account[playerid][Name]);
Account[playerid][Passwort]=GetMySQLField("Passwort");
printf("%s",Account[playerid][Passwort]);
Account[playerid][Money]=GetMySQLField_Int("Money");
Account[playerid][Admin]=GetMySQLField_Int("Admin");
Account[playerid][Kills]=GetMySQLField_Int("Kills");
Account[playerid][Deaths]=GetMySQLField_Int("Deaths");
Account[playerid][Logins]=GetMySQLField_Int("Logins");
Account[playerid][Freischaltung]=GetMySQLField_Int("Freischaltung");
Account[playerid][x]=GetMySQLField_Float("X");
Account[playerid][y]=GetMySQLField_Float("Y");
printf("%f",Account[playerid][x]);
Account[playerid][z]=GetMySQLField_Float("Z");
Account[playerid][cx]=GetMySQLField_Float("CX");
Account[playerid][cy]=GetMySQLField_Float("CY");
Account[playerid][cz]=GetMySQLField_Float("CZ");
Account[playerid][hx]=GetMySQLField_Float("HX");
Account[playerid][hy]=GetMySQLField_Float("HY");
Account[playerid][hz]=GetMySQLField_Float("HZ");
Account[playerid][Crashed]=GetMySQLField_Int("Crashed");
Account[playerid][Skin]=GetMySQLField_Int("Skin");
Account[playerid][Dienst]=GetMySQLField_Int("Dienst");
Account[playerid][Polizist]=GetMySQLField_Int("Polizist");
Account[playerid][PolizeiSkin]=GetMySQLField_Int("PolizeiSkin");
Account[playerid][ADAC]=GetMySQLField_Int("ADAC");
Account[playerid][ADACSkin]=GetMySQLField_Int("ADACSkin");
Account[playerid][FL]=GetMySQLField_Int("FL");
Account[playerid][FLSkin]=GetMySQLField_Int("FLSkin");
Account[playerid][Wang]=GetMySQLField_Int("Wang");
Account[playerid][WangSkin]=GetMySQLField_Int("WangSkin");
Account[playerid][Sani]=GetMySQLField_Int("Sani");
Account[playerid][SaniSkin]=GetMySQLField_Int("SaniSkin");
Account[playerid][Mrad]=GetMySQLField_Int("Mrad");
Account[playerid][MradSkin]=GetMySQLField_Int("MradSkin");
Account[playerid][HM]=GetMySQLField_Int("HM");
Account[playerid][HMSkin]=GetMySQLField_Int("HMSkin");
Account[playerid][Yakuza]=GetMySQLField_Int("Yakuza");
Account[playerid][YakuzaSkin]=GetMySQLField_Int("YakuzaSkin");
Account[playerid][Sport]=GetMySQLField_Int("Sport");
Account[playerid][SportSkin]=GetMySQLField_Int("SportSkin");
Account[playerid][Fire]=GetMySQLField_Int("Fire");
Account[playerid][FireSkin]=GetMySQLField_Int("FireSkin");
Account[playerid][GBWH]=GetMySQLField_Int("GBWH");
Account[playerid][GBWHSkin]=GetMySQLField_Int("GBWHSkin");
Account[playerid][MAL]=GetMySQLField_Int("MAL");
Account[playerid][MALSkin]=GetMySQLField_Int("MALSkin");
Account[playerid][OFFR]=GetMySQLField_Int("OFFR");
Account[playerid][OFFRSkin]=GetMySQLField_Int("OFFRSkin");
Account[playerid][AutoS]=GetMySQLField_Int("AutoS");
Account[playerid][Mrad50S]=GetMySQLField_Int("Mrad50S");
Account[playerid][Mrad125S]=GetMySQLField_Int("Mrad125S");
Account[playerid][Mrad150S]=GetMySQLField_Int("Mrad150S");
Account[playerid][HeliS]=GetMySQLField_Int("HeliS");
Account[playerid][FlugS]=GetMySQLField_Int("FlugS");
Account[playerid][LKWS]=GetMySQLField_Int("LKWS");
Account[playerid][BootS]=GetMySQLField_Int("BootS");
Account[playerid][WaffenS]=GetMySQLField_Int("WaffenS");
Account[playerid][Jailed]=GetMySQLField_Int("Jailed");
Account[playerid][JailTime]=GetMySQLField_Int("JailTime");
Account[playerid][Perso]=GetMySQLField_Int("Perso");
Account[playerid][Health]=GetMySQLField_Float("Health");
Account[playerid][Betrunken]=GetMySQLField_Int("Betrunken");
Account[playerid][Drogen]=GetMySQLField_Int("Drogen");
Account[playerid][Bank]=GetMySQLField_Int("Bank");
Account[playerid][PayDayTime]=GetMySQLField_Int("PayDayTime");
Account[playerid][JobPayDayTime]=GetMySQLField_Int("JobPayDayTime");
Account[playerid][Navi]=GetMySQLField_Int("Navi");
Account[playerid][Feuerzeug]=GetMySQLField_Int("Feuerzeug");
Account[playerid][Zigaretten]=GetMySQLField_Int("Zigaretten");
Account[playerid][Bier]=GetMySQLField_Int("Bier");
Account[playerid][Wein]=GetMySQLField_Int("Wein");
Account[playerid][LapTop]=GetMySQLField_Int("LapTop");
Account[playerid][Waffe1]=GetMySQLField_Int("Waffe1");
Account[playerid][Waffe1Muni]=GetMySQLField_Int("Waffe1Muni");
Account[playerid][Waffe2]=GetMySQLField_Int("Waffe2");
Account[playerid][Waffe2Muni]=GetMySQLField_Int("Waffe2Muni");
Account[playerid][Waffe3]=GetMySQLField_Int("Waffe3");
Account[playerid][Waffe3Muni]=GetMySQLField_Int("Waffe3Muni");
Account[playerid][Waffe4]=GetMySQLField_Int("Waffe4");
Account[playerid][Waffe4Muni]=GetMySQLField_Int("Waffe4Muni");
Account[playerid][GBWHPKasse]=GetMySQLField_Int("GBWHPKasse");
Account[playerid][Versicherung]=GetMySQLField_Int("Versicherung");
Account[playerid][Versicherungskosten]=GetMySQLField_Int("Versicherungskosten");
Account[playerid][Armour]=GetMySQLField_Float("Armour");
Account[playerid][pHaus]=GetMySQLField_Int("pHaus");
Account[playerid][pMietkosten]=GetMySQLField_Int("pMietkosten");
Account[playerid][pGemietet]=GetMySQLField_Int("pGemietet");
Account[playerid][Wohnung]=GetMySQLField_Int("Wohnung");
printf("allet ok");
if (strlen(inputtext) && strcmp(inputtext, Account[playerid][Passwort], true) == 0)
{
printf("allet ok2 ");
SetPlayerScore(playerid,Account[playerid][Admin]);
GivePlayerMoney(playerid,Account[playerid][Money]);
SCM(playerid,COLOR_YELLOW,"Du hast dich erfolgreich eingeloggt!");
format(str,sizeof(str),"%s hat [RoA] - Reallife on Air betreten",PlayerName(playerid));
SCMTA(COLOR_ASKQ,str);
StartPayDayTime(playerid);
SetPlayerColor(playerid,COLOR_TWHITE);
Account[playerid][LoggedIn] = 1;
TPC(playerid,1);
SPVW(playerid,0);
SetCameraBehindPlayer(playerid);
if(Account[playerid][Freischaltung] != 1)
{
SPVW(playerid,99);
return 1;
}
if(Account[playerid][Waffe1] != 0)
{
GivePlayerWeapon(playerid,Account[playerid][Waffe1],Account[playerid][Waffe1Muni]);
return 1;
}
if(Account[playerid][Waffe2] != 0)
{
GivePlayerWeapon(playerid,Account[playerid][Waffe2],Account[playerid][Waffe2Muni]);
return 1;
}
if(Account[playerid][Waffe3] != 0)
{
GivePlayerWeapon(playerid,Account[playerid][Waffe3],Account[playerid][Waffe3Muni]);
return 1;
}
if(Account[playerid][Waffe4] != 0)
{
GivePlayerWeapon(playerid,Account[playerid][Waffe4],Account[playerid][Waffe4Muni]);
return 1;
}
if(Account[playerid][Wein] == 1)
{
GivePlayerAlc(playerid,1);
return 1;
}
if(Account[playerid][Drogen] < 1)
{
GivePlayerDrugs(playerid,Account[playerid][Drogen]);
return 1;
}
if(Account[playerid][Bier] == 1)
{
GivePlayerAlc(playerid,1);
return 1;
}
if(Account[playerid][Zigaretten] < 0)
{
GivePlayerCigarette(playerid,Account[playerid][Zigaretten]);
return 1;
}
return 1;
}
else
{
Account[playerid][LoginFails]++;
if(Account[playerid][LoginFails] == 1)
{SCM(playerid,COLOR_LIGHTRED, "Falsches Passwort! Du hast noch 2 Versuche");}
if(Account[playerid][LoginFails] == 2)
{SCM(playerid,COLOR_LIGHTRED,"Falsches Passwort! Du hast noch 1 Versuch");}
if(Account[playerid][LoginFails] >= 3)
{
SCM(playerid,COLOR_LIGHTRED,"Das war der 3.!");
SCM(playerid,COLOR_LIGHTRED,"Das wurdest gekickt!");
Kick(playerid);
format(str,sizeof(str),"So ein pech aber auch, %s wurde wegen 3 fehlgeschlagenen Anmeldungen gekickt.",playername);
SCMTA(COLOR_LIGHTRED,str);
}
new loginname[MAX_PLAYER_NAME];
GetPlayerName(playerid,loginname,MAX_PLAYER_NAME);
format(str,sizeof(str),"Willkommen, %s!\n\nBitte logge dich ein!",loginname);
ShowPlayerDialog(playerid,LOGGIN,DIALOG_STYLE_INPUT,"Login",str,"Login","Abbrechen");
return 1;
}
}
}
return 1;
}
}