Raised This Month: $ Target: $400
 0% 

Big integenr (or analog of printf in PHP)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zend
Junior Member
Join Date: Jun 2008
Old 09-02-2008 , 09:33   Big integenr (or analog of printf in PHP)
Reply With Quote #1

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?

Last edited by Zend; 09-02-2008 at 09:37.
Zend is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-02-2008 , 09:45   Re: Big integenr (or analog of printf in PHP)
Reply With Quote #2

Code:
new iNum = ((217 * 16777216) + (65536 * 76) + (256 * 192) + 226);
client_print(0, print_chat, "%d", iNum);
I recommend to read Pawn Tutorial.
Alka is offline
Zend
Junior Member
Join Date: Jun 2008
Old 09-03-2008 , 04:55   Re: Big integenr (or analog of printf in PHP)
Reply With Quote #3

Code:
 
new iNum = ((217 * 16777216) + (65536 * 76) + (256 * 192) + 226);
client_print(0, print_chat, "%d", iNum);
Return -649281310...
Zend is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 09-03-2008 , 13:18   Re: Big integenr (or analog of printf in PHP)
Reply With Quote #4

%u for unsigned integer
Orangutanz is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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