function FUNC_TEST( ply, item_id, client )
if client then return "Eat" end // This is the name to show in the clientside menu
ply:RemoveFromInventory( item_id ) // Remove the item from the inventory when it's used
ply:AddHealth( 10 ) // Give the player some health or something
end
function FUNC_TESTPICKUP( ply, item_id )
ply:ChatPrint( "You just picked up my custom item! Item Name:" .. item.GetByID( item_id ).Name ) // use item.GetByID to get info for the item being picked up
return true
end
function FUNC_TESTDROP( ply, item_id, drop )
if drop then
ply:ChatPrint( "you are dropping this entity right now" ) // drop is only true when you are physically dropping the item - drop is false when selling or stashing an item
return true // this is generally called for overriding the drop code - return false to make the player not spawn the prop in front of them (in case you want to do something different )
end
ply:ChatPrint( "You just sold or stashed my custom item!" )
end
item.Register( {
Name = "My New Item",
Description = "My item is super special.",
Stackable = true, // can you stack them?
Type = ITEM_MISC, // can be found in loot and in stores... for loot only you'd use ITEM_LOOT and for stores only you'd use ITEM_BUYABLE
Weight = 0.30, // how heavy is it (lbs)?
Price = 15, // how much does it cost?
Rarity = 0.50, // how rare is it? 0.10 is common, 0.90 is very rare
Model = "models/some_model.mdl",
Functions = { FUNC_TEST }, // a table of functions it can perform when used from the inventory menu
PickupFunction = FUNC_TESTPICKUP, // a function called when you pick it up
DropFunction = FUNC_TESTDROP, // a function called when you drop it
CamPos = Vector(15,15,5), // modify these positions/origins if the model looks funny in the inventory panel
CamOrigin = Vector(0,0,5)
} )// convars (server only)
CreateConVar( "sv_radbox_max_zombies", "8", { FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls the amount of zombie NPCs that can spawn. (def 8)" )
CreateConVar( "sv_radbox_max_rogues", "6", { FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls the amount of rogue NPCs that can spawn. (def 6)" )
CreateConVar( "sv_radbox_max_artifacts", "3", { FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls the amount of artifacts that can spawn. (def 3)" )
CreateConVar( "sv_radbox_max_anomalies", "30", { FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls the amount of anomalies that can spawn. (def 30)" )
CreateConVar( "sv_radbox_team_dmg", "0", { FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls whether teammates can hurt eachother. (def 0)" )
CreateConVar( "sv_radbox_dmg_scale", "1", { FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls bullet damage scaling. (def 1.0)" )
CreateConVar( "sv_radbox_allow_build", "0", { FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls whether players can spawn props and use the physics gun. (def 0)" )
CreateConVar( "sv_radbox_max_props", "10", { FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Maximum number of props that players can spawn if building is allowed. (def 10)" )
CreateConVar( "sv_radbox_allow_loners", "0", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls whether players spawn initially as a loner. (def 0)" )
CreateConVar( "sv_radbox_custom_names", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls whether players can name themselves. (def 1)" )
CreateConVar( "sv_radbox_roleplay", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls whether the server uses RP chat commands. (def 1)" )
CreateConVar( "sv_radbox_daycycle", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls whether the server has day/night cycles enabled. (def 1)" )
CreateConVar( "sv_radbox_daycycle_speed", "2.0", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls the speed of the day/night cycle transitions. (def 2.0)" )
CreateConVar( "sv_radbox_daycycle_intensity", "1.0", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls the intensity of nighttime for day/night cycles. (def 1.0)" )
CreateConVar( "sv_radbox_daycycle_indoors_light", "0.4", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY, FCVAR_SERVER_CAN_EXECUTE }, "Controls how much day/night affects you while indoors. (def 0.4)" )
// convars (usable by anyone)
"cl_radbox_character_name" - Set your RP name (if the admin has allowed them).
"cl_radbox_auto_emote" - Enable or disable auto-chat emotes.
"cl_radbox_ragdoll_vision" - Enable or disable a custom death camera.
// concommands (admin only)
"sv_radbox_dev_mode" - Gives you item/prop spawn tools for map configuration.
"sv_radbox_reset_db" - Wipe the inventory database and start fresh.
"sv_radbox_save_map_config" - Output your custom map configuration to a text file in data folder (will overwrite anything that is there already so be careful).