Author Topic: A Simple Minigame Score Code  (Read 1688 times)


Yeah yeah hold on.


Code: [Select]
package BrickScore
{
function fxDTSBrick::onPlant(%brick, %brick2)
{

//if($classon||%brick.client.nobuild){
if(%brick.client.minigame){
schedule(75,0,"BSPlantCheck",%brick);
}
//}
parent::onPlant(%brick, %brick2);
}

function BSPlantCheck(%brick,%i)
{
if(%i>5){return;}//hasnt been planted, abort.
if(!%brick.isplanted){
schedule(75,0,"BSPlantCheck",%brick,%i++);//loop through untill it is planted
return;
}
if(%brick.client.score<=0){
%brick.delete();
messageclient(%brick.client,'',"You cannot build that because you do not have enough score! Get more score!");
return;
}
%brick.client.incscore(-1);
centerprint(%brick.client,"Score:" SPC %brick.client.score,5);
}
}

};
activatepackage("BrickScore");
While that should work, I haven't tested it.

Put it in a server.cs in any folder in add-ons (suggest making one called "server_brickscore")
Add a description.txt (look at other add-ons for examples)
Enable in-game.
« Last Edit: July 13, 2010, 09:34:30 PM by rkynick »

Yeah yeah hold on.


-Useful snip-
While that should work, I haven't tested it.

Put it in a server.cs in any folder in add-ons (suggest making one called "server_brickscore")
Add a description.txt (look at other add-ons for examples)
Enable in-game.
Hey, thanks rkynick.

I'll test it tomorrow, but otherwise, thanks.

Let me know if it works out fer ya.

Did that work out for you?

Need anything added/changed?

Did that work out for you?

Need anything added/changed?
Well, I packaged it up and stuff, but no one ever came to my server because my router is so unpredictable. I'll have a chance to test it this weekend, but thanks.