20.02.2010, 17:06
(
Last edited by Flag; 19/07/2010 at 04:11 PM.
)
ServerQuery 1.1
With this plugin you can easily get server-information and rules from foreign servers.Functions:
Code:
native GetInfoPacket(ip[],port); native iIsPassworded(); native iGetPlayers(); native iGetMaxPlayers(); native iGetHostname(hostname[]); native iGetGamemode(gamemode[]); native iGetMapname(mapname[]); native GetRulesPacket(ip[],port); native rGetRulesAmount(); native rGetRuleName(ruleid,rulename[]); native rGetRuleValue(ruleid,rulevalue[]); native GetPlayerPacket(ip[],port); native cGetPlayers(); native cGetPlayerName(playerid,plname[]); native cGetPlayerScore(playerid);
First you need to retrieve a package. If you want to get the ServerInfo pagage you have to type:
Code:
GetInfoPacket("127.0.0.1",7777);
If it returns 1, you got a package from the server. Then you can use each function with the letter 'i' at the beginning. If you use the function GetRulesPacket() you can use every function with the letter 'r' at the beginning.
For a full example you can download this filterscript.
To get the right ruleid you can use the order as the sa:mp client:
0...gravity
1...mapname
2...version
3...weather
4...weburl
6...worldtime
You don't need a plugin on another server. Only on your server.
Changelog
v.1.0:
- Release
v.1.1:
- Added rGetRulesAmount() (and rule amount max. is 20 now) to get modified rule keys
- Added Package 'c' functions:
you can now get the playerlist from a remote server.
- Added timout protection to prevent server crashes
Download:
ServerQuery v.1.0
ServerQuery v.1.1
ServerQuery v.1.1 - Mirror 2
Source