AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Big integenr (or analog of printf in PHP) (https://forums.alliedmods.net/showthread.php?t=76936)

Zend 09-02-2008 09:33

Big integenr (or analog of printf in PHP)
 
Hi!
Have a formula: ((a * 16777216) + (65536 * b) + (256 * c) + d)
a,b,c,d - parts of IP, on example:
((217 * 16777216) + (65536 * 76) + (256 * 192) + 226)
- i got "-649281310", but normally is 3645685986
I know, in PHP present printf() function, who can do it...But how do it in Pawn?

Alka 09-02-2008 09:45

Re: Big integenr (or analog of printf in PHP)
 
Code:

new iNum = ((217 * 16777216) + (65536 * 76) + (256 * 192) + 226);
client_print(0, print_chat, "%d", iNum);

I recommend to read Pawn Tutorial.

Zend 09-03-2008 04:55

Re: Big integenr (or analog of printf in PHP)
 
Code:


new iNum = ((217 * 16777216) + (65536 * 76) + (256 * 192) + 226);
client_print(0, print_chat, "%d", iNum);

Return -649281310...

Orangutanz 09-03-2008 13:18

Re: Big integenr (or analog of printf in PHP)
 
%u for unsigned integer


All times are GMT -4. The time now is 03:14.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.