Jump to content

need help


Machine

Recommended Posts

Posted

hello well im making site to control my server

but the problem is im using php

so what is the code to start mtasa server using php programming

pls help me

Posted

fetchRemote 

Maybe ??

This function allows you to post and receive data from HTTP servers. The calls are asynchronous so you do not get an immediate result from the call, instead a callback function you specify is called when the download completes.

In the case when the call fails, a string containing "ERROR" followed by an integer containing the error reason will be passed to the callback function. The reason for failure will be similar to errors found with websites - file not found, server not found and timeouts.

If you are using fetchRemote to connect to a PHP script, you can use file_get_contents("php://input") to read the postData sent from this function.

  

Posted

If it's impossible, mind explaining how all the game hosting companys work? because most of them got a control panel to restart/stop/start the server.

@Machine, Micro: I don't know anything about this I'm afraid.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted (edited)
Make no sense.

Since you think it's impossible then you have no business here.

Yes why? becuase his code make no sense in Lua PG.

ummm, actually, that's php programming(website programming)

Edited by Guest

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted

Topic moved out of scripting section, since that section is meant for Lua scripting help.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

@Mr.Pres[T]ege, no, that has nothing to do with what he wants / No, it isn't impossible. / His code DOES makes sense, it's PHP.

@Micro, is the page running in the same folder as the server?

@Jaysds1, PHP isn't for website design.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted
Are you running your site on a vps?

What does that has to do?

@Micro, I've never used exec function so I can't help you much but are you sure the PHP page is being executed? Try outputting something when the page loads with "echo".

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

all this codes not workin

<?php

if ($_REQUEST['soft']=='toto')

shell.exec("./mta-server --ip %IP% --port %PORT%");

shell.exec("nohup ./mta-server --ip %IP% --port %PORT%");

shell.exec("sudo nohup ./mta-server --ip %IP% --port %PORT%");

exec("sudo nohup ./mta-server");

?>

94.23.158.18022003.png
Posted

There is no such "shell.exec" function in PHP AFAIK.

Also, are you sure you're sending the data 'soft' with value 'toto'? The page URL would be something like this: "http://www.mypage.com/index.php?soft=toto".

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...