21.04.2012, 12:33
pawn Код:
CMD:giveweapon(playerid, params[])
{
new id, weapon, ammo;
if (sscanf(params, "usd", id, weapon, ammo)) SendClientMessage(playerid, 0xFF0000AA, "DEBUG: \"/giveweapon <playerid> <weaponid> <ammo>\"");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "DEBUG: \"/giveweapon <playerid> <weaponid> <ammo>\"");
new checkweapon = CompareWeaponName(weapon);
if(!checkweapon) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Not a valid Weapon Name");
if(IsPlayerConnected(id))
{
if(checkweapon==2||checkweapon==4||checkweapon==5||checkweapon==6||checkweapon==14||checkweapon==41||checkweapon==43)
{
GivePlayerWeapon(id, weapon, 1);
return true;
}
else GivePlayerWeapon(id, weapon, ammo);
}
return true;
}