11 Results
because it was not stored to the meta table You had this: local temp_inv = {} This would be read by the server as "Make a new variable called temp_inv, create it in the scope of the script. My scope of the script is the main serverside [I](since this is included in init.l...
SeveredSkull Developing Reply
[QUOTE=brandonj4;36622059] The code you posted is the exact same as my old one just the table name was changed to temp_inv.[/QUOTE] No... If you look carefully... I changed it: self.inventory[MyGun] = self:GetACtiveWeapon():GetModel() I omitted the use of a "temp_in...
SeveredSkull Developing Reply
Ah. Derp! Ok, here: [lua] function Player:SaveCurrentWeapon() local temp_guns = { ["weapon_physgun"] = "models/weapons/v_superphyscannon.mdl", ["weapon_357"] = "models/weapons/v_superphyscannons.mdl" } ...
SeveredSkull Developing Reply
Heh. Disagree with me eh? Put it here: [lua] function Player:SaveCurrentWeapon() local temp_inv = {} local temp_guns = { ["weapon_physgun"] = "models/weapons/v_superphyscannon.mdl", ["weapon_357"] = "models/weapons/v_supe...
SeveredSkull Developing Reply
Ah I got it: local temp_inv = {} That's a global variable. You defined it in the beginning of the script, and you are assigning stuff to it. However, you never clear it when you call Player:SaveCurrentWeapon(). Thus you are getting all the items from the previous saves, and ...
SeveredSkull Developing Reply
Not a clue. Theoretically, you did everything correctly (Now that I know you just have numerical indexes... :dance:)
SeveredSkull Developing Reply
[QUOTE=brandonj4;36621586]I was never actually storing the models in the table: [lua] if (self:GetActiveWeapon():GetClass() == k) then temp_inv[#temp_inv + 1] = k end [/lua] :)[/QUOTE] Oh I missed that portion. Before you said you needed models for that Derma menu ...
SeveredSkull Developing Reply
[lua] local arg1 = tostring(args[1]) for k, v in pairs(self.inventory) do print(k,v) -- According to your player table and how you have everything set up so far: -- This is K = This is V -- ["weapon_357"] =...
SeveredSkull Developing Reply
3: From the looks of it... I thought you were doing the opposite. Using the Model name as the argument. If you were using the actual class name... no wonder it didn't work :P [editline]4th July 2012[/editline] Ah. Damn you broke my auto merge.... Take a look: [lua] fu...
SeveredSkull Developing Reply
Now you have me doubting myself... You may be right. I am not sure. To avoid the whole issue, you can actually just remove that line altogether. It is handled by the LoadInventory function anyway...
SeveredSkull Developing Reply
Now that I have had some sleep... :v: [lua] local meta = FindMetaTable("Player") if !meta then return end self.inventory = {} function meta:SaveCurrentWeapon() -- Holds the guns that you are not allowed to save local restricted_guns = { ...
SeveredSkull Developing Reply