MySQL akward problem
#1

Well i'm saving a string named ClassOne then it loads in a variable called pClassOneName[50]

Once it loads the MySQL part (i made it print in console for debug) shows the string loading fine so also with the sscanf loading it also made that print but loading it in a stats dialog or just a simple command it does not show i have another string called Username that loads fine.


Loading part.
pawn Код:
sscanf(Query, "e<p<|>s[24]s[129]s[50]s[50]s[50]s[50]s[50]s[128]s[24]iiiiiiiiis[16]iiiiiiiiiiiiiiiiiiiii>", pInfo[playerid]);
printf("%s",Query);

Result:
Private|Private|ClassOne|ClassTest|SuperHuman|TestBE|Test5|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
Now i've tried to show that string in a command i get a result of noting (empty)

pawn Код:
new string[250];
    format(string,sizeof(string),"%s, %s, %s, %s, %s",
    pInfo[playerid][pClassOneName],
    pInfo[playerid][pClassTwoName],
    pInfo[playerid][pClassThreeName],
    pInfo[playerid][pClassFourName],
    pInfo[playerid][pClassFiveName]);
    SendClientMessage(playerid,-1,string);
They don't seem to be showing at all just the commas.

I've also checked the MySQL database (phpmyadmin) They are saved and loaded on there.
This is very strange i've spent atleast 2 hours now trying to figure it out.
Reply
#2

i never tried to mess with sscanf in a advanced way, but after looking at ****** thread's it should be similar to this. this is fully working(i guess) for a enum similar to yours.

pawn Код:
enum
    E_DATA
{
    E_DATA_NAME1[24],
    E_DATA_NAME2[129],
    E_DATA_NAME3[50],
    E_DATA_NAME4[50],
    E_DATA_NAME5[50],
    E_DATA_NAME6[50],
    E_DATA_NAME7[50],
    E_DATA_NAME8[128],
    E_DATA_NAME9[24],
    E_DATA_Z1,
    E_DATA_Z2,
    E_DATA_Z3,
    E_DATA_Z4,
    E_DATA_Z5,
    E_DATA_Z6,
    E_DATA_Z7,
    E_DATA_Z8,
    E_DATA_Z9,
    E_DATA_NAME10[16],
    E_DATA_Z10,
    E_DATA_Z11,
    E_DATA_Z12,
    E_DATA_Z13,
    E_DATA_Z14,
    E_DATA_Z15,
    E_DATA_Z16,
    E_DATA_Z17,
    E_DATA_Z18,
    E_DATA_Z19,
    E_DATA_Z20,
    E_DATA_Z21,
    E_DATA_Z22,
    E_DATA_Z23,
    E_DATA_Z24,
    E_DATA_Z25,
    E_DATA_Z26,
    E_DATA_Z27,
    E_DATA_Z28,
    E_DATA_Z29,
    E_DATA_Z30
};

public OnFilterScriptInit()
{
   new
        var[E_DATA];
   sscanf("i|see|this|crazy|,|i|like|it|xD|1|2|3|4|5|6|7|8|9|sometext|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|", "p<|>e<s[24]s[129]s[50]s[50]s[50]s[50]s[50]s[128]s[24]iiiiiiiiis[16]iiiiiiiiiiiiiiiiiiiii>", var);
   printf("%s - %s - %s - %s - %s - %s -%s - %s - %s - %d - %d - %d - %d - %d - %d - %d - %d - %d - %s - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d - %d",
   var[E_DATA_NAME1],
   var[ E_DATA_NAME2],
   var[ E_DATA_NAME3],
   var[ E_DATA_NAME4],
   var[ E_DATA_NAME5],
   var[ E_DATA_NAME6],
   var[ E_DATA_NAME7],
   var[ E_DATA_NAME8],
   var[ E_DATA_NAME9],
   var[ E_DATA_Z1],
   var[ E_DATA_Z2],
   var[ E_DATA_Z3],
   var[ E_DATA_Z4],
   var[ E_DATA_Z5],
   var[ E_DATA_Z6],
   var[ E_DATA_Z7],
   var[ E_DATA_Z8],
   var[ E_DATA_Z9],
   var[ E_DATA_NAME10],
   var[ E_DATA_Z10],
   var[ E_DATA_Z11],
   var[ E_DATA_Z12],
   var[ E_DATA_Z13],
   var[ E_DATA_Z14],
   var[ E_DATA_Z15],
   var[ E_DATA_Z16],
   var[ E_DATA_Z17],
   var[ E_DATA_Z18],
   var[ E_DATA_Z19],
   var[ E_DATA_Z20],
   var[ E_DATA_Z21],
   var[ E_DATA_Z22],
   var[ E_DATA_Z23],
   var[ E_DATA_Z24],
   var[ E_DATA_Z25],
   var[ E_DATA_Z26],
   var[  E_DATA_Z27],
   var[ E_DATA_Z28],
   var[ E_DATA_Z29],
   var[ E_DATA_Z30]);
}
for me this is the right way, since it's working properly(i guess). just make yours as i did.

@edited.. now i'm sure it's working well.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)