SA-MP Forums Archive
format problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: format problem (/showthread.php?tid=159564)



format problem - oliverrud - 13.07.2010

Hey, heres my problem, gonna explain it by first showing the code as I believe that would be easiest
Original Code:
pawn Код:
format(string,sizeof(string),"Usage: /gotoint [0-%d]",totalint); // Outputs 32 at %d
The edited code:
pawn Код:
format(string,sizeof(string),"Usage: /gotoint [0-%d]",1-totalint); // Outputs 31 at %d that's what I want
However it also outputs 2 of the - at the message so it would be like this:

Код:
Usage: /gotoint [0--31]
I there a way to remove one of the - or am I just doing it the wrong way?


Re: format problem - Hiddos - 13.07.2010

*Outputs 31 at %d

You're starting with 1, and if you're pulling of 32 out of it, you'd get -31.


Re: format problem - RyDeR` - 13.07.2010

I don't get it actually.

But if you mean making the negative positive use this then:

pawn Код:
format(string,sizeof(string),"Usage: /gotoint [0-%d]", -(1-totalint));



Re: format problem - oliverrud - 13.07.2010

Well I really suck to explain my problems, anyways thanks RyDeR once again you fixed me problem Thanks.


Re: format problem - -Rebel Son- - 13.07.2010

RyDeRs a scripting wizard.


Re: format problem - oliverrud - 13.07.2010

Quote:
Originally Posted by -Rebel Son-
Посмотреть сообщение
RyDeRs a scripting wizard.
Amen.