Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Some fucking shit.
- nw.Register('nlr'):Write(net.WriteDouble):Read(net.ReadDouble):SetPlayer()
- util.AddNetworkString("nlrAddLife")
- net.Receive("nlrAddLife",function (len, ply)
- if ply:GetNetVar("nlr") < 2 then
- ply:SetNetVar("nlr", ply:GetNetVar("nlr") + 1)
- ply:SendLua('chat.AddText( Color( 0, 0, 255 ), "[NLR] ", Color( 255, 255, 255 ), "Вы получили плюс одну жизнь." )')
- ply:ChatPrint("Теперь у вас "..ply:GetNetVar('nlr').." жизней")
- end
- end)
- concommand.Add("nlr_set",function (ply, cmd, arg)
- if ply:IsAdmin() then
- ply:SetNetVar('nlr', 2)
- ply:ChatPrint("НЛР стоит на "..ply:GetNetVar('nlr'))
- end
- end)
- concommand.Add("nlr_check", function (ply, cmd, arg)
- ply:ChatPrint("НЛР стоит на "..ply:GetNetVar('nlr'))
- end)
- concommand.Add("nlr_minus",function (ply, cmd, arg)
- if ply:IsAdmin() then
- ply:SetNetVar('nlr', ply:GetNetVar('nlr') - 1)
- ply:ChatPrint("НЛР стоит на "..ply:GetNetVar('nlr'))
- end
- end)
- concommand.Add("nlr_plus",function (ply, cmd, arg)
- if ply:IsAdmin() then
- ply:SetNetVar('nlr', ply:GetNetVar('nlr') + 1)
- ply:ChatPrint("НЛР стоит на "..ply:GetNetVar('nlr'))
- end
- end)
- for k,v in pairs (player.GetAll()) do
- v:SetNetVar("nlr", 2)
- v:SendLua('chat.AddText( Color( 0, 0, 255 ), "[NLR] ", Color( 255, 255, 255 ), "Ваше НЛР значение было поставлено на 2." )')
- end
- local allow_table = {
- ['weapon_physcannon'] = true,
- ['weapon_physgun'] = true,
- ['gmod_tool'] = true,
- ['gmod_camera'] = true,
- ['keys'] = true,
- ['swep_inventory'] = true,
- ['weapon_keypadchecker'] = true,
- ['weapon_pass_rp'] = true
- }
- -- hook.Add("string eventName",any identifier,function func)
- hook.Add("PlayerInitialSpawn","NLRSpawn",function (ply)
- if ply:IsValid() and not ply:GetNetVar("nlr") then
- ply:SetNetVar("nlr", 2)
- ply:SendLua('chat.AddText( Color( 0, 0, 255 ), "[NLR] ", Color( 255, 255, 255 ), "Ваш НЛР счетчик был поставлен на 2." )')
- end
- end)
- hook.Add("PlayerDeath","nlrDeath",function (died, killer, ent)
- local nlr = died:GetNetVar('nlr')
- if died:IsValid() and nlr then
- if nlr > 0 then
- died:SetNetVar("nlr", died:GetNetVar('nlr') - 1)
- died:SendLua('chat.AddText( Color( 0, 0, 255 ), "[NLR] ", Color( 255, 255, 255 ), "Вы потеряли одну жизнь." )')
- end
- end
- end)
- hook.Add("PlayerSwitchWeapon","testingNLR",function (ply, old, new)
- local nlr = ply:GetNetVar("nlr")
- if nlr and nlr <= 0 then
- if allow_table[new:GetClass()] then
- return false
- else
- ply:SendLua('chat.AddText( Color( 0, 0, 255 ), "[NLR] ", Color( 255, 255, 255 ), "Вы не можете сменить оружите т.к у вас НЛР" )')
- return true
- end
- else
- return false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement