[Ajuda] [GM]Ajuda Dialog
#2

pawn Код:
if(strcmp(cmdtext, "/saldo", true) == 0)
{
    format(file, sizeof(file), P_CONTAS, PlayerName(playerid));
    if(PlayerToPoint(1.0, playerid, -89.8649,1228.0507,19.7422) || PlayerToPoint(1.0, playerid, 408.0478,-1541.4128,32.2734) || PlayerToPoint(1.0, playerid, 2464.0342,2242.6365,10.8203) || PlayerToPoint(1.0, playerid, 1722.3969,-1718.2037,13.5305) || PlayerToPoint(1.0, playerid, 2140.6582,-1168.6848,23.9922)
    || PlayerToPoint(1.0, playerid, 2701.7878,-1279.4895,58.9453) || PlayerToPoint(1.0, playerid, 2594.4158,2790.6204,10.8203) || PlayerToPoint(1.0, playerid, -1493.9268,920.3087,7.1875) || PlayerToPoint(1.0, playerid, 2302.7449,-16.0738,26.4844) || PlayerToPoint(1.0, playerid, 1815.4055,-1298.0497,125.7266) || PlayerToPoint(1.0, playerid, 1095.9421,-1428.6598,22.7714)) {
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
        if(dini_Int(file, "ContaBancaria") == 1) {
            format(string, sizeof(string), "| INFO | Seu saldo atual й 'R$%d'.", dini_Int(file, "SaldoBancario"));
            SendClientMessage(playerid, 0xFFFF91AA, string);
        }
        else {
            SendClientMessage(playerid, Vermelho,"| ERRO | Vocк nгo tem uma conta bancбria.");
        }
    }
    else {
        SendClientMessage(playerid, Vermelho,"| ERRO | Vocк nгo estб em um banco.");
    }
    return 1;
}


if(strcmp(cmd, "/depositar", true) == 0)
{
    format(file, sizeof(file), P_CONTAS, PlayerName(playerid));
    if(PlayerToPoint(1.0, playerid, -89.8649,1228.0507,19.7422) || PlayerToPoint(1.0, playerid, 408.0478,-1541.4128,32.2734) || PlayerToPoint(1.0, playerid, 2464.0342,2242.6365,10.8203) || PlayerToPoint(1.0, playerid, 1722.3969,-1718.2037,13.5305) || PlayerToPoint(1.0, playerid, 2140.6582,-1168.6848,23.9922)
    || PlayerToPoint(1.0, playerid, 2701.7878,-1279.4895,58.9453) || PlayerToPoint(1.0, playerid, 2594.4158,2790.6204,10.8203) || PlayerToPoint(1.0, playerid, -1493.9268,920.3087,7.1875) || PlayerToPoint(1.0, playerid, 2302.7449,-16.0738,26.4844) || PlayerToPoint(1.0, playerid, 1815.4055,-1298.0497,125.7266) || PlayerToPoint(1.0, playerid, 1095.9421,-1428.6598,22.7714)) {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "Use /depositar [quantia].");
        new valor;
        if(strfind(tmp, "-", true) != -1) {
            SendClientMessage(playerid,Vermelho,"| ERRO | Quantia invбlida!");
            return 1;
        }
        if(strlen(tmp) > 8) {
            SendClientMessage(playerid, Vermelho, "| ERRO | Quantia invбlida!");
            return 1;
        }
        valor = strval(tmp);
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
        if(dini_Int(file, "ContaBancaria") == 1) {
            new grana;
            grana = GetPlayerGrana(playerid);
            if(grana > valor-1 && valor > 0) {
                format(string, sizeof(string), "| INFO | Vocк depositou a quantia de 'R$%d'.", valor);
                SendClientMessage(playerid, 0xFFFF91AA, string);
                dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+valor);
                GivePlayerGrana(playerid, -valor);
                return 1;
            }
            else {
                SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo tem essa quantia.");
            }
        }
        else {
            SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo tem uma conta bancбria.");
        }
    }
    else {
        SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo estб em um banco.");
    }
    return 1;
}


if(strcmp(cmd, "/sacar", true) == 0)
{
    format(file, sizeof(file), P_CONTAS, PlayerName(playerid));
    if(PlayerToPoint(1.0, playerid, -89.8649,1228.0507,19.7422) || PlayerToPoint(1.0, playerid, 408.0478,-1541.4128,32.2734) || PlayerToPoint(1.0, playerid, 2464.0342,2242.6365,10.8203) || PlayerToPoint(1.0, playerid, 1722.3969,-1718.2037,13.5305) || PlayerToPoint(1.0, playerid, 2140.6582,-1168.6848,23.9922)
    || PlayerToPoint(1.0, playerid, 2701.7878,-1279.4895,58.9453) || PlayerToPoint(1.0, playerid, 2594.4158,2790.6204,10.8203) || PlayerToPoint(1.0, playerid, -1493.9268,920.3087,7.1875) || PlayerToPoint(1.0, playerid, 2302.7449,-16.0738,26.4844) || PlayerToPoint(1.0, playerid, 1815.4055,-1298.0497,125.7266) || PlayerToPoint(1.0, playerid, 1095.9421,-1428.6598,22.7714)) {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "Use /sacar [quantia].");
        new valor;
        if(strfind(tmp, "-", true) != -1) {
            SendClientMessage(playerid,Vermelho,"| ERRO | Quantia invбlida!");
            return 1;
        }
        if(strlen(tmp) > 8) {
            SendClientMessage(playerid, Vermelho, "| ERRO | Quantia invбlida!");
            return 1;
        }
        valor = strval(tmp);
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
        if(dini_Int(file, "ContaBancaria") == 1) {
            if(dini_Int(file, "SaldoBancario") > valor-1) {
                format(string, sizeof(string), "| INFO | Vocк sacou a quantia de 'R$%d'.", valor);
                SendClientMessage(playerid, 0xFFFF91AA, string);
                dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")-valor);
                GivePlayerGrana(playerid, valor);
                return 1;
            }
            else {
                SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo tem essa quantia no banco.");
            }
        }
        else {
            SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo tem uma conta bancбria.");
        }
    }
    else {
        SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo estб em um banco.");
    }
    return 1;
}
Reply


Messages In This Thread
[GM]Ajuda Dialog - by Skash - 22.07.2013, 17:05
Re: [GM]Ajuda Dialog - by Standby - 22.07.2013, 17:12
Re: [GM]Ajuda Dialog - by Skash - 22.07.2013, 17:19
Re: [GM]Ajuda Dialog - by Standby - 22.07.2013, 17:31
Re: [GM]Ajuda Dialog - by Skash - 22.07.2013, 17:45
Re: [GM]Ajuda Dialog - by Standby - 22.07.2013, 17:46
Re: [GM]Ajuda Dialog - by Skash - 22.07.2013, 18:02
Re: [GM]Ajuda Dialog - by Standby - 22.07.2013, 18:10
Re: [GM]Ajuda Dialog - by Skash - 27.07.2013, 21:05

Forum Jump:


Users browsing this thread: 1 Guest(s)