07.02.2013, 00:08
Try this:
pawn Код:
CMD:giveweapon(playerid, params[])
{
new weap,targetid, string[128];
if(sscanf(params,"ui", targetid, weap)) return SendClientMessage(playerid, NO_PARAMS, "USAGE: /giveweapon [ID or Name] [Weapon]");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, ERROR, "Error: Player is not connected or is yourself");
if(weap < 1 || weap > 46) return SendClientMessage, ERROR, "Error: You have entered an invalid weapon ID.");
GivePlayerWeapon(targetid, weap, 99999);
format(string, sizeof(string), "You have given a weapon to %s", Name(targetid));
SendClientMessage(playerid, SUCCESS, string);
format(string, sizeof(string), "You have received a weapon from %s", Name(playerid));
SendClientMessage(targetid, SUCCESS, string);
return 1;
}