|
|
#1 |
|
Big Clucker
![]() ![]() Join Date: Jan 2011
Location: UK
Posts: 133
Reputation: 34
|
SA-MP Query and RCON API for PHP Edward McKnight (EM-Creations.co.uk) - StatusRed Version: 1.0 (30/06/2012) PHP Version: 5.3 (should work with earlier versions also however) Additional credits: Westie (for the original PHP SA-MP API and inspiration for this API) As well as the examples here; included in the download are SampRconExample.php and SampQueryExample.php files. These are full of examples of how to call functions as well as documentation. Feel free to post if you have any questions or problems. SampQuery functions: SampQuery(server, port) SampQuery->connect() SampQuery->close() SampQuery->getInfo() SampQuery->getBasicPlayers() SampQuery->getDetailedPlayers() SampQuery->getRules() SampQuery->getPing() - Not in Westie's API Example | Output server info and basic players: PHP Code:
SampRcon(server, port, password) SampRcon->connect() SampRcon->close() SampRcon->getCommandList() SampRcon->getServerVariables() SampRcon->setWeather(weatherID=1) SampRcon->setGravity(gravity=0.008) SampRcon->ban(playerID) SampRcon->kick(playerID) SampRcon->banAddress(address) SampRcon->unbanAddress(address) SampRcon->reloadLog() SampRcon->reloadBans() SampRcon->say(message) SampRcon->changeGameMode(gameMode) SampRcon->setGameModeText(gameModeText) - Not in Westie's API SampRcon->nextGameMode() SampRcon->gmx() {same as SampRcon->nextGameMode()} SampRcon->execConfig(config) SampRcon->loadFilterscript(fs) SampRcon->loadFS(fs) {same as SampRcon->loadFilterscript(fs)} SampRcon->unloadFilterscript(fs) SampRcon->unloadFS(fs) {same as SampRcon->unloadFilterscript(fs)} SampRcon->reloadFilterscript(fs) SampRcon->reloadFS(fs) {same as SampRcon->reloadFilterscript(fs)} SampRcon->exitGame() SampRcon->setHostName(hostName) - Not in Westie's API SampRcon->setMapName(mapName) - Not in Westie's API SampRcon->setTime(time) - Not in Westie's API SampRcon->setURL(url) - Not in Westie's API SampRcon->setPassword(password) - Not in Westie's API SampRcon->removePassword() - Not in Westie's API SampRcon->setRconPassword(password) - Not in Westie's API SampRcon->disableRcon() - Not in Westie's API SampRcon->enableQuery() - Not in Westie's API SampRcon->disableQuery() - Not in Westie's API SampRcon->enableAnnounce() - Not in Westie's API SampRcon->disableAnnounce() - Not in Westie's API SampRcon->setMaxNPCs(maxNPCs) - Not in Westie's API SampRcon->call(command, delay) Example | Output command list: PHP Code:
PHP Code:
|
|
|
|
|
|
#2 |
|
Guest
Posts: n/a
|
Good job again!
![]() Alot of more functions than the westie's query api ^_^ |
|
|
|
#3 |
|
Big Clucker
![]() ![]() Join Date: Jan 2011
Location: UK
Posts: 133
Reputation: 34
|
|
|
|
|
|
|
#4 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Feb 2010
Location: 52.511938,6.092434 find it.
Posts: 440
Reputation: 20
|
How can you get the information detailed on the page like in a table?
|
|
|
|
|
|
#5 | |
|
Big Clucker
![]() ![]() Join Date: Jan 2011
Location: UK
Posts: 133
Reputation: 34
|
Quote:
PHP Code:
Last edited by StatusRed; 10/07/2012 at 05:02 PM. |
|
|
|
|
|
|
#6 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Feb 2010
Location: 52.511938,6.092434 find it.
Posts: 440
Reputation: 20
|
Code:
Parse error: syntax error, unexpected T_AS, expecting ';' in /home/kevin/public_html/online.php on line 60 PHP Code:
|
|
|
|
|
|
#7 |
|
Big Clucker
![]() ![]() Join Date: Jan 2011
Location: UK
Posts: 133
Reputation: 34
|
|
|
|
|
|
|
#8 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Feb 2010
Location: 52.511938,6.092434 find it.
Posts: 440
Reputation: 20
|
Yeah just working out the css now, http://transrp.tk/online.php
|
|
|
|
|
|
#9 | |
|
Big Clucker
![]() ![]() Join Date: Jan 2011
Location: UK
Posts: 133
Reputation: 34
|
Quote:
|
|
|
|
|
|
|
#10 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Feb 2010
Location: 52.511938,6.092434 find it.
Posts: 440
Reputation: 20
|
Maybe you can help me, I'm trying to align it to the left as you may see how it's bugged atm.
Code now: PHP Code:
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Tool/Web/Other] [Java] Query and RCON API (25/06/2012) | StatusRed | Tools and Files | 10 | 02/02/2013 09:44 AM |
| [Tool/Web/Other] [Python] Query and RCON API (23/06/2012) | StatusRed | Tools and Files | 13 | 25/06/2012 03:27 PM |
| [Android]SA-MP App - Query and send RCON commands to your servers | R@f | Everything and Nothing | 25 | 04/06/2012 11:35 PM |
| SAMP RCON & Query API | CaTaLinU | Scripting Help | 5 | 11/02/2012 11:25 AM |
| Westies API / SAMP Api (Query & RCON) | Lee Strong | Help Archive | 2 | 14/10/2010 09:37 AM |