Giveweapon command
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx, tmp[256];
    cmd = strtok(cmdtext, idx);
}
if(strcmp(cmd, "/giveweapon", true)==0)
{
      new otherplayerid, weaponid;
      tmp = strtok(cmdtext, idx);
      if(!strlen(tmp))
          {
              SendClientMessage(playerid, COLOR_ORANGE, "Use /giveweapon [playerid] [weaponid] [amount]!");
              return 1;
          }
        otherplayerid = strval(tmp);
        if(!IsPlayerConnected(otherplayerid))
          {
              SendClientMessage(playerid, COLOR_ORANGE, "The player took off without a piece!");
              return 1;
          }
          if(!strlen(tmp))
          {
              SendClientMessage(playerid, COLOR_ORANGE, "Use /giveweapon [playerid] [weaponid] [amount]!");
              return 1;
          }
         weaponid = strval(tmp);
         if(!strlen(tmp))
          {
              SendClientMessage(playerid, COLOR_ORANGE, "Use /giveweapon [playerid] [weaponid] [amount]!");
              return 1;
          }
          if(weaponid < 1 && weaponid > 46)
          {
              SendClientMessage(playerid, COLOR_ORANGE, "Use a weaponid between 1 and 46!");
              return 1;
          }
          if(!strlen(tmp))
          {
              SendClientMessage(playerid, COLOR_ORANGE, "Use /giveweapon [playerid] [weaponid] [amount]!");
              return 1;
          }
          if(strlen(tmp)< 1)
          {
              SendClientMessage(playerid, COLOR_ORANGE, "Please enter a valid amount of bullets!");
              return 1;
          }
          GivePlayerWeapon(otherplayerid, weaponid, amount);
          SendClientMessage(otherplayerid, COLOR_ORANGE, "You've been given a weapon!");
          SendClientMessage(playerid, COLOR_ORANGE, "You've successfully given a weapon to the player!");
          return 1;
      }
Reply


Messages In This Thread
Giveweapon command - by KvdV_96 - 11.06.2011, 10:36
Re: Giveweapon command - by KvdV_96 - 11.06.2011, 13:01
Re: Giveweapon command - by Skaizo - 11.06.2011, 13:05
Re: Giveweapon command - by KvdV_96 - 11.06.2011, 13:10
Re: Giveweapon command - by Skaizo - 11.06.2011, 13:17
Re: Giveweapon command - by KvdV_96 - 11.06.2011, 13:18
Re: Giveweapon command - by Skaizo - 11.06.2011, 13:21
Re: Giveweapon command - by KvdV_96 - 11.06.2011, 13:21
Re: Giveweapon command - by Skaizo - 11.06.2011, 13:27
Re: Giveweapon command - by KvdV_96 - 11.06.2011, 13:30

Forum Jump:


Users browsing this thread: 1 Guest(s)