Inputtext Dialog help. - 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: Inputtext Dialog help. (
/showthread.php?tid=483256)
Inputtext Dialog help. -
rangerxxll - 24.12.2013
Hello.
I'm trying to make a code where a player enters text, that will be showed on other player's screen for 6 seconds. But it's converting the inputtext to a integer, I know why it is making it a integer, but if I do
It doesn't compile.
Help is appreciated.

thanks.
pawn Код:
if(dialogid == announce)
{
new string[25];
new text = strval(inputtext);
if(text > 25) return SendClientMessage(playerid,COLOR_RED, "Keep your text characters below 25.");
format(string,sizeof(string), "~g~%s",text);
GameTextForAll(string, 6000, 2);
return 1;
}
Re: Inputtext Dialog help. -
Jefff - 24.12.2013
pawn Код:
if(dialogid == announce)
{
new len = strlen(inputtext);
if(len == 0) SendClientMessage(playerid,COLOR_RED, "Empty inputtext.");
else if(len > 25) SendClientMessage(playerid,COLOR_RED, "Keep your text characters below 25.");
else{
new string[30];
format(string,sizeof(string), "~g~%s",inputtext);
GameTextForAll(string, 6000, 2);
}
return 1;
}
Re: Inputtext Dialog help. -
rangerxxll - 24.12.2013
Ah, so it's strlen I was looking for. Thank you.