04.04.2016, 08:41
PHP код:
dcmd_lotto(playerid,params[])
{
new ticket, string[128];
if(LottoRunning == 0) return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}There isn't a lotto running!");
if(sscanf(params,"d",ticket)) return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}/lotto [1-10]");
{
if(ticket < 1 || ticket > 10) return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}Lotto ticket must be within 1 and 10.");
if(lottowinner[playerid] == 1) return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}You already have a lotto ticket!");
if(IsNumTaken(ticket))return SendClientMessage(playerid,LIGHTBLUE,"[NGP]: {FFFF80}This number is already taken by someone!");
format(string,sizeof(string),"[NGP]: {FFFF80}You have bought ticket number %i. Good luck!",ticket);
SendClientMessage(playerid,LIGHTBLUE,string);
lottowinner[playerid] = 1;
ticketnum[playerid]=ticket;
}
return 1;
}