weapon exception
#1

dcmd_getgun(playerid, params[])
{
new Weapon, Ammo;
if(sscanf(params, "dd", Weapon, Ammo)) return SendClientMessage(playerid, COLOR_GREEN, "Usage: /getgun (weapon id) (bullets)");
if(!IsValidWeapon(Weapon)) return SendClientMessage(playerid, COLOR_RED, "Invalid Weapon ID.");

GivePlayerWeapon(playerid, Weapon, Ammo);
return 1;
}


How do I remove /getgun 38 and 37?
Reply
#2

pawn Код:
dcmd_getgun(playerid, params[])
{
  new Weapon, Ammo;
  if(sscanf(params, "dd", Weapon, Ammo)) return SendClientMessage(playerid, COLOR_GREEN, "Usage: /getgun (weapon id) (bullets)");
  if(Weapon == 38 || Weapon == 37) return SendClientMessage(playerid, COLOR_RED, "You are not allowed a minigun or rocket launcher >=]");
  if(!IsValidWeapon(Weapon)) return SendClientMessage(playerid, COLOR_RED, "Invalid Weapon ID.");

  GivePlayerWeapon(playerid, Weapon, Ammo);
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)