21.12.2016, 16:35
Sup!
i find lottery script and it have /startlotto command bat i want make it without command just when server online this system start by her self
I tried put this code part into ongamemodeinit
Bat happen nothing
i find lottery script and it have /startlotto command bat i want make it without command just when server online this system start by her self
Код:
CMD:startlotto(playerid,params[]) { new startername[MAX_PLAYER_NAME],stri[200]; if(IsLottoStarted==true)return SendClientMessage(playerid, 0xFF4500AA, "Lottery has already been started"); IsLottoStarted=true; GetPlayerName(playerid,startername,sizeof(startername)); format(stri,sizeof(stri),"%s has started Lottery",startername); SendClientMessageToAll(0xCCFF00,stri); format(stri,sizeof(stri),"It will be drawed after %i minutes.",lottogap); SendClientMessageToAll(0xCCFF00,stri); format(stri,sizeof(stri),"Current lottery is of %i score",lottoadd); SendClientMessageToAll(0xCCFF00,stri); format(stri,sizeof(stri),"Do /ticket [your number] to take a ticket | The number should be in range of 0-%i",numrange); SendClientMessageToAll(0xCCFF00,stri); SetTimer("draw",2000*60*lottogap,true); return 1; }
Код:
if(IsLottoStarted==true)return SendClientMessage(playerid, 0xFF4500AA, "Lottery has already been started"); IsLottoStarted=true; GetPlayerName(playerid,startername,sizeof(startername)); format(stri,sizeof(stri),"%s has started Lottery",startername); SendClientMessageToAll(0xCCFF00,stri); format(stri,sizeof(stri),"It will be drawed after %i minutes.",lottogap); SendClientMessageToAll(0xCCFF00,stri); format(stri,sizeof(stri),"Current lottery is of %i $",lottoadd); SendClientMessageToAll(0xCCFF00,stri); format(stri,sizeof(stri),"Do /ticket [your number] to take a ticket | The number should be in range of 0-%i",numrange); SendClientMessageToAll(0xCCFF00,stri); lotto_timer=SetTimer("draw",1000*60*lottogap,true);