06.01.2011, 18:53
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(gun, 3, cmdtext);
return 1;
}
dcmd_gun(playerid, params[])
{
new gunid, str[128];
if(sscanf(params, "d", gunid)) return SendClientMessage(playerid, Yellow, "USAGE: /gun <id> (24-34)");
if(gunid < 24 || gunid > 34) return SendClientMessage(playerid, Yellow, "ERROR! Wrong gun ID! (24-34)");
format(str, 128, "You bought an gun! (ID: %d)", gunid);
SendClientMessage(playerid, Green, str);
GivePlayerWeapon(playerid, gunid, 1500);
return 1;
}