#define cfg_SERVER_MAXPLAYERS "100" //PARAMETERS: Number value (1-500 as of 0.3c)
SendRconCommand("maxplayers " cfg_SERVER_MAXPLAYERS);
printf("\t[-] Server Max Players: %s", cfg_SERVER_MAXPLAYERS);
#define cfg_SERVER_MAXPLAYERS 100 //PARAMETERS: Number value (1-500 as of 0.3c)
new le[32];
format(le, 32, "maxplayers %d", cfg_SERVER_MAXPLAYERS);
SendRconCommand(le);
printf("\t[-] Server Max Players: %d", cfg_SERVER_MAXPLAYERS);
#define cfg_SERVER_MAXPLAYERS "100" //PARAMETERS: Number value (1-500 as of 0.3c)
new number, le[32];
number = strval(cfg_SERVER_MAXPLAYERS);
format(le, 32, "maxplayers %d", number);
SendRconCommand(le);
printf("\t[-] Server Max Players: %d", strval(cfg_SERVER_MAXPLAYERS));
Umm.. first, SendRconCommand has only 1 parameter (which is the command itself), and the second error is that you're printing the max players as a string while it is a integer (or you can use strval to convert it to a integer), and last thing is that you've defined cfg_SERVER_MAX_PLAYERS as a string.
You can either use format() and strval() or use format() and converting your values to integer. Solution 1: pawn Код:
pawn Код:
|
SA-MP Dedicated Server ---------------------- v0.3c R2, ©2005-2011 SA-MP Team [14:11:38] filterscripts = "" (string) [14:11:38] [14:11:38] Server Plugins [14:11:38] -------------- [14:11:38] Loading plugin: sscanf [14:11:38] [14:11:38] =============================== [14:11:38] sscanf plugin loaded. [14:11:38] © 2009 Alex "******" Cole [14:11:38] =============================== [14:11:38] Loaded. [14:11:38] Loading plugin: streamer [14:11:38] *** Streamer Plugin v2.5.1 by Incognito loaded *** [14:11:38] Loaded. [14:11:38] Loaded 2 plugins. [14:11:38] [14:11:38] Filter Scripts [14:11:38] --------------- [14:11:38] Loaded 0 filter scripts. [14:11:38] [+] SERVER CONFIGURATION [14:11:38] [14:11:38] [-] Server Name: Land o' Casinos Roleplay [14:11:38] [-] Server Version: LoC v1.0 [14:11:38] maxplayers = 3 (int, read-only) //Problem area. [14:11:38] [-] Server Max Players: d [14:11:38] [-] CJ Run: [ON] [14:11:38] [-] 1 Pickup(s) loaded from "Pickups.txt" [14:11:38] [-] 0 Vehicle(s) loaded from "Vehicles.txt" [14:11:38] [-] 1 Label(s) loaded from "Labels.txt" [14:11:38] [-] 1 Map Icon(s) loaded from "MapIcons.txt" [14:11:38] [14:11:38] [+] SERVER ONLINE! [14:11:38] Number of vehicle models: 0 |
new MPlayers, MPlayersFormated[32];
MPlayers = strval(cfg_SERVER_MAXPLAYERS);
format(MPlayersFormated, 32, "maxplayers %d", MPlayers);
SendRconCommand(MPlayersFormated);
printf("\t[-] Server Max Players: %s", strval(cfg_SERVER_MAXPLAYERS));
printf("\t[-] Server Max Players: %d", strval(cfg_SERVER_MAXPLAYERS));
pawn Код:
|
You can't change that value in-game, it's a read-only value that has no RCON command / entry.
|