мне надо сделать чтобы когда игрок сносит определенное кол во хп то при попытки начать смотреть в камену в чате писало камера сломана а когда ты нажимаешь по камере на e она чинится
У меня есть скрипт на то чтобы камеру можно было взрывать, могу скинуть, но такого что ты написал нету наверное ни у кого, поэтому тебе придеться воспользоваться услугами кодера
Чтобы камера взрывалась и я могу сделать но мне надо чтобы была возможность её починить что то по типу как на меджик рп
Если на меджике такое есть значит скрипт 100% не самопис меджика, поэтому моежшь поискать на гмодсторе все аддоны связанные с камерой, найти подходящий и уже на других форумах скачать слив этого аддона
всем ку я кодир меджик рп (любой серверсайд файл)
hook.Add('Think', 'camerapiupiu', function()
hook.Remove('Think', 'camerapiupiu')
local ent = scripted_ents.GetStored('gmod_cameraprop')
if not ent then return end
ent = ent.t
function ent:OnTakeDamage(dmg)
self.health = self.health or 100
if self.health > 0 then
self.health = self.health - dmg:GetDamage()
if self.health <= 0 then
local data = EffectData()
data:SetOrigin(self:GetPos())
util.Effect("Explosion", data)
local watcher = self.UsingPlayer
if IsValid(watcher) then
watcher:SetViewEntity(watcher)
watcher.UsingCamera = nil
self.UsingPlayer = nil
end
end
end
end
function ent:Use(ply)
if self.health and self.health <= 0 and ply == self:CPPIGetOwner() then
self.health = 100
DarkRP.notify(ply, 0, 5, 'Ты починил камеру')
end
end
numpad.Register( "Camera_On", function( pl, ent )
if ( !IsValid( ent ) ) then return false end
if ( !IsValid( pl ) ) then return false end
if ent.health and ent.health <= 0 then
DarkRP.notify(ply, 1, 5, 'Камера сломана. Нажми E смотря на нее для починки')
return
end
pl:SetViewEntity( ent )
pl.UsingCamera = ent
ent.UsingPlayer = pl
end )
numpad.Register( "Camera_Toggle", function( pl, ent, idx, buttoned )
-- The camera was deleted or something - return false to remove this entry
if ( !IsValid( ent ) ) then return false end
if ( !IsValid( pl ) ) then return false end
-- Something else changed players view entity
if ( pl.UsingCamera && pl.UsingCamera == ent && pl:GetViewEntity() != ent ) then
pl.UsingCamera = nil
ent.UsingPlayer = nil
end
if ( pl.UsingCamera && pl.UsingCamera == ent ) then
pl:SetViewEntity( pl )
pl.UsingCamera = nil
ent.UsingPlayer = nil
else
if ent.health and ent.health <= 0 then
DarkRP.notify(ply, 1, 5, 'Камера сломана. Нажми E смотря на нее для починки')
return
end
pl:SetViewEntity( ent )
pl.UsingCamera = ent
ent.UsingPlayer = pl
end
end )
end)
2 лайка
и ещё как сделать так чтобы игрока оповещала когда его камеру сломали?
function ent:OnTakeDamage(dmg)
self.health = self.health or 100
if self.health > 0 then
self.health = self.health - dmg:GetDamage()
if self.health <= 0 then
DarkRP.notify(self:CPPIGetOwner(), 1, 5, 'Твою камеру сломали!')
local data = EffectData()
data:SetOrigin(self:GetPos())
util.Effect("Explosion", data)
local watcher = self.UsingPlayer
if IsValid(watcher) then
watcher:SetViewEntity(watcher)
watcher.UsingCamera = nil
self.UsingPlayer = nil
end
end
end
end
1 лайк
Огромное спасибо