[HELP] stock scmf function - 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: [HELP] stock scmf function (
/showthread.php?tid=526494)
[HELP] stock scmf function -
Luca12 - 17.07.2014
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);
}
Re: [HELP] stock scmf function -
Stinged - 17.07.2014
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);
}
Re: [HELP] stock scmf function -
Luca12 - 17.07.2014
Quote:
Originally Posted by Stinged
|
is your code show and integer and string in the same or one line? thanks
Re: [HELP] stock scmf function -
Luca12 - 18.07.2014
anyone? thanks