Post: Stable Roll the dice Template.
10-27-2011, 06:13 PM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); i got bored and decided to write this up however couldn't be bothered to add the rolls and such..
might aswell release it for people to make there own Smile

    
Correy()
{ self thread GetRolls();
for( i = 0; i < self.Number.size; i++)
self.RandomRoll = randomInt( self.Number[i] );
wait 1;
self thread [[self.Function[self.RandomRoll]]](self.Input[self.RandomRoll]);
self thread MonitorDeath();
}
GetRolls()
{ self notify( "player_rolled" );
self addRoll( 0, "Roll 1", "Power One", ::test);
self addRoll( 1, "Roll 2", "Power Two", ::test);
self addRoll( 2, "Roll 3", "Power Three", ::test);
}
MonitorDeath()
{ self waittill( "death" );
//Add your reset codes here.
}
addRoll( number, name, power, function, input )
{ self.Number[self.RandomRoll] = number;
self.RollName[self.RandomRoll] = name;
self.PowerText[self.RandomRoll] = power;
self.Function[self.RandomRoll] = function;
if( isDefined(input))
{
self.Input[self.RandomRoll] = input;
}
}
hintText()
{ self waittill( "player_rolled" );
self thread maps\mp\gametypes\_hud_message:GaspldNotifyMessage("You Rolled" +self.Number, self.RollName );
wait 1;
self iPrintln("Your Power Is : "+self.PowerText);
}
test(){}


how to add a roll..
    
self addRoll( < roll number > , < name of the roll > , < power text as iPrintLn/ info on the roll> , < roll function > , < roll input >


and here's an example to clear things up..
    
self addRoll( 0, "All Guns", "You've been given all guns!", ::AllGuns);


the output will be..
- oldnotify message saying "You Rolled 0" "All Guns"
- self iPrintLn sayibg "Your Power Is : You've been given all guns"

also, to stable it up make sure you add your reset dvars onto the monitorDeath.. it sables thing up, there's a comment there so you can't miss it.
enjoy rolling the dice Enzo
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to Correy for this useful post:

INSAN3LY_D34TH, xRaW
11-11-2011, 03:46 PM #20
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by xxshredgnarxx View Post
are you sure itll work??


yes i am 90% sure
11-11-2011, 08:37 PM #21
xxshredgnarxx
Treasure hunter
Originally posted by D34TH View Post
yes i am 90% sure


lol ok dawg
11-12-2011, 11:36 AM #22
Correy
I'm the Original
Originally posted by x. View Post
What's wrong with a good old "if" statement.. or switch case...
You can over complicate things you know...


switch case i dont like and addRoll is easier in the long term, e.g. adding Alot of roles :p
11-12-2011, 11:39 AM #23
Originally posted by Correy View Post
switch case i dont like and addRoll is easier in the long term, e.g. adding Alot of roles :p

It's no easier than adding these

if(num==1){dowhatever();print("whatever";}) }

And that doesn't need any for(;; ) loops..
11-12-2011, 11:44 AM #24
Correy
I'm the Original
Originally posted by x. View Post
It's no easier than adding these

if(num==1){dowhatever();print("whatever";}) }

And that doesn't need any for(;; ) loops..


yes but what if i had 100 roles, what would be shoter?
x100 times of these
    
if( self.Roll == 0 ) {
}


or x100 these?
    
self addRoll( 0, "BLAH, "Blah", ::Roll );


you see what i mean?

---------- Post added at 11:44 AM ---------- Previous post was at 11:42 AM ----------

Originally posted by x. View Post
It's no easier than adding these

if(num==1){dowhatever();print("whatever";}) }

And that doesn't need any for(;; ) loops..


although it has functions with it, it still will be shorted after say.. 20 rolls then compare your version to mine, mine would work out smaller.
11-12-2011, 11:47 AM #25
Originally posted by Correy View Post
yes but what if i had 100 roles, what would be shoter?
x100 times of these
    
if( self.Roll == 0 ) {
}


or x100 these?
    
