[Pedido] Comando de transferкncia de Grana
#3

Quote:
Originally Posted by Panico622
View Post
pawn Code:
CMD:transferencia(playerid, params[])
{
    new id;
    new grana;
    if(GetPlayerMoney(playerid) >= grana)
    {
        GivePlayerMoney(playerid, -grana);
        GivePlayerMoney(id, grana);
    }
    SendClientMessage(playerid, -1, "Voce nao tem essa Grana");
    return 1;
}
Ham?


@Netinho_the_killer

Usar o search as vezes й bom amigo.

--

pawn Code:
if(strcmp(cmd, "/givecash", true) == 0) {
        new tmp[256];
        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp)) {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givecash [playerid] [amount]");
            return 1;
        }
        giveplayerid = strval(tmp);

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givecash [playerid] [amount]");
            return 1;
        }
        moneys = strval(tmp);

        //printf("givecash_command: %d %d",giveplayerid,moneys);


        if (IsPlayerConnected(giveplayerid)) {
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            playermoney = GetPlayerMoney(playerid);
            if (moneys > 0 && playermoney >= moneys) {
                GivePlayerMoney(playerid, (0 - moneys));
                GivePlayerMoney(giveplayerid, moneys);
                format(string, sizeof(string), "You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
                SendClientMessage(playerid, COLOR_YELLOW, string);
                format(string, sizeof(string), "You have recieved $%d from %s(player: %d).", moneys, sendername, playerid);
                SendClientMessage(giveplayerid, COLOR_YELLOW, string);
                printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
            }
            else {
                SendClientMessage(playerid, COLOR_YELLOW, "Invalid transaction amount.");
            }
        }
        else {
                format(string, sizeof(string), "%d is not an active player.", giveplayerid);
                SendClientMessage(playerid, COLOR_YELLOW, string);
            }
        return 1;
    }
Reply


Messages In This Thread
Comando de transferкncia de Grana - by Netinho_the_killer - 12.08.2012, 13:07
Re: Comando de transferкncia de Grana - by Panico622 - 12.08.2012, 13:34
Re: Comando de transferкncia de Grana - by Kuddy - 12.08.2012, 14:35
Re: Comando de transferкncia de Grana - by .ThePro - 12.08.2012, 14:54
Re: Comando de transferкncia de Grana - by Netinho_the_killer - 12.08.2012, 17:04
Re: Comando de transferкncia de Grana - by Lуs - 12.08.2012, 17:28
Re: Comando de transferкncia de Grana - by R3S1D3NT1 - 12.08.2012, 21:50
Respuesta: Comando de transferкncia de Grana - by AnonymouSs - 12.08.2012, 21:58
Re: Respuesta: Comando de transferкncia de Grana - by @Riichard - 12.08.2012, 22:10
Re: Respuesta: Comando de transferкncia de Grana - by Lуs - 12.08.2012, 23:23

Forum Jump:


Users browsing this thread: 1 Guest(s)