my system only for id 0?
#1

Only id 0 can gamble, when a higher ID try's to gamble it will say: you can only gamble once in the 30 seconds. :S

pawn Код:
dcmd_gamble(playerid, params[])
{
    #pragma unused params
    new string[128];
    if((allowgamble[playerid] == 1) && UserUD[playerid][cookies] > 50)
    {
    switch(random(9))
    {
    case 0:format(string, sizeof(string), "[GAMBLE] %s(id: %d) has gambled 5 cookies. Reward: $2000", UserUD[playerid][accname],playerid);
    }
  SendClientMessageToAll(rankupdate, string);
  allowgamble[playerid] = 0;
  SetTimerEx("gambleon", 30000, false, "i", playerid);
    }
    else if(allowgamble[playerid] == 0)
    {
    SendClientMessage(playerid,red,"Error: You can only gamble once in the 30 seconds!");
    }
    else
    {
    SendClientMessage(playerid,red,"Error: You need to have atleast 50 cookies to gamble!");
    }
    return 1;
}


public gambleon(playerid)
{
  allowgamble[playerid] = 1;
    return 1;
}
Reply


Messages In This Thread
my system only for id 0? - by iStarzz - 13.06.2010, 10:00
Re: my system only for id 0? - by Dark_Kostas - 13.06.2010, 10:10
Re: my system only for id 0? - by TheInnocentOne - 13.06.2010, 10:21
Re: my system only for id 0? - by iStarzz - 13.06.2010, 11:04
Re: my system only for id 0? - by MadeMan - 13.06.2010, 12:22
Re: my system only for id 0? - by iStarzz - 13.06.2010, 12:54

Forum Jump:


Users browsing this thread: 1 Guest(s)