03-14-2012, 08:44 AM
(This post was last modified: 03-14-2012, 11:01 AM by distroyed123.)
in the part where you type in /i or /item number or a name is messing up, i might have messed something up but i cant find it and it helps when some one else looks it over Thanks in advance!!!
20:53:59] Entity #35 (cPlayer) at [19 0 13] spawning for player "justin"
[20:53:59] Spawning player "justin" at {309.59, 60.00, 218.83}
[20:54:08] 1. Stack size: 0
[20:54:08] 2. Stack size: 1
[20:54:08] 3. Stack size: 2
[20:54:08] Calling bound function!
[20:54:08] -- Plugins/Core.lua:359: attempt to call global 'isValidItem' (a nil value)
[20:54:08] error. Stack size: 0
[20:54:21] 1. Stack size: 0
[20:54:21] 2. Stack size: 1
[20:54:21] 3. Stack size: 2
[20:54:21] Calling bound function!
[20:54:21] -- Plugins/Core.lua:348: attempt to call global 'isValidItem' (a nil value)
[20:54:21] error. Stack size: 0
[20:54:24] Received d/c packet from "justin"
[20:54:24] Deleting client "justin"
[20:54:24] ClientHandle at 0468B008 destroyed
[20:54:24] Destroying entity #35
[20:54:24] DESTROY WINDOW
[20:54:24] DESTROY WINDOW
[20:54:24] Deleting entity 35 at pos {309.59, 218.83} ~ [19, 13]; ptr 04231D08
Quote:function HandleItemCommand( Split, Player )BELOW IS THE ERROR!
if( #Split ~= 2 and #Split ~=3 ) then
Player:SendMessage( cChatColor.Green .. "Usage: /item [ItemID/Name] <Amount>" )
return true
end
foundItem = false
ItemID = tonumber( Split[2] )
if( ItemID == nil or not isValidItem( ItemID ) ) then
-- nothing
else
foundItem = true
end
if not foundItem then
if ( HAVE_ITEM_NAMES == true ) then
itemValue = itemsINI:GetValue('Items', ''..Split[2]..'', 0)
if itemValue ~= 0 then
ItemID = itemValue
if( ItemID == nil or not isValidItem( tonumber(itemValue) ) ) then
-- nothing
else
foundItem = true
end
end
end
end
if not foundItem then
Player:SendMessage( cChatColor.Green .. "Invalid Item ID / Name !" )
return true
end
local Amount = 1
if( #Split == 3 ) then
Amount = tonumber( Split[3] )
if( Amount == nil or Amount < 1 or Amount > 512 ) then
Player:SendMessage( cChatColor.Green .. "Invalid Amount !" )
return true
end
end
local NewItem = cItem( ItemID, Amount )
if( Player:GetInventory():AddItem( NewItem ) == true ) then
Player:SendMessage( cChatColor.Green .. "There you go !" )
LOG("Gave " .. Player:GetName() .. " " .. Amount .. " times " .. ItemID )
else
Player:SendMessage( cChatColor.Green .. "Not enough space in inventory !" )
end
return true
end
20:53:59] Entity #35 (cPlayer) at [19 0 13] spawning for player "justin"
[20:53:59] Spawning player "justin" at {309.59, 60.00, 218.83}
[20:54:08] 1. Stack size: 0
[20:54:08] 2. Stack size: 1
[20:54:08] 3. Stack size: 2
[20:54:08] Calling bound function!
[20:54:08] -- Plugins/Core.lua:359: attempt to call global 'isValidItem' (a nil value)
[20:54:08] error. Stack size: 0
[20:54:21] 1. Stack size: 0
[20:54:21] 2. Stack size: 1
[20:54:21] 3. Stack size: 2
[20:54:21] Calling bound function!
[20:54:21] -- Plugins/Core.lua:348: attempt to call global 'isValidItem' (a nil value)
[20:54:21] error. Stack size: 0
[20:54:24] Received d/c packet from "justin"
[20:54:24] Deleting client "justin"
[20:54:24] ClientHandle at 0468B008 destroyed
[20:54:24] Destroying entity #35
[20:54:24] DESTROY WINDOW
[20:54:24] DESTROY WINDOW
[20:54:24] Deleting entity 35 at pos {309.59, 218.83} ~ [19, 13]; ptr 04231D08