07.06.2012, 12:19
I got a lotto script from my friend. Now I getting problem in forward.
I got this error :[error 012: invalid function call, not a valid address] on that line [format(str, sizeof(str), "{FF3399}The lotto ticket winner today was %s. They won a total of $%d! [Ticket number: %d]", RemoveUnderScore(winner), Jackpot, Lnum);]
Can some one help me.
+ rep
pawn Код:
forward Draw(RemoveUnderScore);
public Draw(RemoveUnderScore)
{
new Lnum = random(100) + 1;
new winner = -1;
for(new i; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(GetPVarInt(i, "LottoNumber") == Lnum) winner = i;
SetPVarInt(i, "LottoNumber", 0);
}
if(winner != -1)
{
new str[100];
format(str, sizeof(str), "{FF3399}The lotto ticket winner today was %s. They won a total of $%d! [Ticket number: %d]", RemoveUnderScore(winner), Jackpot, Lnum);
SendClientMessageToAll(0x62FF32FF, str);
Player[winner][Money] += Jackpot;
Jackpot = LOTTO_START;
}
if(winner == -1) //No winner
{
new str[100];
format(str, sizeof(str), "{FF3399}There was no winner for this draw. The jackpot will go up to $%d! [Ticket number: %d]", Jackpot, Lnum);
SendClientMessageToAll(0x62FF32FF, str);
}
for(new s; s<100; s++)
{
Numbers[s] = 0;
}
return 1;
}
Can some one help me.
+ rep