SA-MP Forums Archive
startlotto - 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: startlotto (/showthread.php?tid=89951)



startlotto - WardenCS - 05.08.2009

hey, i need help again,i got /startlotto cmd,i want that to do automatically every full hour,how can i do that?

heres the CMD

Quote:

if(strcmp(cmd, "/startlotto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
format(string, sizeof(string), "Lottery News: We have started the Lottery Election.");
OOCOff(COLOR_WHITE, string);
new rand = random(80);
if(rand < 77) { rand += 3; }
Lotto(rand);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not an Admin !");
return 1;
}
}
return 1;
}




Re: startlotto - SiJ - 05.08.2009

Quote:
Originally Posted by Joker_EST
hey, i need help again,i got /startlotto cmd,i want that to do automatically every full hour,how can i do that?

heres the CMD

pawn Код:
forward LottoTimer();  
public LottoTimer()
{
for(new playerid=0;playerid<=MAX_PLAYERS;playerid++)
    {
      if(IsPlayerConnected(playerid))
      {
          format(string, sizeof(string), "Lottery News: We have started the Lottery Election.");
          OOCOff(COLOR_WHITE, string);
          new rand = random(80);
          if(rand < 77) { rand += 3; }
          Lotto(rand);
      }
        return 1;
    }
}

OnGameModeInit()
{
SetTimer("LottoTimer",3600000,1);
}



Re: startlotto - Kyle - 05.08.2009

Set a timer


Re: startlotto - Kyle - 05.08.2009

Lol i was gona do that beat me to it


Re: startlotto - SiJ - 05.08.2009

Quote:
Originally Posted by KyleSmith
Lol i was gona do that beat me to it
Why are you making 2 posts in a row in 30 sec?


Re: startlotto - WardenCS - 05.08.2009

Quote:

C:\Documents and Settings\ingrid\Desktop\New Folder (4)\JRPLAST\gamemodes\JRP.pwn(552) : error 017: undefined symbol "string"
C:\Documents and Settings\ingrid\Desktop\New Folder (4)\JRPLAST\gamemodes\JRP.pwn(552) : error 017: undefined symbol "string"
C:\Documents and Settings\ingrid\Desktop\New Folder (4)\JRPLAST\gamemodes\JRP.pwn(552) : error 029: invalid expression, assumed zero
C:\Documents and Settings\ingrid\Desktop\New Folder (4)\JRPLAST\gamemodes\JRP.pwn(552) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

:O


Re: startlotto - Kyle - 05.08.2009

new string[128];


Re: startlotto - WardenCS - 05.08.2009

oh lol got it no errors now...i wait for payday now thaaanks


Re: startlotto - Cracker - 20.08.2009

where exactly it have to be set?
End of /startlotto script? or middle of it somehow?