Forum archive — a preserved copy of the VentMob forums (2008–2011), rebuilt from Wayback Machine captures. Skin: 2009 | 2011 · Back to the memorial

Thread: my single ak47 code i made for cider.

  1. #10025575
    Newcomer
    Join Date
    June 19, 2009
    Posts
    6

    my single ak47 code i made for cider.

    Hey i made a code you you can buy ak47s single instead of haveing to buy them in packs of
    10.  


    --[[
    Name: "sh_cider_ak47single.lua".
    Product: "Cider (Roleplay)".
    --]]

    if ( !cider.plugin.get("Generic") ) then return; end;

    -- Define the item table.
    local ITEM = {};

    -- Set some information about the item.
    ITEM.name = "1 AK47";
    ITEM.size = 2;
    ITEM.cost = 3500;
    ITEM.team = TEAM_ARMSDEALER;
    ITEM.model = "models/weapons/w_rif_ak47.mdl";
    ITEM.batch = 1;
    ITEM.store = true;
    ITEM.weapon = true;
    ITEM.plural = "AK47s";
    ITEM.uniqueID = "cider_ak47";
    ITEM.description = "A very powerful rifle which is great at long range.";

    -- Called when a player uses the item.
    function ITEM:onUse(player)
       if ( !player:HasWeapon(self.uniqueID) ) then
          player:Give(self.uniqueID);
          player:SelectWeapon(self.uniqueID);
          
          -- Return here because we're going to use the item.
          return;
       end;
       
       -- Select the weapon.
       player:SelectWeapon(self.uniqueID);
       
       -- Return false because we already have this item out.
       return false;
    end;

    -- Called when a player drops the item.
    function ITEM:onDrop(player, position) end;

    -- Called when a player destroys the item.
    function ITEM:onDestroy(player) end;

    -- Register the item.
    cider.item.register(ITEM);

    If you would like tyo test or have it go ahead im allways here to help Ventmob community, or if you reply with what type of item you would like i will be more than happy to help i cant code plugins for cider tho kk thanks

    - shaneman
    Last Edit: July 11, 2009, 04:25:45 PM by shaneman

  2. #10025580
    Applejack Lead Developer
    Join Date
    Dec 2008
    Posts
    1,491

    Re: my single ak47 code i made for cider.

    1) That's ********
    2) Applejack's item system doesn't work like that.
    I code your babies.


  3. #10025681
    Highly Respected Member
    Join Date
    March 22, 2009
    Posts
    191

    Re: my single ak47 code i made for cider.

    3) The AK works perfectly
    4) If its possible to buy 1 at a time, then more people goes weapon dealer to buy weapons for them self

  4. #10026286
    Highly Respected Member
    Join Date
    Mar 2009
    Posts
    130

    Re: my single ak47 code i made for cider.

    5) that would promote the RDM because all the noobs would have an ak

  5. #10026292
    Banned
    Join Date
    Mar 2009
    Posts
    438

    Re: my single ak47 code i made for cider.

    thanks dude, lexi only knows how to code weapons that come in batches of 10, good job you came around though.

Users Browsing this Thread: 6 (2 members and 4 guests)

Gaarnek, MartinP