[Pedido] /spin
#6

pawn Код:
new bool:podeusarcomando[MAX_PLAYERS];
forward Japodeusar(playerid)


if(strcmp(cmd, "/spin", true) == 0)
    {
        new string[256];
        new tmp[256];
        new guito,playerguito;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, 0xFF0000FF, "USE: /spin [dinheiro]");
            return 1;
        }
        guito = strval(tmp);
        if(guito < 1 || guito > 50000)
        {
            SendClientMessage(playerid, 0xffffffff, "[SPIN:] Quantia invбlida, tem que ser mais de 0 e menos de 50000");
            return 1;
        }
        playerguito = GetPlayerMoney(playerid);
        if (guito > 0 && playerguito >= guito)
        {
            new succeed = 1 + random(3);
            if(succeed == 1)
            {
                format(string, sizeof(string), "[SPIN:]{ffffff} %s tentou jogar no spin e ganhou {66ff00}%d", pname, guito);
                SendClientMessageToAll(0x66ff00FF, string);
                GivePlayerMoney(playerid, guito);
            }
            else if(succeed >= 2)
            {
                format(string, sizeof(string), "[SPIN:]{ffffff} %s tentou jogar no spin e perdeu {A81C1C}%d", pname, guito);
                SendClientMessageToAll(0x66ff00FF, string);
                GivePlayerMoney(playerid, -guito);
            }
        }
        else
        {
            SendClientMessage(playerid, 0xffffffff, "[SPIN:] Nгo tens esse dinheiro todo");
        }
        podeusarcomando[playerid] = false;
      SendClientMessage(playerid, 0xffffffff, "[ ERRO ] Espere 30 segundos para usar o comando");
        SetTimerEx("Japodeusar", 30000, false, "d", playerid);
        return 1;
    }


public Japodeusar(playerid)
{
    podeusarcomando[playerid] = true;
    return 1;
}
Reply


Messages In This Thread
/spin - by iTzDemon - 13.07.2013, 13:24
Re: /spin - by Cidiei - 13.07.2013, 15:42
Re: /spin - by iTzDemon - 13.07.2013, 15:54
Re: /spin - by darkxdll - 13.07.2013, 15:56
Re: /spin - by iTzDemon - 13.07.2013, 15:59
Re: /spin - by Standby - 13.07.2013, 16:05
Re: /spin - by iTzDemon - 13.07.2013, 16:07
Re: /spin - by Standby - 13.07.2013, 16:12
Re: /spin - by iTzDemon - 13.07.2013, 16:18

Forum Jump:


Users browsing this thread: 1 Guest(s)