Player to Player /sendcash command??
#2

On top:
pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Then add this


pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(givecash, 8, cmdtext);
    return 0;
}

dcmd_givecash(playerid, params[])
{
    new id, amount;
    if(sscanf(params, "ui", id, amount)) SendClientMessage(playerid, 0xFF0000AA, "Use /givecash [id] [amount]");
    else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player is not active");
    else if(id == playerid) SendClientMessage(playerid, 0xFF0000AA, "You cannot send yourself cash");
    else if(amount > GetPlayerMoney(playerid)) SendClientMessage(playerid, 0xFF0000AA, "You cannot send more than you have");
    else
    {
        GivePlayerMoney(id, amount);
        GivePlayerMoney(playerid, -amount);
    }
    return 1;
}
Reply


Messages In This Thread
Player to Player /sendcash command?? - by sheepondrugs - 17.08.2010, 16:38
Re: Player to Player /sendcash command?? - by Claude - 17.08.2010, 16:51
Re: Player to Player /sendcash command?? - by sheepondrugs - 17.08.2010, 17:01
Re: Player to Player /sendcash command?? - by ikey07 - 17.08.2010, 17:14
Re: Player to Player /sendcash command?? - by Claude - 17.08.2010, 17:19

Forum Jump:


Users browsing this thread: 1 Guest(s)