Hey Leute,
ich habe mal wieder ein Problem mit MYSQL und zwar beim einloggen ladet er die UserID richtig aber z.B die Waffe falsch
hier das Script
stock LoginUser(playerid, password[])
{
new szQuery[1024];
format(szQuery, sizeof(szQuery), "SELECT `userid` FROM `players` WHERE `username` = '%s' AND `password` = '%s'", PlayerName(playerid), password);
SendQuery(szQuery);
mysql_store_result();
if (!mysql_num_rows())
return SendClientMessage(playerid, COLOR_RED, "Falsches Passwort.");
new index, line[1024];
mysql_fetch_row_format(line, "|");
PlayerInfo[playerid][pLoggedIn] = 1;
PlayerInfo[playerid][pUserID] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pSkin] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pCash] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pPos_x] = floatstr(strtoksql(line, index, '|'));
PlayerInfo[playerid][pPos_y] = floatstr(strtoksql(line, index, '|'));
PlayerInfo[playerid][pPos_z] = floatstr(strtoksql(line, index, '|'));
PlayerInfo[playerid][pHealth] = floatstr(strtoksql(line, index, '|'));
PlayerInfo[playerid][pAdmin] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pBank] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pCPos_x] = floatstr(strtoksql(line, index, '|'));
PlayerInfo[playerid][pCPos_y] = floatstr(strtoksql(line, index, '|'));
PlayerInfo[playerid][pCPos_z] = floatstr(strtoksql(line, index, '|'));
PlayerInfo[playerid][pCrashed] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pFeuerzeug] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pZigaretten] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pWein] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pBier] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pFight] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pVersicherung] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pPolizei] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pADAC] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pFL] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pWang] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pFT] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pJizzy] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pGBWH] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pSani] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pTaxi] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pZrad] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pHM] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pIrak] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pSport] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pATU] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pFire] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pAuto] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pM50er] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pM125er] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pM150er] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pHeli] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pBoot] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pLKW] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pFlug] = strval(strtoksql(line, index, '|'));
PlayerInfo[playerid][pWaffe] = strval(strtoksql(line, index, '|'));
mysql_free_result();
format(szQuery, sizeof(szQuery), "Du hast dich erfolgreich eingeloggt. [UserID: %d]", PlayerInfo[playerid][pUserID]);
SendClientMessage(playerid, COLOR_GREEN, szQuery);
new test[256];
format(test, sizeof(test), "Waffe soll %d sein", PlayerInfo[playerid][pWaffe]);
SendClientMessage(playerid, COLOR_GREEN, test);
return true;
}
Userid = 4 und zeight IG 4 an
Waffe = 9 und zeight IG 0 an
hat jemand eine Ahnung??
mfg Dedi