BIG HELP +REPPP ! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: BIG HELP +REPPP ! (
/showthread.php?tid=558566)
BIG HELP +REPPP ! -
Ady_Ro - 17.01.2015
Hello Guys I have a problem about Text String soo
This is the problem
http://www.imgz.ro/view.php?id=165755
Look when i player types in chat more about 2 -3 words it's starting a new line but I want all the text in one line
Here's my code , and string length
pawn Код:
else if(AccInfo[playerid][Level] >= 3 && AccInfo[playerid][Level] == 10 && IsPlayerAdmin(playerid))
{
format(PText, 1000, "{FF0000}({FFFFFF}RCON{FF0000}){15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] >= 3 && AccInfo[playerid][Level] <= 10)
{
format(PText, 1000, "{1900FF}(Admin){15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
+REP for who can solve this !
Re: BIG HELP +REPPP ! -
CalvinC - 17.01.2015
That code doesn't look like the one in the picture, check through OnPlayerText.
Re : BIG HELP +REPPP ! -
FilesMAker - 17.01.2015
I think you get an out of bound, the maximum length of a message string is 144, if you go more than that it's not shown !
Try to use sizeof() instead of 1000
Re: BIG HELP +REPPP ! -
Ady_Ro - 17.01.2015
pawn Код:
else if(AccInfo[playerid][Level] >= 3 && AccInfo[playerid][Level] == 10 && IsPlayerAdmin(playerid))
{
format(PText, 144, "{FF0000}({FFFFFF}RCON{FF0000}){15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] >= 3 && AccInfo[playerid][Level] <= 10)
{
format(PText, 144, "{1900FF}(Admin){15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][pVip] > 0)
{
format(PText, 144, "{FF0000}(VIP){15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] < 1 && AccInfo[playerid][pVip] < 1)
{
format(PText, 144, "{15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
Modified , same problem
Re : BIG HELP +REPPP ! -
FilesMAker - 17.01.2015
Don't write it just make sure your PText string has a lengh of 144 like
new PText[144];
then instead of writing 144 on format write:
format(PText, sizeof(PText),...
Re: BIG HELP +REPPP ! -
CalvinC - 17.01.2015
I don't think above is the cause of the problem.
If it's not, show your SendPlayerMessageToAll stock.
Re: BIG HELP +REPPP ! -
Ady_Ro - 17.01.2015
I finally solved, thanks all for help
here is how I did:
pawn Код:
else if(AccInfo[playerid][Level] >= 3 && AccInfo[playerid][Level] <= 10)
{
format(PText, sizeof(PText), "%s{1900FF}(Admin){15FF00}(%d):{FFFFFF} {%06x}%s",PlayerName2(playerid), playerid, AccInfo[playerid][p_TextColor], text);
SendClientMessageToAll(GetPlayerColor(playerid), PText);
return 0;
}
Thanks again
Re : BIG HELP +REPPP ! -
FilesMAker - 17.01.2015
Your welocme

don't forget about reputation

!