SQL doesnt load first letter.
#1

Hi,

I got a problem when I try to recover the reason if a player is banned.
In the reason, it gives me the good reason, but It doen't retrieves the first letter of the reason.

For exemple if the reason is "this is a test" it will show " his is a test"
I can't find why. Anyone got an idea ?

Код:
public OnAccountLoad(playerid)
{
	pInfo[playerid][RaisonBan] = cache_get_field_content(0, "RaisonBan", pInfo[playerid][RaisonBan], 129, 129);
Код:
public OnPlayerSpawn(playerid)
{
	if(pInfo[playerid][Bannis] == 1)
	{
		new string[128];
		format(string, sizeof(string), "Vous кtes bannis du serveur. Raison: %s", pInfo[playerid][RaisonBan]);
		printf("%s", pInfo[playerid][RaisonBan]);
		SendClientMessage(playerid, Rouge, string);
		SetTimerEx("KickJoueur", 1000, 0, "d", playerid);
	}	
	return 1;
}
In the server log I got: "[12:38:07] estosorus" so the first letter "t" is missing too.
In mysql log :
Код:
[12:38:07] [DEBUG] cache_get_field_content - row: 0, field_name: "RaisonBan", connection: 129, max_len: 129
[12:38:07] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "RaisonBan", data: "testosorus"
[12:38:07] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
So the reason is good there but not after.
Reply
#2

pawn Код:
//change
pInfo[playerid][RaisonBan] = cache_get_field_content(0, "RaisonBan", pInfo[playerid][RaisonBan], 129, 129);
//to
cache_get_field_content(0, "RaisonBan", pInfo[playerid][RaisonBan], 129, 129);
Explanation: When you use assignment, your 0 cell is overwritten with result of cache_get_field_content - 0, or 1 - this is not printable character, and your first element in string is either empty (0 == EOS), or has corrupted first character

(also, are you sure your connection handle is 129?)
Reply
#3

Thank you guy for the explanations for the cell !

I did this:

cache_get_field_content(0, "RaisonBan", pInfo[playerid][RaisonBan], mysql, 129);

Now it works.

And you were right, my connection handle wasnt 129
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)