Format and SendClientMessage -
vent - 21.05.2015
Код:
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
Re: Format and SendClientMessage -
SecretBoss - 21.05.2015
I can't understand whats the problem, it doesn't send the message or what?
Re: Format and SendClientMessage -
Ghazal - 21.05.2015
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);
Re: Format and SendClientMessage -
vent - 22.05.2015
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.
Re: Format and SendClientMessage -
Ghazal - 22.05.2015
Not sure but, try to increase the string length?
Re: Format and SendClientMessage -
AlonzoTorres - 22.05.2015
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.
Respuesta: Format and SendClientMessage -
alexus - 22.05.2015
string2 lenght ?
Re: Format and SendClientMessage -
vent - 23.05.2015
It's working now, string2 length was 147 characters, I made some modifications to make it shorter.