Format and SendClientMessage
#1

Код:
format(string2, sizeof(string2), "Fraction: %s | Rank: %s | Job: %s | aPoints: %d | Playing time: %dh, %dmin | SQLID: %d | fSQLID: %d", gnimi, rankz, tookoht, apunkte, tunde, minutid, sqlid, fsqlid);
SendClientMessage(playerid, -1, string2);
I'm having a problem with this code, it doesn't show IG, but if I use "printf", then it prints correctly to my servers console. I need some advice.

Код:
[18:34:52] Grupeering: LSPD | Rank: Cadet | Job: N/A | aPunkte: 0 | Playing time: 44h, 21min | SQLID: 2 | fSQLID: 212
Reply
#2

I can't understand whats the problem, it doesn't send the message or what?
Reply
#3

pawn Код:
format(string2, sizeof(string2), "Fraction: %s | Rank: %s | Job: %s | aPoints: %d | Playing time: %dh, %dmin | SQLID: %d | fSQLID: %d", gnimi, rankz, tookoht, apunkte, tunde, minutid, sqlid, fsqlid);
SendClientMessage(playerid, -1, string2);
Try this:

pawn Код:
string2[0] = EOS;
format(string2, sizeof(string2), "Fraction: %s | Rank: %s | Job: %s | aPoints: %d | Playing time: %dh, %dmin | SQLID: %d | fSQLID: %d", gnimi, rankz, tookoht, apunkte, tunde, minutid, sqlid, fsqlid);
SendClientMessage(playerid, -1, string2);
Reply
#4

Nope, it didn't help. I've discovered that if I set my fraction, job and rank to N/A, it works perfectly. If I set my job to street sweeper or something, it also works. But if I set my fraction to LAPD, with rank Cadet, the whole row disappears. If I set my fraction to LAPD and rank to (empty), then it works also.
Reply
#5

Not sure but, try to increase the string length?
Reply
#6

Quote:

If a message is longer than 144 characters, it will not be sent. Truncation can be used to prevent this. Displaying a message on multiple lines will also solve this issue.

Source

You will have to send multiple messages with data, each can contain up to 144 characters.
Reply
#7

string2 lenght ?
Reply
#8

It's working now, string2 length was 147 characters, I made some modifications to make it shorter.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)