format problem
#1

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?
Reply
#2

*Outputs 31 at %d

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

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));
Reply
#4

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

RyDeRs a scripting wizard.
Reply
#6

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


Forum Jump:


Users browsing this thread: 2 Guest(s)