Raised This Month: $ Target: $400
 0% 

Adding a line to a file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-17-2005 , 09:03   Adding a line to a file
Reply With Quote #1

How would I go by adding a line to a file? =)
__________________
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
n0obie4life
Veteran Member
Join Date: Dec 2004
Old 04-17-2005 , 09:06  
Reply With Quote #2

-- offtopic : --

v3x, i know u'd see this topic, so i wanna ask

WHAT ENTITY DO I USE FOR SHOTGUN AMMO . i just cannot seem to find it.

out of all this

ammo_338magnum
ammo_357sig
ammo_45acp
ammo_50ae
ammo_556nato
ammo_57mm
ammo_762nato
ammo_9mm
ammo_556natobox
ammo_flashbang
n0obie4life is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-17-2005 , 09:11  
Reply With Quote #3

..
Code:
cs_set_user_bpammo(id,"weapon_m3",24) // Not sure what it is, I think it's 24
Please don't respond to this, n0obie.

[EDIT]

So I found this code @ the AMX forums..
Code:
 new connectname[32] new connectid[32] get_user_name(id,connectname,31) get_user_authid(id,connectid,31) new gFileLocation[66] = "addons/amx/connectedid.txt" new FileMake[261] format(FileMake,260,"Name- %s   :::   SteamID- %s",connectname,connectid) write_file(gFileLocation,FileMake,-1)
Is there a better way of doing it?
__________________
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
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-17-2005 , 15:32  
Reply With Quote #4

Is this right..
Code:
// ..     new cfgDir[64]                 new FileLocation[64]                                                                               get_configsdir(cfgDir,63)                                                                           format(FileLocation,63,"%s/users.ini",cfgDir)     write_file(FileLocation,"-- Blah --",-1)
__________________
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
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 04-17-2005 , 16:29  
Reply With Quote #5

Yea, that should be right. You don't need the -1, less typing.
__________________
twistedeuphoria is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-17-2005 , 17:01  
Reply With Quote #6

Alright, here's small part from my code:

Code:
// ..     if(equal(Flags,"1")) get_cvar_string("admin_level1",nFlags,23)           if(equal(Flags,"2")) get_cvar_string("admin_level2",nFlags,23)           if(equal(Flags,"3")) get_cvar_string("admin_level3",nFlags,23)                                                                                             format(cfgFile,83,"^"%s^" ^"%s^" ^"%s^" ^"ac^"",Pass,SteamID,nFlags)     format(cfgFile,83,"; %s - %s",Player,CurrentTime)                                                                                                           write_file(FileLocation,cfgFile,-1)
Is there anything strange about that, that would make it not write correctly?
__________________
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
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 04-17-2005 , 17:32  
Reply With Quote #7

You're format() - ing to the same string, it doesn't concatenate automatically.
__________________
twistedeuphoria is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-17-2005 , 17:41  
Reply With Quote #8

Yea, while I was AFK I realised that.. LOL. I make the dumbest mistakes sometimes. Two more questions..

1) Is nFlags even returning a value?

2) How can I tell if the same Steam ID is used in the same line?
__________________
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
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 04-17-2005 , 17:45  
Reply With Quote #9

Whaa??
You're going to need to show more of the code or explain yourself better.
__________________
twistedeuphoria 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 10:03.


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