Saving player job to mysql
#1

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
Reply
#2

Should probably work. Show us the MYSQL Debug.
Reply
#3

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
Reply
#4

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;
                 }
            }
Reply
#5

it works. Thanks
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)