Quote:
Originally Posted by Amit_B
When the lotto ends, use
pawn Code:
for(new i = 0; i < MAX_PLAYERS; i++) PlayerInfo[i][pLotto] = 0;
also when player connecting to the server
pawn Code:
PlayerInfo[playerid][pLotto] = 0;
and on the command, above the strtok, add
pawn Code:
if(PlayerInfo[playerid][pLotto] != 0) return SendClientMessage(playerid,0xff0000ff,"You have already bought a ticket.");
What i've done here, is that the pLotto variable will be equal to 0 when the player didn't choosen any number.
If the PlayerInfo[playerid][pLotto] is not equal to 0, it means that he bought a ticket.
|
And on OnPlayerDisconnect
You might want to add:
pawn Code:
PlayerInfo[playerid][pLotto] = 0;