startlotto
#1

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;
}

Reply
#2

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);
}
Reply
#3

Set a timer
Reply
#4

Lol i was gona do that beat me to it
Reply
#5

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?
Reply
#6

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
Reply
#7

new string[128];
Reply
#8

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)