Raised This Month: $ Target: $400
 0% 

How to parse string


Post New Thread Reply   
 
Thread Tools Display Modes
monolit
Junior Member
Join Date: May 2011
Old 05-15-2011 , 05:04   Re: How to parse string
Reply With Quote #11

Thanks now I'm using format_time but it returns wrong date, I think its because of GMT area I would like to get time in GMT + 02:00

Can it be because I'm rounding the get_systime() with floatround(Float:get_systime()) ?

also if I'm going to use iMute[id] as a float, then how can I get time with format_time.

Last edited by monolit; 05-15-2011 at 05:07.
monolit is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-15-2011 , 17:38   Re: How to parse string
Reply With Quote #12

Quote:
Originally Posted by monolit View Post
Thanks now I'm using format_time but it returns wrong date, I think its because of GMT area I would like to get time in GMT + 02:00

Can it be because I'm rounding the get_systime() with floatround(Float:get_systime()) ?

also if I'm going to use iMute[id] as a float, then how can I get time with format_time.
1. What value are you putting in for the last argument of format_time()?
2. Why would you use a float? It is not a float.
__________________
fysiks is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 05-17-2011 , 02:41   Re: How to parse string
Reply With Quote #13

Quote:
Originally Posted by fysiks View Post
You can't use parse if you want to have any spaces in the reason section.
You can, see example below.
PHP Code:
    new szCommand[256]
    
read_args(szCommand255)
    
trim(szCommand)

    new 
szBanLength[32], szTarget[32], szBanReason[192]
    
parse(szCommandszBanLength31szTarget31)
    
copy(szBanReason191szCommand[strlen(szBanLength) + strlen(szTarget) + 2])
    
replace_all(szBanReason191"\", "/")
    replace_all(szBanReason, 191, "'", "´")
    trim(szBanReason) 
__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015
Leon M. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-17-2011 , 20:06   Re: How to parse string
Reply With Quote #14

Quote:
Originally Posted by Leon M. View Post
You can, see example below.
PHP Code:
    new szCommand[256]
    
read_args(szCommand255)
    
trim(szCommand)

    new 
szBanLength[32], szTarget[32], szBanReason[192]
    
parse(szCommandszBanLength31szTarget31)
    
copy(szBanReason191szCommand[strlen(szBanLength) + strlen(szTarget) + 2])
    
replace_all(szBanReason191"\", "/")
    replace_all(szBanReason, 191, "'", "´")
    trim(szBanReason) 
That's because you are not using parse to get the reason at all.
__________________
fysiks 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 04:20.


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