[HELP] stock scmf function
#1

So I have a problem with this stock it won't show string but integer will show

example:

SCMF(playerid,white,"Hello %s your level know is %d",name,level); so in this line it won't show %s it will be like this

SCMF(playerid,white,"Hello your level know is %d",name,level); like you see this function won't show any %s

here is the stock

pawn Код:
stock SCMF(playerid,color,fstring[],{Float,_}:...)
{
   new n=(numargs()-3)*4;
   if(n)
   {
      new message[128],arg_start,arg_end;
      #emit CONST.alt                fstring
      #emit LCTRL                    5
      #emit ADD
      #emit STOR.S.pri               arg_start
      #emit LOAD.S.alt               n
      #emit ADD
      #emit STOR.S.pri               arg_end
      do
      {
         #emit LOAD.I
         #emit PUSH.pri
         arg_end-=4;
         #emit LOAD.S.pri           arg_end
      }
      while(arg_end>arg_start);
      #emit PUSH.S                   fstring
      #emit PUSH.C                   255
      #emit PUSH.ADR                 message
      n+=4*3;
      #emit PUSH.S                   n
      #emit SYSREQ.C                 format
      n+=4;
      #emit LCTRL                    4
      #emit LOAD.S.alt               n
      #emit ADD
      #emit SCTRL                    4
      return SCM(playerid,color,message);
   }
   else return SCM(playerid,color,fstring);
}
Reply
#2

This is complicated and useless.
Use ******' y_va.
https://sampforum.blast.hk/showthread.php?tid=399069
http://ysi.wikia.com/wiki/Library:YSI/y_va

pawn Код:
stock SCMF(playerid, color, const fstring[], va_args<>)
{
    new str[145];
    va_format(str, sizeof (str), fmat, va_start<3>);
    return SendClientMessage(playerid, colour, str);
}
Reply
#3

Quote:
Originally Posted by Stinged
Посмотреть сообщение
This is complicated and useless.
Use ******' y_va.
https://sampforum.blast.hk/showthread.php?tid=399069
http://ysi.wikia.com/wiki/Library:YSI/y_va

pawn Код:
stock SCMF(playerid, color, const fstring[], va_args<>)
{
    new str[145];
    va_format(str, sizeof (str), fmat, va_start<3>);
    return SendClientMessage(playerid, colour, str);
}
is your code show and integer and string in the same or one line? thanks
Reply
#4

anyone? thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)