random select player = <?>
#1

Hi, THis sound a bit weird but im trying a system with like

if player == stupid { bla bla explode bla etc }
if player == nice {teleport etc }

So on player connect i want a system that randomy selects or stupid or nice, like player = nice or player = stupid( and that random ( i have more btw, i have also sweet and angry ). How can you do this? or is this not posible?

thanks
Reply
#2

the idea totally fails
Reply
#3

Quote:
Originally Posted by Μαστερμινδ
the idea totally fails
why? ...

I just want to know how to do it. Why do you cair where for its going to be used?
Reply
#4

Код:
switch(random(2)){
  case 0:{bla}
  case 1:{bla}
}
DIY
Reply
#5

sombody said
Код:
new iRandomNumber = random(25);
would that ma e irandomnumber = (1 - 25 ) ?
Reply
#6

Quote:
Originally Posted by hipy
Код:
new iRandomNumber = random(25);
would that ma e irandomnumber = (1 - 25 ) ?
it is numbers (0...24)
Reply
#7

pawn Код:
// ++ Top ++

#define MAX_CONDITIONS 4

#define NICE 0
#define STUPID 1
#define SWEET 2
#define ANGRY 3
new condition[MAX_PLAYERS];

// -- Top --



public OnPlayerConnect( playerid )
{
    new randnum=random( MAX_CONDITIONS );
    condition[playerid]=randnum;
   
    // ++ Example ++
    switch( condition[playerid] )
    {
        case 0: SendClientMessage( playerid, 0x0000FFFF, " ** Nicee **" );
        case 1: SendClientMessage( playerid, 0x0000FFFF, " ** Stupid **" );
        case 2: SendClientMessage( playerid, 0x0000FFFF, " ** Sweet **" );
        case 3: SendClientMessage( playerid, 0x0000FFFF, " ** Angry **" );
    }
    // -- Example --
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)