Mysql loading error
#1

Hello. I have error with mysql loading.
Here is the script:

Код:
if(dialogid == 2)
             {
                             if(response)
                             {
                                             new vardas[24], query[256];
                                             GetPlayerName(playerid, vardas, 24);
                                             if(IsPlayerConnected(playerid))
                                             {
                                             MySQLCheck();
                                                             format(query,sizeof(query),"SELECT Pinigai, Score, posx, posy, posz, posa FROM `"TABLENAME"` WHERE Vardas = '%s' AND Slaptazodis = ('%s') LIMIT 1",vardas,inputtext);
                                                             mysql_query(query);
                                                             mysql_store_result();

                                                             if(mysql_num_rows() != 0)
                                                             {
                                                                             new result[50],result1[50];
                                                                         mysql_get_field("Money",result);
                                                                                             strval(result) = PlayerMoney[playerid];
                                                                             GivePlayerMoney(playerid,PlayerMoney[playerid]);
                                                                                             mysql_get_field("Score",result1);
                                                                                             strval(result1) = PlayerScore[playerid];
                                                                             GivePlayerScore(playerid,PlayerScore[playerid]);
                                                                             SendClientMessage(playerid,SPALVA_ORANDZINE,"Tu sлkmingai prijungtas prie sаskaitos. Sлkmлs юaidime!");
                                                                             Logged[playerid] = true;
                                                                             mysql_free_result();
                                                             }
                                                             else
                                                             {
                                                                             mysql_free_result();
                                                                             ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Prisijungimas","Бveskite savo sаskaitos prisijungimo slaptaюodб:","Tжsti","Iрeiti");
                                                                             return SendClientMessage(playerid,SPALVA_ORANDZINE,"Sаskaitos vartotojas neatpaюintas, greiиiausiai slaptaюodis neatitiko.");
                                                             }
                                             }
                                             else
                                             {
                                             mysql_store_result();
                                             mysql_free_result();
                                             }
                             }
                             else if(!response)
                             {
                                             Kick(playerid);
                                             return 1;
                             }
                             return 1;
             }
Saving:

Код:
public OnPlayerDisconnect(playerid, reason)
{
new query[300],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
if (Logged[playerid])
{
                             MySQLCheck();
             format(query,sizeof(query),"UPDATE `"TABLENAME"` SET `Money`='%d',`Score`='%d' WHERE (`Vardas` = '%s')",GetPlayerMoney(playerid),GetPlayerScore(playerid),pName);
             mysql_query(query);
}
Error's:

Код:
C:\Users\seima\Desktop\gm seip\gamemodes\seip.pwn(1593) : error 022: must be lvalue (non-constant)
C:\Users\seima\Desktop\gm seip\gamemodes\seip.pwn(1593) : warning 215: expression has no effect
C:\Users\seima\Desktop\gm seip\gamemodes\seip.pwn(1597) : error 022: must be lvalue (non-constant)
C:\Users\seima\Desktop\gm seip\gamemodes\seip.pwn(1597) : warning 215: expression has no effect
Line 1593:

Код:
strval(result) = PlayerMoney[playerid];
Line 1597:

Код:
strval(result1) = PlayerScore[playerid];
Variables:

Код:
new PlayerMoney[MAX_PLAYERS];
new PlayerScore[MAX_PLAYERS];
Код:
new result[50],result1[50];
new vardas[24], query[256];
Mysql version:
Код:
BlueG r6
Reply
#2

instead of
Код:
strval(result) = PlayerMoney[playerid];
try
Код:
PlayerMoney[playerid] = strval(result);
cuz theres no way something like this
Код:
strval(result) = PlayerMoney[playerid];
would ever work lol :P
Reply
#3

Quote:
Originally Posted by CutX
Посмотреть сообщение
instead of
Код:
strval(result) = PlayerMoney[playerid];
try
Код:
PlayerMoney[playerid] = strval(result);
cuz theres no way something like this
Код:
strval(result) = PlayerMoney[playerid];
would ever work lol :P
Thanks it's worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)