PDA

View Full Version : String size help


Marven
04/06/2014, 09:35 AM
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:

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;
}

Konstantinos
04/06/2014, 09:36 AM
if(sscanf(params,"ds[128]",id,msg))


"s" specifier needs the length, otherwise it's 32 by default.

Marven
04/06/2014, 09:39 AM
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 :)