50% variable
#1

Hey all

How do I make a variable 50% percent to be true(or 1)?

Thx
Reply
#2

um? can you explain more please?
Reply
#3

pawn Код:
if(var1 == 1) {
SendClientMessage(playerid,red,"TROLL");
} else {
SendClientMessage(playerid,red,"NOT TROLL");
}
So I want var1 to be randomly 1 or 0 :]
Reply
#4

Код:
new VaribleHere = -1;

OnGamemodeInit

new rand = random(100);

if(rand <= 50) { VaribleHere = 1; } // True
else { VaribleHere = 0 } //False
Reply
#5

Explained like this has no sense, but...
pawn Код:
#define TRUE 2
#define MIDDLE 1
#define FALSE 0
new
    variable;
Set variable to '2' if you want it to true, set it to '1' if you want it to 50% and set it to '0' if you want it false...
Reply
#6

pawn Код:
switch(random(2))
    {
        case 0: SendClientMessage(playerid,red,"TROLL");
        case 1: SendClientMessage(playerid,red,"NOT TROLL");
    }
something like that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)