Is it possible ?
#1

Hey guys!
I want to ask you about mode changer. I'm using this code to change a mode: SendRconCommand("changemode bla bla"); And for example i have three maps and is it possible that mode change to random ? I mean first mode change to second and second mode change to third, so for example first mode change to third mode for random. Is it possible ?
I hope you understand me, sorry for my bad english. I'm Lithuanian
Reply
#2

Well, just use the "random" function.
pawn Код:
new rand = random(4);
switch(rand)
{
    case 0: SendRconCommand("changemode map 1");
    case 1: SendRconCommand("changemode map 2");
    case 2: SendRconCommand("changemode map 3");
    case 3: SendRconCommand("changemode map 4");
    case 4: SendRconCommand("changemode map 5");
}
It will give you a random map, and always different. Just change the map name, and the amount of cases to the amount of maps you got.
Reply
#3

Wesley, why create a new variable for it? Unless it is going to be used again, this can be done instead:
pawn Код:
switch(random(4))
Reply
#4

Oh, thank you Wesley221! Also AndreT thank you too!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)