Raised This Month: $ Target: $400
 0% 

start from 001


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 05-23-2009 , 19:31   start from 001
Reply With Quote #1

hi i need a little bit help,
how to start up with "001"?
becoz of some reason,i cannot use "1"
PHP Code:
    new Apple 000

public something(id)
{
    
Apple++
    
client_print(0,print_chat,"%d",Apple)
    
set_task(3.0,"something")

__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!
biscuit628 is offline
shine771
Senior Member
Join Date: Jun 2007
Old 05-23-2009 , 19:52   Re: start from 001
Reply With Quote #2

PHP Code:
new Cherry

public GimmeCherry() {
    
    new 
sCherry[4]
    
    
Cherry++
    
    
formatex(sCherry,3,"%s%s%d",Cherry 100 "0" ""Cherry 10 "0" "",Cherry)
    
    
client_print(0,print_chat,"%s",sCherry)

shine771 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-23-2009 , 23:29   Re: start from 001
Reply With Quote #3

Quote:
Originally Posted by shine771 View Post
PHP Code:
new Cherry

public GimmeCherry() {
    
    new 
sCherry[4]
    
    
Cherry++
    
    
formatex(sCherry,3,"%s%s%d",Cherry 100 "0" ""Cherry 10 "0" "",Cherry)
    
    
client_print(0,print_chat,"%s",sCherry)

WOW! Just do this:
PHP Code:
new Cherry

public GimmeCherry() {
    
    
Cherry++
    
    
client_print(0,print_chat,"%03i",Cherry)

%3i means an integer with 3 character spaces used. If the number is 2 or less digits, it will fill the rest with spaces.
%03i means that the spaces to fill the emptiness will be 0's instead.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 05-24-2009 , 04:38   Re: start from 001
Reply With Quote #4

thank you shine and Exolent
__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!
biscuit628 is offline
shine771
Senior Member
Join Date: Jun 2007
Old 05-24-2009 , 05:49   Re: start from 001
Reply With Quote #5

Thanks exolent.
You learn new things everyday, no matter how long have you coded.
shine771 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 01:25.


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