SA-MP Forums Archive
Saving player job to 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: Saving player job to mysql (/showthread.php?tid=397497)



Saving player job to mysql - Kenzu - 05.12.2012

pawn Код:
else if(strcmp(x_job,"job",true) == 0)
            {
                if(GettingJob[playerid] > 0)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Now that you have confirmed you want the Job, you got a 1 hour Contract.");
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Congratulations with your new Job, type /help to see your new command.");
                    PlayerData[playerid][pJob] = GettingJob[playerid];
                    GettingJob[playerid] = 0;
                    new wakaname[25];
                    GetPlayerName(playerid,wakaname,25);
                    new str[128];
                    format(str,128,"UPDATE `users` SET `Job`='%d' WHERE `name`='%s'",PlayerInfo[playerid][pJob],wakaname);
                    mysql_query(str);
                   
                    return 1;
                }
can anyone help me to make this work? the job won't save to mysql


Re: Saving player job to mysql - Ballu Miaa - 05.12.2012

Should probably work. Show us the MYSQL Debug.


Re: Saving player job to mysql - Kenzu - 05.12.2012

pawn Код:
C:\Users\***\Desktop\*** MYSQL\gamemodes\gamemodes\***.pwn(40206) : error 017: undefined symbol "PlayerInfo"
C:\Users\***\Desktop\*** MYSQL\gamemodes\gamemodes\***.pwn(40206) : warning 215: expression has no effect
C:\Users\***Desktop\*** MYSQL\gamemodes\gamemodes\***.pwn(40206) : error 001: expected token: ";", but found "]"
C:\Users\***\Desktop\*** MYSQL\gamemodes\gamemodes\***.pwn(40206) : error 029: invalid expression, assumed zero
C:\Users\***\Desktop\*** MYSQL\gamemodes\gamemodes\***.pwn(40206) : fatal error 107: too many error messages on one line



Re: Saving player job to mysql - Ballu Miaa - 05.12.2012

This will work!

pawn Код:
else if(strcmp(x_job,"job",true) == 0)
            {
                if(GettingJob[playerid] > 0)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Now that you have confirmed you want the Job, you got a 1 hour Contract.");
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Congratulations with your new Job, type /help to see your new command.");
                    PlayerData[playerid][pJob] = GettingJob[playerid];
                    GettingJob[playerid] = 0;
                    new wakaname[25];
                    GetPlayerName(playerid,wakaname,25);
                    new str[128];
                    format(str,128,"UPDATE `users` SET `Job`='%d' WHERE `name`='%s'",PlayerData[playerid][pJob],wakaname);
                    mysql_query(str);

                    return 1;
                 }
            }



Re: Saving player job to mysql - Kenzu - 05.12.2012

it works. Thanks