Maybe you have 1 command???
#5

This is a really crappy command that I threw together in a minute. You'll probably want to change it up a little and add some checks!

pawn Код:
CMD:sellweapon(playerid, params[])
{
    new iTar, iWeap, iPrice;
    if(sscanf(params, "rii", iTar, iWeap, iPrice))
        return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /sellweapon [nick/id] [weapon ID] [price]");
    if(iTar == INVALID_PLAYER_ID)
        return SendClientMessage(playerid, COlOR_RED, "ERROR: You entered an invalid nickname/ID.");

    GivePlayerMoney(playerid, iPrice);
    GivePlayerMoney(iTar, -iPrice);
    GivePlayerWeapon(iTar, iWeap);
    return 1;
}
Reply


Messages In This Thread
Maybe you have 1 command??? - by Mecool - 10.01.2012, 14:17
Re: Maybe you have 1 command??? - by Mecool - 10.01.2012, 18:48
Re: Maybe you have 1 command??? - by Mean - 10.01.2012, 19:15
Re: Maybe you have 1 command??? - by Mecool - 10.01.2012, 19:55
Re: Maybe you have 1 command??? - by Scenario - 10.01.2012, 20:25
Re: Maybe you have 1 command??? - by Mecool - 10.01.2012, 20:57
Re: Maybe you have 1 command??? - by Scenario - 10.01.2012, 21:08
Re: Maybe you have 1 command??? - by Mecool - 10.01.2012, 21:11
Re: Maybe you have 1 command??? - by BleverCastard - 10.01.2012, 21:21
Re: Maybe you have 1 command??? - by Mecool - 11.01.2012, 12:50

Forum Jump:


Users browsing this thread: 3 Guest(s)