13.10.2011, 15:05
I get that error (title)
but i do convert it to integers.. so that's weird
here's the code:
So i get an error on every line i try to convert savingstring..
but i do convert it to integers.. so that's weird
here's the code:
pawn Код:
enum pInfo {
pname,
pPassword,
pCash,
pBank,
pScore,
pAdminLevel,
Float:pHealth,
Float:pPosX,
Float:pPosY,
Float:pPosZ,
Float:pAngle,
pVirtualWorld,
pInterior,
bool:pLogged = false,
pSkin
}
new Player[MAX_PLAYERS][pInfo];
new fquery[200];
case DIALOG_LOGIN:
{
if(!response) return Kick(playerid);
if(response) {
new escapepass[200];
mysql_real_escape_string(inputtext, escapepass);
format(fquery, sizeof(fquery), "SELECT * FROM users WHERE username = '%s' AND password = SHA1('%s')", Player[playerid][pname], escapepass);
mysql_query(fquery);
mysql_store_result();
new numrows = mysql_num_rows();
if(numrows == 1) {
new savingstring[32];
while(mysql_fetch_row_format(fquery, "|"))
{
mysql_fetch_field_row(savingstring, "cash"); Player[playerid][pCash] = strval(savingstring);
mysql_fetch_field_row(savingstring, "bank"); Player[playerid][pBank] = strval(savingstring);
mysql_fetch_field_row(savingstring, "score"); Player[playerid][pScore] = strval(savingstring);
mysql_fetch_field_row(savingstring, "adminlevel"); Player[playerid][pAdminLevel] = strval(savingstring);
mysql_fetch_field_row(savingstring, "health"); Player[playerid][pHealth] = floatstr(savingstring);
mysql_fetch_field_row(savingstring, "posx"); Player[playerid][pPosX] = floatstr(savingstring);
mysql_fetch_field_row(savingstring, "posy"); Player[playerid][pPosY] = floatstr(savingstring);
mysql_fetch_field_row(savingstring, "posz"); Player[playerid][pPosZ] = floatstr(savingstring);
mysql_fetch_field_row(savingstring, "angle"); Player[playerid][pAngle] = floatstr(savingstring);
mysql_fetch_field_row(savingstring, "virtualworld"); Player[playerid][pVirtualWorld] = strval(savingstring);
mysql_fetch_field_row(savingstring, "interior"); Player[playerid][pInterior] = strval(savingstring);
mysql_fetch_field_row(savingstring, "skin"); Player[playerid][pSkin] = strval(savingstring);
GivePlayerMoney(playerid, Player[playerid][pCash]);
SetPlayerScore(playerid, Player[playerid][pScore]);
SetSpawnInfo(playerid, 0, Player[playerid][pSkin], Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ]);
SpawnPlayer(playerid);
SetPlayerHealth(playerid, Player[playerid][pHealth]);
SetPlayerFacingAngle(playerid, Player[playerid][pAngle]);
SetPlayerVirtualWorld(playerid, Player[playerid][pVirtualWorld]);
SetPlayerInterior(playerid, Player[playerid][pInterior]);
TogglePlayerSpectating(playerid, 0);
}
} else {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "::: Carson RP - Login :::", "Hello and welcome back to Carson RP!\nEnter your password below to log in!", "Login", "Cancel");
SendClientMessage(playerid, COLOR_RED, "SERVER: You entered a wrong password!");
}
mysql_free_result();
}