SA-MP Forums Archive
help load - 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 load (/showthread.php?tid=659251)



LOAD FOPEN - Spawe - 28.09.2018

How could I load the following:

name:name server
mode:mode test
map:Los santos
url:www.sampforums.com
weather:10

of a text document in the scripfile folder already created to the GM using native functions example fopen


Re: help load - v1k1nG - 28.09.2018

That's server.cfg


Re: help load - Spawe - 28.09.2018

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
That's server.cfg
Yes but I want to load it from scriptfiles for example as it would be without using any reading system using native functions of samp


Re: help load - solstice_ - 28.09.2018

https://sampwiki.blast.hk/wiki/SetGameModeText
https://sampwiki.blast.hk/wiki/Advanced_Server_Controls

You can use SendRconCommand in your script, here are some RCON commands below:

PHP код:
RCON Commands
Type cmdlist 
for commands (or, varlist for variablesmaking use of the RCON in-game ('/rcon cmdlist'). You do not need to type with [ ] they're just to highlight the parameter.
These are the functions that you as admin can use:
/rcon cmdlist - Shows a list with commands.
/rcon varlist - Shows a list with the current variables.
/rcon exit - Closes the server.
/rcon echo [text] - Shows the [text] in the console of the server (NOT the client-console in-game).
/rcon hostname [name] - change the hostname text (example: /rcon hostname my server).
/rcon gamemodetext [name] - change the gamemode text (example: /rcon gamemodetext my gamemode).
/rcon mapname [name] - change the map name text (example: /rcon mapname San Andreas).
/rcon exec [filename] - Executes the file which contains server cfg (example: /rcon exec blah.cfg).
/rcon kick [ID] - Kick the player with the given ID (example: /rcon kick 2).
/rcon ban [ID] - Ban the player with the given ID (example: /rcon ban 2). 
etc..


Re: help load - Spawe - 28.09.2018

They are not understanding what I want to do, basically I have in a text document what I mentioned earlier as charge that from scriptfile to gamemode using fopen


Re: help load - solstice_ - 28.09.2018

I can't even understand what you're saying.


Re: help load - v1k1nG - 28.09.2018

https://sampwiki.blast.hk/wiki/Fopen

But idk, maybe Sql is better


Re: help load - Spawe - 28.09.2018

Let's see, I explain, I have the following in a txt file in scriptfile


name:Server
mode:Test
map:Samp
url:www.sampforums.com
weather:10

how do I charge that in the gamemode using fopen


Re: help load - Beckett - 29.09.2018

Use the function SendRconCommand and insert the command you wish to send after retrieving the data from your file.


Re: help load - Spawe - 29.09.2018

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Use the function SendRconCommand and insert the command you wish to send after retrieving the data from your file.
The problem is that I do not know how to load it with fopen