SA-MP Forums Archive
[Tool/Web/Other] [INC/SDK][PHP] RCON PHP include/plugin/SDK - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [Tool/Web/Other] [INC/SDK][PHP] RCON PHP include/plugin/SDK (/showthread.php?tid=53937)



[INC/SDK][PHP] RCON PHP include/plugin/SDK - krisk - 25.10.2008

PHP RCON Include
Here's an include for your PHP administration panel allowing you to parse RCON commands through PHP, all you need to do is to include this the file in "includes" to your code, as shown in the example code, and you're good to use the object.

There are some checks inside the functions here, but however, I'm not able to determine whether filterscripts/gamemodes etc. exists on the game server, however, if you have your web server running on the same server as your sa-mp server, it isn't too hard to have a "file_exists" function added to the gamemode/FS change functions inside the object, but as it's very few having that benefit, I didn't see the reason to add it.

NOTE: This is not a working control panel of any kind, this is simply an include/SDK for web developers to be able to use RCON functions/commands inside their code easily.

Important note: All functions returns whatever RCON returned, so bare in mind that you can easily store the result in a variable and log or print it's output.

Function list

CRcon::GetCommandList(/* No params */)
CRcon::TerminateServer(/* No params */)
CRcon::SendRconAdminsMessage(/* String */ $sMessage)
CRcon::Kick(/* Integer */ $iPlayerID)
CRcon::Ban(/* Integer */ $iPlayerID)
CRcon::RconExec(/* String */ $sFilename)
CRcon::ChangeMode(/* String */ $sModeName)
CRcon::GameModeExit(/* No params */)
CRcon::Reloadlog(/* No params */)
CRcon::ReloadBans(/* No params */)
CRcon::SendMessage(/* String */ $sMessage)
CRcon::GetPlayerList(/* No params */)
CRcon::BanIP(/* String */ $sIP, /* Integer */ $iReloadBans = 1)
CRcon::UnbanIP(/* String */$sIP, /* Integer */$iReloadBans = 1)
CRcon::SetGravity(/* Float */ $fGravity)
CRcon::SetWeather(/* Integer */ $iWeatherID)
CRcon::LoadFS(/* String */ $sFScriptName)
CRcon::UnloadFS(/* String */ $sFScriptName)

(P.S. if you ever need to call CRcon::Raw($raw_command) you'll have to remove or replace the "private" flag on the function inside the object with either nothing or with "public".)

Download here!


Re: [INC/SDK][PHP] RCON PHP include/plugin/SDK - Zero:VCK - 25.10.2008

Looks interesting, i may have to test it out.


Re: [INC/SDK][PHP] RCON PHP include/plugin/SDK - whooper - 25.10.2008

:O sweet!


Re: [INC/SDK][PHP] RCON PHP include/plugin/SDK - Zezombia - 25.10.2008

Nice... now someone's gonna make an Internet Server Admin lol.


Re: [INC/SDK][PHP] RCON PHP include/plugin/SDK - krisk - 25.10.2008

Quote:
Originally Posted by Zezombia
Nice... now someone's gonna make an Internet Server Admin lol.
I believe there are several admin panels out, I have made my own too. However, yeah, I don't think there are too many, if any, released?


Re: [INC/SDK][PHP] RCON PHP include/plugin/SDK - Zezombia - 25.10.2008

Not that I've seen, but I think Westie made and released an RCON panel?


Re: [INC/SDK][PHP] RCON PHP include/plugin/SDK - krisk - 25.10.2008

Quote:
Originally Posted by Zezombia
Not that I've seen, but I think Westie made and released an RCON panel?
I think that was more of a server panel, not directly RCON but like start and stop server etc.


Re: [INC/SDK][PHP] RCON PHP include/plugin/SDK - Zezombia - 25.10.2008

Found it,

http://forum.sa-mp.com/index.php?topic=70078.0


Re: [INC/SDK][PHP] RCON PHP include/plugin/SDK - lillilmike - 28.10.2008

I'm such a noob at this but getting better hopefully. So what exactly does this do, will there be a design for it to actually use it?


Re: [INC/SDK][PHP] RCON PHP include/plugin/SDK - Karlip - 28.10.2008

Krisk

Nice!