SA-MP Forums Archive
Need help with mysql... (Learning mysql) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help with mysql... (Learning mysql) (/showthread.php?tid=303521)



Need help with mysql... (Learning mysql) - Request - 14.12.2011

I'm new here and I'm trying to learn mysql so..
I have one big problem here is the line where is error.

Код:
error 017: undefined symbol "Logged" 

if(!Logged[playerid]) 

or all code :

	if(Logged[playerid] == 1)//this place..
    {
        //If the player disconnects before registering,
        //we want to make sure it doesn't try update
        //so we check if the player is logged in.
        new score = GetPlayerScore(playerid); //Gets players score
        new money = GetPlayerMoney(playerid); //Gets players money
        new query[200], pname[24]; //Creates the variables
        GetPlayerName(playerid, pname, 24); //Gets the players name.
        format(query, sizeof(query), "UPDATE playerdata SET score=%d, money=%d WHERE user='%s'", score, money, pname);
        mysql_query(query);
        //No need to store a result for a update string
    }
Thank you for your help.


Re: Need help with mysql... (Learning mysql) - XFlawless - 14.12.2011

Quote:
Originally Posted by Request
Посмотреть сообщение
I'm new here and I'm trying to learn mysql so..
I have one big problem here is the line where is error.

Код:
error 017: undefined symbol "Logged" 

if(!Logged[playerid]) 

or all code :

	if(Logged[playerid] == 1)//this place..
    {
        //If the player disconnects before registering,
        //we want to make sure it doesn't try update
        //so we check if the player is logged in.
        new score = GetPlayerScore(playerid); //Gets players score
        new money = GetPlayerMoney(playerid); //Gets players money
        new query[200], pname[24]; //Creates the variables
        GetPlayerName(playerid, pname, 24); //Gets the players name.
        format(query, sizeof(query), "UPDATE playerdata SET score=%d, money=%d WHERE user='%s'", score, money, pname);
        mysql_query(query);
        //No need to store a result for a update string
    }
Thank you for your help.
add this at top

new Logged[MAX_PLAYERS];


Re: Need help with mysql... (Learning mysql) - Request - 14.12.2011

Thanks mate All working now