String size help
#1

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;
}
Reply
#2

pawn Код:
if(sscanf(params,"ds[128]",id,msg))
"s" specifier needs the length, otherwise it's 32 by default.
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)