15.12.2014, 19:23
here you go
you need
you need
pawn Код:
#include <sscanf2>
#include <zcmd>
pawn Код:
CMD:giveweapon(playerid, params[])
{
new tmp[256];
new lookupid, weapon, wname[64], ammo;
if(IsPlayerAdmin(playerid))
{
if (sscanf(params, "uii",lookupid, weapon, ammo))
return SendClientMessage(playerid, COLOR_YELLOW, "/givewepon <playerid> <gunid> <ammo>");
if (!IsPlayerConnected(lookupid)) { return SendClientMessage(playerid, COLOR_YELLOW, "Player is not connected."); }
if (weapon < 1 || weapon > 46)
return SendClientMessage(playerid, COLOR_YELLOW, "Invalid weapon ID, valid id's are between 0 and 46");
GivePlayerWeapon(lookupid, weapon, ammo);
GetWeaponName(weapon, wname, 64);
format(tmp, sizeof(tmp), "Admin %s (ID:%d) gave %s (ID:%d) a %s with %d ammo", GetName(playerid), playerid, GetName(lookupid), lookupid, wname, ammo);
SendClientMessageToAll(COLOR_YELLOW, tmp);
format(tmp, sizeof(tmp), "Admin %s (ID:%d) gave you a %s with %d ammo", GetName(playerid), playerid, wname, ammo);
SendClientMessage(lookupid, COLOR_YELLOW, tmp);
}
return 1;
}