Raised This Month: $ Target: $400
 0% 

retrieving 1 character from a string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 04-24-2006 , 19:52   retrieving 1 character from a string
Reply With Quote #1

Look:
Code:
new filename[200], len if(read[i3]!='[') {     len += format(filename[len],199-len,"%s",read[i3]) }

Obviously that isn't how I would place the character "read[i3]" at the end of "filename", it would of course place the entire string starting with "read[i3]" onto the end of "filename". So question is, how do I place only the 1 character "read[i3]" onto the end of "filename"?

Anyone that does not believe I gave sufficient enough code to answer this question, clearly you do not understand the question. To those people, please do not post.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-24-2006 , 19:54  
Reply With Quote #2

copy();
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 04-24-2006 , 20:02  
Reply With Quote #3

I think I got it

Code:
new char[1] format(char,0,"%s",read[i3]) len += format(filename[len],199-len,"%s",char)

Edit: and of course not "char" as a variable name.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 04-25-2006 , 03:16  
Reply With Quote #4

Code:
new filename[200], len if(read[i3]!='[') {     len += format(filename[len],199-len,"%c",read[i3]) }
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-25-2006 , 03:19  
Reply With Quote #5

What is '%c'?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 04-25-2006 , 03:20  
Reply With Quote #6

careface. I figured this out hours ago.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 04-25-2006 , 03:28  
Reply With Quote #7

%c = char
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 04-25-2006 , 03:32  
Reply With Quote #8

that was a hard one to figure out
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Reply


Thread Tools
Display Modes

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:59.


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