String size 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: String size help (
/showthread.php?tid=517286)
String size help -
Marven - 04.06.2014
Hello there, i tried to script a fakechat cmd but it sends a perticular size of text it cant send more then i think 30 words i need it to send all the words which are being sent.
Code:
pawn Код:
CMD:fakechat(playerid, params[])
{
new id, msg[128], string[128];
if(AdminLevel[playerid] <=2) return SendClientMessage(playerid, -1, "SERVER: Unknown command.");
if(sscanf(params,"ds",id,msg)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /fakechat [id] [msg]");
format(string, sizeof(string), "%s",msg);
SendPlayerMessageToAll(id, string);
return 1;
}
Re: String size help -
Konstantinos - 04.06.2014
pawn Код:
if(sscanf(params,"ds[128]",id,msg))
"s" specifier needs the length, otherwise it's 32 by default.
Re: String size help -
Marven - 04.06.2014
Quote:
Originally Posted by Konstantinos
pawn Код:
if(sscanf(params,"ds[128]",id,msg))
"s" specifier needs the length, otherwise it's 32 by default.
|
Worked, thanks for making it clear to me. +REP