[Question] How to do SendFormattedMessage in PAWN?
#1

Hello. I've unusual problem, because I really don't know how to go about it. Now I explain what I mean - I want to get something like this, without #emit directive, because I don't know it:
pawn Код:
stock SendFormattedMessage(id, colour = -1, string[] = "", message[] = "", {Float, _}:...) {
    new str = sizeof(string[]);
    new data = {Float, _}:...;
    format(string, str, message, data);
    SendClientMessage(id, colour, message);
    printf(message);
}
Code above doesn't work and all what I need is to know (or to learn) how to use the {Float, _} or ... in format. If I'll use data - PAWN will not accept this and will show sort of errors like this:
Код:
error 017: undefined symbol "Float"
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
If I'll use only
pawn Код:
new data;
instead
pawn Код:
new data = {Float, _}:...;
or even
pawn Код:
new data = Float, _;
or
pawn Код:
new data = _;
it will compile, but it will not work. I thought about getting function arguments and save them into variable, but I don't know how to do it.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)