SA-MP Forums Archive
Help with reading/making files [rep+] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with reading/making files [rep+] (/showthread.php?tid=292915)



Help with reading/making files [rep+] - Chriham3 - 25.10.2011

Hello. I am creating a system like where you can own a company, and name the company. It is 15 companys in the game, 5 airlines, 5 trucking companys, and 5 bus companies.
What I need help with:
* Making it so that it creates a file with the list of all the companys with name. For instance:

Код:
Company 1: Norwegian Airline
Company 2: Bussing Company
Company 3: DHL Trucking Company
Company 4: Empty Company
...
Company 15: Empty Company
etc...

* Reading the names of company from file
* Making a command to change the name, so a player can write for instance: /changecompanyname (New Company Name) so they don't have to ask the owner to change via the files.

I'll rep for anyone that can help me with that, not neccesarily write it for me, but guide me into making in or referencing to another page where I can find the neccesary codes to write etc.

Thanks in advance.


Re: Help with reading/making files [rep+] - 4Brothers - 25.10.2011

format(fileSrv2,sizeof(fileSrv2),"/company.txt");

I guess you could do something like that, make a command to Create a company, Then string the rest of the information. Have it right to a new file in your scriptfiles.


Re: Help with reading/making files [rep+] - 4Brothers - 25.10.2011

Try creating Dcmd or Zcmd
in coincidence


Re: Help with reading/making files [rep+] - henry jiggy - 25.10.2011

use Y_INI


Re: Help with reading/making files [rep+] - 4Brothers - 26.10.2011

Quote:
Originally Posted by henry jiggy
Посмотреть сообщение
use Y_INI
I was thinking that too


Re: Help with reading/making files [rep+] - .:Kaos:. - 26.10.2011

Quote:
Originally Posted by 4Brothers
Посмотреть сообщение
I was thinking that too
Y_Ini is a great way to make files. Fast and efficient. Here is the topic by ******. There is also a tutorial written by ****** himself that can be viewed here. If you didn't catch it in the first link the download for Y_Ini is here. Also there is a Register/Login that can be used for reference by Zh3r0 here!
Goodluck with your scripting.