varchar command
#1

Hi. Married row gets reset after player login on server.

Why?

PHP код:
`Marriedvarchar(24NOT NULL,
            
cache_get_field_content(0"Married"tmp), pInfo[playerid][Married] = strval(tmp);
Married with: %s pInfo[playerid][Married]
strcat(Query,"UPDATE `users` SET `Married` = '%s', 
Reply
#2

What's your MySQL version?

@EDIT

Why you're using string for integer?
Reply
#3

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
What's your MySQL version?

@EDIT

Why you're using string for integer?
I don't want to use integer, I want to use string.
Reply
#4

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
I don't want to use integer, I want to use string.
pInfo[playerid][Married] = strval(tmp)

strval function convert STRING to INTEGER.
See more: Strval.

If Married constant is string use this:
cache_get_field_content(0, "Married", pInfo[playerid][Married])
Reply
#5

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
pInfo[playerid][Married] = strval(tmp)

strval function convert STRING to INTEGER.
See more: Strval.

If Married constant is string use this:
cache_get_field_content(0, "Married", pInfo[playerid][Married])
I modified it, but still, it won't save.

On MYSQL is saved, but In game it wont show. it shows blank


PHP код:
                format(strsizeof(str),"%s: %s (%s) - %s",  GetAdminName(i), PlayerName(i), pInfo[i][Married], DUTY_STR);
                
SendClientMessage(playeridCOLORstr); 
Reply
#6

Код:
                format(str, sizeof(str),"%s: %s (%d) - %s",  GetAdminName(i), PlayerName(i), pInfo[i][Married], DUTY_STR); 
                SendClientMessage(playerid, COLOR, str);
Reply
#7

Quote:
Originally Posted by UFF
Посмотреть сообщение
Код:
                format(str, sizeof(str),"%s: %s (%d) - %s",  GetAdminName(i), PlayerName(i), pInfo[i][Married], DUTY_STR); 
                SendClientMessage(playerid, COLOR, str);
pInfo[i][Married] is string!

@TOPIC

Only make a debug:

Test #1:
Код:
new marr[24];
cache_get_field_content(0, "Married", marr);

format(str, sizeof(str),"%s: %s (%s) - %s",  GetAdminName(playerid), PlayerName(playerid), marr, DUTY_STR); 
SendClientMessage(playerid, COLOR, str);
Test #2:
Код:
cache_get_field_content(0, "Married", pInfo[playerid][Married], connectionHandle /* change this */, 24);

format(str, sizeof(str),"%s: %s (%s) - %s",  GetAdminName(playerid), PlayerName(playerid), pInfo[playerid][Married], DUTY_STR); 
SendClientMessage(playerid, COLOR, str);
Reply
#8

If I set someone married data as "test" it shows that variable.

At relog, in mysql still is visible, but In game not.
Reply
#9

Код:
`Married` varchar(35) NOT NULL,
Use this and try.

Else it doesn't work,

Do you save pInfo[playerid][Married] in OnPlayerdisconnect?
And do you load it in OnPlayerConnect by Loading Player's data?
Reply
#10

Quote:
Originally Posted by UFF
Посмотреть сообщение
Код:
`Married` varchar(35) NOT NULL,
Use this and try.

Else it doesn't work,

Do you save pInfo[playerid][Married] in OnPlayerdisconnect?
And do you load it in OnPlayerConnect by Loading Player's data?
I made an stock saving and loading player's data, and yes, they are loading.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)