To make a good server-side mod, one must use the abilities and settings of a Mini-game. In order for me to further my scripting knowledge by making simple mods, I need to understand how to initialize a mini-game when a dedicated server starts.
I have looked at an add-on made by Aloshi (part of it shown below):
//To make starting of minigames not admin-required, remove this:
package MinigameAO
{
function serverCmdCreateMinigame(%client,%a,%b,%c,%d,%e,%f,%g)
{
if(%client.issuperadmin || %client.isadmin)
{
Parent::serverCmdCreateMinigame(%client,%a,%b,%c,%d,%e,%f,%g);
}else{
messageclient(%client,"","Sorry, you are not an admin.");
}
}
};
activatePackage(MinigameAO);
.
.
.
See: Attachment 1
It would appear, however, that this code cannot be used for dedicated servers. I could be wrong on that though. From what I understand it calls the function serverCmdCreateMinigame which requires a client to initiate it.
The only other add-on I could think of that would have an example of this was the City RP add-on. It's code is poorly structured, all of it is in a single package, and for a novice coder like me it's hard to read. I found an area where it appears to create settings for the mini-game (shown below) but I don't have any idea how to actually activate the mini-game itself.
if(!isObject(CityRPMini))
{
new scriptObject(CityRPMini)
{
class = miniGameSO;
brickDamage = true;
brickRespawnTime = 10000;
colorIdx = -1;
enableBuilding = true;
enablePainting = true;
enableWand = true;
fallingDamage = true;
inviteOnly = true;
points_plantBrick = 0;
points_breakBrick = 0;
points_die = -1;
points_killPlayer = 1;
points_killSelf = -1;
playerDatablock = playerNoJet;
respawnTime = 5000;
selfDamage = true;
playersUseOwnBricks = false;
useAllPlayersBricks = true;
useSpawnBricks = false;
VehicleDamage = true;
vehicleRespawnTime = 5000;
weaponDamage = true;
numMembers = 0;
};
}
See: Attachment 2
Any help with figuring out how to create a mandatory mini-game at the start of a dedicated server would be most helpful.
EDIT: Attachments do not seem to be working at the moment. I'll try to upload the files to my web server.