Loader

Underdone Snippets/Coding/Discussion Thread

Started by Silver Knight, 03-06-2010

0 Members and 1 Guest are viewing this topic.

03-06-2010 Last Edit: 03-06-2010 by Last.Exile
This thread is dedicated to the gamemode "Underdone" You can discuss and talk about various things here, ill also post code snippets for certain features/fixes/bugs that i have done.

Item Creation Snippet (Allows you to create a item which appears infront of you)

For all you new coders, just copy and paste this code and put it at the bottom of "admin_commands" and while ingame (and have admin) simply type as stated above: UD_Admin_CreateItem and then your item class

So if i want some coffee UD_Admin_CreateItem item_drink_coffee

--Credit Goes To Last.Exile For Cmd
concommand.Add("UD_Admin_CreateItem", function(ply, command, args)
if ply:IsAdmin() && args[1] then -- Make sure the player is a admin!
   local strItem = args[1] -- If the class entered is valid (not nil etc) Continue!
CreateWorldItem(strItem, 1, ply:GetPos() + Vector(0, 0, 30)) -- Spawn at Ply's Pos
print (ply:Nick() .." Spawned ".. args[1]) -- Let's print it to console to log it
end
end)

Quotebreslau: if i cant cheat i dont wanna play
breslau: period