Text not showing
#1

Why this text isn't showing on chat?
No warnings/errors.

Код:
	new coordsstring[256];
		format(coordsstring, sizeof(coordsstring),"            Ч Ч %s Ч Ч",name);
		SendClientMessage(playerid, COLOR_RED,coordsstring);
		format(coordsstring, sizeof(coordsstring), "{fe6347}» {0fab2e}Level: {ffffff}[%d] • {0fab2e}Sex: {ffffff}[%s] • {0fab2e}Varsta: {ffffff}[%d] • {fe6347}Cash: {ffffff}[%s] • {fe6347}Banca: {ffffff}[%s]", level,atext,age, saveGM(cash), saveGM(account));
		SendClientMessage(playerid, COLOR_WHITE,coordsstring);
		format(coordsstring, sizeof(coordsstring), "{fe6347}» {0fab2e}Telefon: {ffffff}[%d] • {0fab2e}Donator: {ffffff}[%s] • {0fab2e}Sot/Sotie: {ffffff}[%s] • {fe6347}Ore Jucate: {ffffff}[%d] • {fe6347}Job: {ffffff}[%s]", pnumber,drank,married,ptime,jtext);
		SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
		format(coordsstring, sizeof(coordsstring), "{fe6347}» {0fab2e}NextLevel: {ffffff}[%s] • {0fab2e}Respect: {ffffff}[%d/%d] • {0fab2e}Wanted: {ffffff}[%d] • {fe6347}Drugs: {ffffff}[%d] • {fe6347}Pills: {ffffff}[%d/50]",saveGM(costlevel),exp,expamount,wanted,drugs,pills);
		SendClientMessage(playerid, COLOR_WHITE,coordsstring);
		format(coordsstring, sizeof(coordsstring), "{fe6347}» {0fab2e}Materials: {ffffff}[%d] • {0fab2e}Factiune: {ffffff}[%s] • {0fab2e}Rank: {ffffff}[%s] • {fe6347}Warn: {ffffff}[%d/3]• {fe6347}Fish: {ffffff}[%d] ",mats,ttext,rtext,warns,fishes);
		SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
Reply
#2

Perhaps it is not getting called?
Show us where you have placed this code.
Reply
#3

It's called, with a command:

Код:
if (strcmp(cmd, "/stats", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (gPlayerLogged[playerid] != 0)
			{
				ShowStats(playerid,playerid);
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "{30a030}[Kappa]: {ffffff}Ne pare rau, dar trebuie sa fi Logat pentru a utiliza aceasta comanda.");
			}
		}
		return 1;
	}
Код:
public ShowStats(playerid,targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
	{

                [....]
               //here is the code
         }
}
Reply
#4

You could remove the "IsPlayerConnected(playerid)" parts in your code, as the player using the command is connected to begin with, otherwise he couldn't use the command.

Other than that, I can't see any problems.
Reply
#5

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
You could remove the "IsPlayerConnected(playerid)" parts in your code, as the player using the command is connected to begin with, otherwise he couldn't use the command.

Other than that, I can't see any problems.
I have to mention that the [/stats] worked before.
I added those colors {0fab2e} - {ffffff} to make text nicer and now... doesn't work (but no errors).
Reply
#6

Maybe the string is too long.
Messages should only be 144 chars max.
https://sampwiki.blast.hk/wiki/SendClientMessage
Reply
#7

Example for color code {FFFFF}
Reply
#8

Ok so I DELETED the COLORs.
The text is now working. What the hell? Why I can't use those colors?
How should I color it? (Green - White - Green - White - Green - White)
Reply
#9

The added colors make your text too long.
As said before, the maximum size of your string that gets passed to SendClientMessage can only be 144 characters.

pawn Код:
{fe6347}» {0fab2e}Level: {ffffff}[%d]{0fab2e}Sex: {ffffff}[%s]{0fab2e}Varsta: {ffffff}[%d]{fe6347}Cash: {ffffff}[%s]{fe6347}Banca: {ffffff}[%s]
This string is already 156 characters long, and you still need to insert data from your variables.
It's too long and the text will NOT be sent.

It's clearly stated in the wiki, I posted the link in my previous post.

To see the length of your strings, copy the string in Notepad and put your cursor on the end of the line.
On the bottom-right, you should see how many characters it has (column).

You can also copy the string on an empty line in pawno itself and see how long it is.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)