Help, please!
#1

Hey guys,
I have a problem with map changer. Well in pwn file there is no errors, but when the time is out map changes but it change only one. It dont change to another map. Always there is a same map. Please help me. Well, i hope you understand me, sorry for my bad english, im lLthuanian.
Reply
#2

I use this:
public GMChange(playerid)
{
new rand = random(5);
switch(rand)
{
case 0: SendRconCommand("changemode rivershell");
case 1: SendRconCommand("changemode kiemas");
case 2: SendRconCommand("changemode Helltunelis");
case 3: SendRconCommand("changemode modas3");
case 4: SendRconCommand("changemode usaandmec");
case 5: SendRconCommand("changemode uostas");
}
return 1;
}[
And always change same map... Please someone help...
Reply
#3

Someone, please, help... I dont know what to do... Ofcourse there is a easy mistake...
Reply
#4

Do you use a timer for this?
Reply
#5

Yes. SetTimer("GMChange",1800000,false);
Reply
#6

pawn Code:
forward GMChange();
public GMChange()
{
    new rand = random(6);
    switch(rand)
    {
        case 0: SendRconCommand("changemode rivershell");
        case 1: SendRconCommand("changemode kiemas");
        case 2: SendRconCommand("changemode Helltunelis");
        case 3: SendRconCommand("changemode modas3");
        case 4: SendRconCommand("changemode usaandmec");
        case 5: SendRconCommand("changemode uostas");
    }
    return 1;
}
First of all, you do not need the playerid in the callback.
Second of all, you were defining 5 randoms, while you have got 6.
And probably you have missed the forward of the callback.
Reply
#7

A stupid mistake SetTimer("GMChange",1800000,true); // You put the timer not to repet. So after the timer is done once, it won't repete.
Reply
#8

And another stupid mistake.
Do you know that, 1,800,000 seconds are 30,000 minutes, which is equivalent to 500 hours?
I don't think you waited that long to see if the map changes.
Reply
#9

Failz0r. 1800000 in secounds = 1800000/1000 = 1800 this much secounds. Which is 30 minutes.

1 s = 1000 ms

+ Rep (Joke)
Reply
#10

Oh yeah, you are right.
My stupid mistake
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)