givegun command help
#1

hi, i'm doing givegun command, but its not working idk why, anyone can fix it?
this command if i did /givegun [playerid] [bullets] it will give another player same weapon with bullets, and the player that gave the another player, will lose just bullets.

pawn Код:
CMD:givegun(playerid,params[])
{
  new id, wam;
  if(sscanf(params, "ui", id, wam))return SendClientMessage(playerid,-1,"usage: /givegun [playerid] [bullets]");
  if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid,-1,"invalid player id!");
  if(GetPlayerWeapon(playerid) == 0)return SendClientMessage(playerid, -1, "You have no weapon in your hand you could pass!");
  if(GetPlayerAmmo(playerid) < wam)return SendClientMessage(playerid,-1,"You do not have enough Munnition");
  GivePlayerWeapon(id, GetPlayerWeapon(playerid), wam);
  SetPlayerAmmo(playerid, GetPlayerAmmo(playerid) -wam); // this line
  new string[128], sendername[24], sendername1[24], weaponname[24];
  GetPlayerName(playerid, sendername, 24),GetPlayerName(id, sendername1, 24), GetWeaponName(GetPlayerWeapon(playerid), weaponname, 24);
  format(string, sizeof(string), "Player %s has given you the weapon %s with %i each shot!", sendername, weaponname, wam);
  SendClientMessage(id, -1, string);
  format(string, sizeof(string), "You have the players  %s %s handed over the weapon with each shot i%",sendername1, weaponname, wam);
  SendClientMessage(playerid,-1,string);
  return 1;
}



pawn Код:
warning 202: number of arguments does not match definition
Reply


Messages In This Thread
givegun command help - by Rabea - 12.11.2014, 08:47
Re: givegun command help - by Rabea - 12.11.2014, 09:17
Re: givegun command help - by Ahmad45123 - 12.11.2014, 09:18
Re: givegun command help - by Rabea - 12.11.2014, 09:24
Re: givegun command help - by Rabea - 12.11.2014, 09:26
Re: givegun command help - by Quickie - 12.11.2014, 09:36
Re: givegun command help - by Rabea - 12.11.2014, 09:47

Forum Jump:


Users browsing this thread: 3 Guest(s)