package rouletteBot {
$rouletteBarrel = getrandomnum(1,6);
$rouletteScoreCombo = 0;
$rouletteLastShoot = NaN;
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) {
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
if (striPos(%msg,"Roulette") > 0) {
if (striPos(%msg,"shoot me") > 0) {
if ($rouletteLastShoot != %name) {
commandToServer('messageSent',%name@" spins the barrel and pulls the trigger...");
%tempval = getrandomnum(1,6);
if (%tempval = $rouletteBarrel) {
$rouletteScore[%name] ++;
export("$rouletteScore*","add-ons/client_roulette/scores.cs");
$rouletteLastShoot = NaN;
$rouletteBarrel = getRandomNum(1,6);
commandToServer('messageSent',"*BLAM*... "@%name@" got hit! "@%name@" has been hit "@$rouletteScore[%name]@" times.");
} else {
commandToServer('messageSent',"*Chk*... "@%name@" escaped the bullet! Good job!");
$rouletteLastShoot = %name;
}
} else {
commandToServer('messageSent',"Silly "@%name@", you can't shoot twice in a row! Let somebody else have a turn, please.");
}
}
}
};
User was banned for this post