Help, please! - 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: Help, please! (
/showthread.php?tid=278647)
Help, please! -
Setkus - 23.08.2011
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.
Re: Help, please! -
Setkus - 23.08.2011
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...
Re: Help, please! -
Setkus - 23.08.2011
Someone, please, help... I dont know what to do... Ofcourse there is a easy mistake...
Re: Help, please! -
Pinguinn - 23.08.2011
Do you use a timer for this?
Re: Help, please! -
Setkus - 23.08.2011
Yes. SetTimer("GMChange",1800000,false);
Re: Help, please! -
[MWR]Blood - 23.08.2011
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.
Re: Help, please! -
sleepysnowflake - 23.08.2011
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.
Re: Help, please! -
[MWR]Blood - 23.08.2011
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.
Re: Help, please! -
sleepysnowflake - 23.08.2011
Failz0r. 1800000 in secounds = 1800000/1000 = 1800 this much secounds. Which is 30 minutes.
1 s = 1000 ms
+ Rep

(Joke)
Re: Help, please! -
[MWR]Blood - 23.08.2011
Oh yeah, you are right.

My stupid mistake