10.01.2012, 20:25
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;
}