self addRoll( 0, "BLAH, "Blah", ::Roll );


you see what i mean?
There wouldn't be much in it.... but whatever floats your boat I suppose..

---------- Post added at 11:47 AM ---------- Previous post was at 11:44 AM ----------

Originally posted by Correy View Post
then compare your to mine, mine would work out smaller.
So, you're admitting that mine is bigger than yours? Winky Winky
11-12-2011, 12:03 PM #26
Correy
I'm the Original
Originally posted by x. View Post
There wouldn't be much in it.... but whatever floats your boat I suppose..

---------- Post added at 11:47 AM ---------- Previous post was at 11:44 AM ----------

So, you're admitting that mine is bigger than yours? Winky Winky


i wrote a full paragraph until i clicked on ha. to much partying last night :p
no no, you wish Winky Winky

---------- Post added at 12:03 PM ---------- Previous post was at 11:55 AM ----------

Originally posted by x. View Post
There wouldn't be much in it.... but whatever floats your boat I suppose..

---------- Post added at 11:47 AM ---------- Previous post was at 11:44 AM ----------

So, you're admitting that mine is bigger than yours? Winky Winky


count the chars, same out of rolls :p
    
RollTheDice()
{
self.Rolled = randomInt(10);
if (self.Rolled == 0)
{
self thread athread();
}
if (self.Rolled == 1)
{
self thread athread();
}
if (self.Rolled == 2)
{
self thread athread();
}
if (self.Rolled == 3)
{
self thread athread();
}
if (self.Rolled == 4)
{
self thread athread();
}
if (self.Rolled == 5)
{
self thread athread();
}
if (self.Rolled == 6)
{
self thread athread();
}
if (self.Rolled == 7)
{
self thread athread();
}
if (self.Rolled == Cool Man (aka Tustin)
{
self thread athread();
}
if (self.Rolled == 9)
{
self thread athread();
}
if (self.Rolled == 10)
{
self thread athread();
}
}

    
RollTheDice()
{
self.Rolled = randomInt(10);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
wait .1;
self thread [[self.F[self.Rolled]]();
}
addRoll(f)
{
i=self.F.size-1;
self.F[self.Rolled][i] = f
}
11-12-2011, 12:13 PM #27
Originally posted by Correy View Post
i wrote a full paragraph until i clicked on ha. to much partying last night :p
no no, you wish Winky Winky

---------- Post added at 12:03 PM ---------- Previous post was at 11:55 AM ----------



count the chars, same out of rolls :p
    
RollTheDice()
{
self.Rolled = randomInt(10);
if (self.Rolled == 0)
{
self thread athread();
}
if (self.Rolled == 1)
{
self thread athread();
}
if (self.Rolled == 2)
{
self thread athread();
}
if (self.Rolled == 3)
{
self thread athread();
}
if (self.Rolled == 4)
{
self thread athread();
}
if (self.Rolled == 5)
{
self thread athread();
}
if (self.Rolled == 6)
{
self thread athread();
}
if (self.Rolled == 7)
{
self thread athread();
}
if (self.Rolled == Cool Man (aka Tustin)
{
self thread athread();
}
if (self.Rolled == 9)
{
self thread athread();
}
if (self.Rolled == 10)
{
self thread athread();
}
}

    
RollTheDice()
{
self.Rolled = randomInt(10);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
self addRollUpside Down Happy:athread);
wait .1;
self thread [[self.F[self.Rolled]]();
}
addRoll(f)
{
i=self.F.size-1;
self.F[self.Rolled][i] = f
}


Firstly, I'm not going to sit here counting the characters.

Secondly, I agree with your sig 100%

Winky Winky
11-12-2011, 12:22 PM #28
Correy
I'm the Original
Originally posted by x. View Post
Firstly, I'm not going to sit here counting the characters.

Secondly, I agree with your sig 100%

Winky Winky


yeah ikr, i unstalled all my coding programs, cod4.. Everything.
the only thing i have now is maybe skype :p, the only reason im on this now is well, im chatting to you and im waiting to get picked up lmao.

and btw, mine- 412.. yours... 616 or something Winky Winky

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo