All pastes #957068 Raw Edit

Pawno lotto script

public text v1 · immutable
#957068 ·published 2008-03-25 19:23 UTC
rendered paste body
#include a_samp

public lottery(){
for(new i=0;i<MAX_PLAYERS;i++){
lotto = random(40);
lotto2 = random(40);
lotto3 = random(40);
format(string, sizeof(string),"Todays Lotto Numbers: %d %d %d!",lotto,lotto2,lotto3);
SendClientMessage(i,PURPLE,string);
SendClientMessage(i,COLOR_GREEN,"Want to Gamble on the Lottery? Pick a Number! Usage: /lotto and /lottohelp!");
donelotto[i] =0;
if (wonlotto[i] ==1){
wonlotto[i] =0;
GetPlayerName(i, playername, MAX_PLAYER_NAME);
format(string, sizeof(string),"Server Message: %s Has Won the Lottery!",playername);
SendClientMessageToAll(COLOR_ORANGE,string);
GivePlayerMoney(i,75000);
}}
return 1;
}
dcmd_lotto(playerid, params[])
{
new number = strval(params);
if (isadmin[playerid] ==1){
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_WHITE, "Usage: /lotto [number]");
return 1;
}
if(number > 40){
SendClientMessage(playerid,RED,"You cant Pick a Number higher than 40!");
return 1;
}

if(donelotto[playerid] ==1){
SendClientMessage(playerid,RED,"You have already put the Lotto On!");
return 1;
}
if(number == lotto || number == lotto2 || number == lotto3){
wonlotto[playerid] =1;
format(string, sizeof(string),"You have Sucessfully Put the number %d on.",number);
SendClientMessage(playerid,GREEN,string);
donelotto[playerid] =1;
} else {
format(string, sizeof(string),"You have Sucessfully Put the number %d on.",number);
SendClientMessage(playerid,GREEN,string);
donelotto[playerid] =1;
}}
return 1;
}