SA-MP Forums Archive
random select player = <?> - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: random select player = <?> (/showthread.php?tid=87778)



random select player = <?> - hipy - 22.07.2009

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


Re: random select player = <?> - M4S7ERMIND - 22.07.2009

the idea totally fails


Re: random select player = <?> - hipy - 22.07.2009

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?


Re: random select player = <?> - yezizhu - 22.07.2009

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


Re: random select player = <?> - hipy - 22.07.2009

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


Re: random select player = <?> - pen_theGun - 22.07.2009

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


Re: random select player = <?> - pen_theGun - 22.07.2009

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 --
}