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

my single ak47 code i made for cider.

#10025575
11-07-2009, 04:23 PM
shaneman
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
#10025580
11-07-2009, 04:35 PM
Lexi
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.

#10025681
11-07-2009, 09:52 PM
MartinP
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
__________________
The
Ruxandra
Fuckers
#10026286
13-07-2009, 09:26 PM
Drunk
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
__________________
#10026292
13-07-2009, 09:38 PM
Matais
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: 10 (4 members and 6 guests)
hawkmoon008899, Paul, Thekk2009, Window