--[[
	RP.lua
	(-SG-) Tyler | (STEAM_0:0:40143824)
	===DStream===
]]

require("cvar2")
surface.CreateFont("Arial",13,700,false,false,"ESPFont")

CreateClientConVar("rp_sky",0,true,false)
CreateClientConVar("rp_esp",0,true,false)
CreateClientConVar("rp_join",0,true,false)
CreateClientConVar("rp_godmode",0,true,false)

function cheats()
cvar2.SetValue("sv_cheats","1")
end
hook.Add("Think","fuckshit",cheats)

function Skybox()
if GetConVarNumber("rp_sky") == 1 then
cvar2.SetValue("gl_clear","1")
cvar2.SetValue("r_drawskybox","0")
cvar2.SetValue("r_3dsky","0")
else
cvar2.SetValue("gl_clear","0")
cvar2.SetValue("r_drawskybox","1")
cvar2.SetValue("r_3dsky","1")
end
end	
hook.Add("Think","fuckfuckskyboxfuck",Skybox)


function ESP()
if GetConVarNumber("rp_esp") == 1 then
for k, v in pairs( player.GetAll() ) do
if( v:Alive() && v != LocalPlayer() ) then
local Pos = ( v:GetPos() + Vector( 0, 0, 100 ) ):ToScreen();
local Dist = v:GetPos():Distance(LocalPlayer():GetPos());
local InfoColor = team.GetColor(v:Team())
local wep = "Unknown"
if v:GetActiveWeapon() != nil then
if type(v:GetActiveWeapon()) == "Weapon" then
if v:GetActiveWeapon() and v:GetActiveWeapon():IsValid() then
wep = v:GetActiveWeapon():GetClass()
end
end
end
draw.SimpleText(v:Name(), "ESPFont", Pos.x, Pos.y, InfoColor, TEXT_ALIGN_CENTER );
draw.SimpleText("HP:" .. v:Health(), "ESPFont", Pos.x, Pos.y + 12, InfoColor, TEXT_ALIGN_CENTER );
draw.SimpleText("Distance: " .. math.floor(Dist), "ESPFont", Pos.x, Pos.y + 22, InfoColor, TEXT_ALIGN_CENTER);
draw.SimpleText("Weapon: " .. wep, "ESPFont", Pos.x, Pos.y + 32, InfoColor, TEXT_ALIGN_CENTER );
if v:IsAdmin() then
draw.SimpleText("*Admin*", "ESPFont", Pos.x, Pos.y - 12, Color(0,255,0,255), TEXT_ALIGN_CENTER );
end
end
end
end
end
hook.Add("HUDPaint","PlayerESP",ESP)

concommand.Add("Money", function()
RunConsoleCommand("say", "/dropmoney "..math.random(1, 3000).." ") 
end)

CreateClientConVar("number",0,true,false)
concommand.Add("roll",function()
RunConsoleCommand("say","[Roll The Dice]: You rolled: "..math.random(1,6))
end)


concommand.Add("spin",function()
RunConsoleCommand("say","[Slot Machine]: You spun: ["..math.random(1,9).."|"..math.random(1,9).."|"..math.random(1,9).."]")
end)

concommand.Add("prize",function()
RunConsoleCommand("say","[Win Cash]: You have won: $"..math.random(1,500))
end)

concommand.Add("advert",function()
RunConsoleCommand("say","/advert  Come to the Casino near the fountain and play some of our games!")
end)

function RPGodmode()
if GetConVarNumber("rp_godmode") == 1 then
if (LocalPlayer():Alive() and LocalPlayer():Health() < 100) then
RunConsoleCommand("say","/buyhealth")
end
end
end
hook.Add("Think","RPGodmode",RPGodmode)

function Propkill()
local ply = LocalPlayer()
local Angles = LocalPlayer():EyeAngles()
LocalPlayer():SetEyeAngles(Angle(30, Angles.yaw + 180, Angles.roll))
timer.Create("spawn", 0.1, 1, function()
LocalPlayer():ConCommand("gm_spawn models/props_junk/sawblade001a.mdl")
LocalPlayer():ConCommand("+attack")
end)
timer.Create("jump", 0.15, 1, function()
LocalPlayer():ConCommand("+jump")
end)
timer.Create("turnback", 0.35, 1, function()	
LocalPlayer():SetEyeAngles(Angle(40, Angles.yaw, Angles.roll))
end)
timer.Create("release", 0.37, 1, function()
LocalPlayer():ConCommand("-attack")
end)
timer.Create("-jummp", 0.3, 1, function()
LocalPlayer():ConCommand("-jump")
end)
timer.Create("undo", 1.2, 1, function()		
LocalPlayer():ConCommand("undo")
end)
end
concommand.Add("propkill", Propkill)

