Author Topic: Mandatory Mini-game on a Dedicated Server [Help]  (Read 824 times)

 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):
Code: [Select]
//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.
Code: [Select]
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.

Truce made a script for mandatory mini-games on dedicated servers for me.
If you want the script for disecting purposes I can send it to you.
The script has a few draw backs, like not being able to update the mini after you leave the server.
This is because the script detaches the minigame settings from the original creator.
PM me if you are interested.

EDIT: This script won't start a minigame upon starting the dedicated server.
          I'm sure you can figure it out.
« Last Edit: January 28, 2009, 03:24:24 PM by LoserHero »