Probleme surrender

  • Initiateur de la discussion Yoko6001
  • Date de début
  • Initiateur de la discussion
Yoko6001

Yoko6001

Geek suprême
Messages
130
Score réaction
4
Points
115
Salut j'ai un soucis avec le script surrender j'ai voulu ajouter des armes avec lesquelles on pourrait braquer les joueurs mais le soucis c'est que quand je fais g sa ne demande rien au joueur ou quoi que sa soit,je vous met un pastebin ci dessous:
http://pastebin.com/KsSr6q1w
 
  • Initiateur de la discussion
Yoko6001

Yoko6001

Geek suprême
Messages
130
Score réaction
4
Points
115
up c'est assez important :s
 
Nardox

Nardox

Psychopathe
Messages
1 143
Score réaction
240
Points
250
Tu le fait avec des M9K ?
 
  • Initiateur de la discussion
Yoko6001

Yoko6001

Geek suprême
Messages
130
Score réaction
4
Points
115
Oui
 
Nardox

Nardox

Psychopathe
Messages
1 143
Score réaction
240
Points
250
Bah ça ne devrait pas te poser de problème je te met ma config
 
  • Initiateur de la discussion
Yoko6001

Yoko6001

Geek suprême
Messages
130
Score réaction
4
Points
115
D'acc
 
Nardox

Nardox

Psychopathe
Messages
1 143
Score réaction
240
Points
250
Code:
SurrenderSettings = {}
--Functionality allowing you to decide whether or not a player should be able to surrender (prevents shouting on player aswell), returning false will stop the player from being surrendered completly
SurrenderSettings["cansurrender"] = function(ply) --if IsAntlion(ply) or IsAntlionG(ply) then return false end return true
end
--Functionality allowing you to decide whether or not a player should be able to shout
SurrenderSettings["canshout"] = function(ply,vic) --if IsAntlion(ply) or IsAntlionG(ply) then return false end --if not ply:isCP() then return false end --Because people like to do this --if vic:IsSuperAdmin() then return false end --Im a celebrity! Leave me alone! return true
end
--Functionality allowing you to decide whether or not a player can be tied. Returning false disallows it, and adding a second stringed argument will add that as a text incase things "go wrong"
SurrenderSettings["cantie"] = function(ply,vic) --if IsAntlion(ply) or IsAntlionG(ply) then return false, "(Antlions cant tie people.)" end --if IsAntlion(vic) or IsAntlionG(vic) then return false, "(Antlions cant be tied.)" end --if not ply:HasWeapon("weapon_lordi_rope") then return false, "(You dont have rope)" end return true
end
--Allow players with a valid weapon, to shout at others causing them to surrender? (Only if the victim doesnt have a "valid" weapon out aswell)
SurrenderSettings["forcesurrender"] = true
--What messages should be spoken by the player, when they shout, whilst the target is running? (Only if SurrenderSettings["forcesurrender"] is set to true)
SurrenderSettings["forcesurrender_messages_running"] = {
"Bouge plus!",
"Tien le!",
"Aucun geste",
"ARRETE DE COURRIR!",
"Tien le ici!"
}
--What messages should be spoken by the player, when they shout, whilst the target is standing still? (Only if SurrenderSettings["forcesurrender"] is set to true)
SurrenderSettings["forcesurrender_messages_standing"] = {
"A TERRE!",
"EMBRASSE LE SOL!",
"LE SOL!",
"SUR LE SOL!",
"Couche toi, sur le sol!",
"Quand va tu te mettre a terre"
}
--What messages should be spoken by the player, when they shout, whilst the target is already surrendering? (Only if SurrenderSettings["forcesurrender"] is set to true)
SurrenderSettings["forcesurrender_messages_surrendering"] = {
"Reste a terre!",
"Ques-ce que tu dit?",
"Tu ira nul part!",
"Leve toi, et met un masque sur la tete!",
}
--How likely is it that a player will surrender, when asked to?
--1 is always, 1 is 1/1 chance, 50 is 50/50 chance, and so on (Only if SurrenderSettings["forcesurrender"] is set to true)
SurrenderSettings["forcesurrender_chance"] = 1
--How long will a player surrender for, when asked to? (in seconds) (Only if SurrenderSettings["forcesurrender"] is set to true)
SurrenderSettings["forcesurrender_time"] = 20
--Should SurrenderSettings["intimidatingweapons"] be inverted? This will cause the table to act as a blacklist, rather than a whitelist
SurrenderSettings["intimidatingweapons_invert"] = false
--What weapons should be able to cause a player to forcibly surrender, if the wielder shouts at them? (Only if SurrenderSettings["forcesurrender"] is set to true)
SurrenderSettings["intimidatingweapons"] = {
["m9k_acr"] = true,
["m9k_amd65"] = true,
["weapon_fiveseven2"] = true,
["m9k_fal"] = true,
["m9k_m14sp"] = true,
["m9k_m16a4_acog"] = true,
["m9k_m416"] = true,
["m9k_scar"] = true,
["m9k_tar21"] = true,
["m9k_val"] = true,
["m9k_vikhr"] = true,
["m9k_winchester73"] = true,
["m9k_ak47"] = true,
["m9k_ak74"] = true,
["m9k_deagle"] = true,
["m9k_hk45"] = true,
["m9k_colt1911"] = true,
["m9k_m3"] = true,
["m9k_hk45"] = true,
["m9k_coltpython"] = true,
["m9k_m92beretta"] = true,
["m9k_1887winchester"] = true,
["m9k_dbarrel"] = true,
["m9k_jackhammer"] = true,
["m9k_m3"] = true,
["m9k_ithacam37"] = true,
["m9k_mossberg590"] = true,
["m9k_remington870"] = true,
["m9k_1897winchester"] = true,
["weapon_mad_xm114"] = true,
["m9k_svt40"] = true,
["m9k_svu"] = true,
["m9k_dragunov"] = true,
["m9k_intervention"] = true,
["m9k_psg1"] = true,
["m9k_aw50"] = true,
["m9k_m24"] = true,
["m9k_remington7615p"] = true,
["m9k_contender"] = true,
["m9k_fg42"] = true,
["m9k_m60"] = true,
["m9k_minigun"] = true,
["m9k_m416"] = true,
["m9k_barret_m82"] = true,
["m9k_glock"] = true,
["m9k_famas"] = true,
["stungun"] = true,
["m9k_pkm"] = true,
["m9k_usp"] = true,
["m9k_l85"] = true,
}
--If a player is surrendering, they can still take damage, this will scale the damage, allowing surrendering people, to have a chance to show that they are surrendering
--so they wont get killed the minute another player spots them (set to 1 for full damage)
SurrenderSettings["surrenderdamagescale"] = 0.25
--Should SurrenderSettings["weapontostrip"] be inverted? This will cause the table to act as a blacklist, rather than a whitelist
SurrenderSettings["weapontostrip_invert"] = false
--What weapons should get striped from a player, when their weapons are "removed"? (This will cause the player "removing" the weapons, to receive them
--and if they already have it, the weapon will drop on the ground)
SurrenderSettings["weapontostrip"] = {
["m9k_acr"] = true,
["m9k_amd65"] = true,
["weapon_fiveseven2"] = true,
["m9k_fal"] = true,
["m9k_m14sp"] = true,
["m9k_m16a4_acog"] = true,
["m9k_m416"] = true,
["m9k_scar"] = true,
["m9k_tar21"] = true,
["m9k_val"] = true,
["m9k_vikhr"] = true,
["m9k_winchester73"] = true,
["m9k_ak47"] = true,
["m9k_ak74"] = true,
["m9k_deagle"] = true,
["m9k_hk45"] = true,
["m9k_colt1911"] = true,
["m9k_m3"] = true,
["m9k_hk45"] = true,
["m9k_coltpython"] = true,
["m9k_m92beretta"] = true,
["m9k_1887winchester"] = true,
["m9k_dbarrel"] = true,
["m9k_jackhammer"] = true,
["m9k_m3"] = true,
["m9k_ithacam37"] = true,
["m9k_mossberg590"] = true,
["m9k_remington870"] = true,
["m9k_1897winchester"] = true,
["weapon_mad_xm114"] = true,
["m9k_svt40"] = true,
["m9k_svu"] = true,
["m9k_dragunov"] = true,
["m9k_intervention"] = true,
["m9k_psg1"] = true,
["m9k_aw50"] = true,
["m9k_m24"] = true,
["m9k_remington7615p"] = true,
["m9k_contender"] = true,
["m9k_fg42"] = true,
["m9k_m60"] = true,
["m9k_minigun"] = true,
["m9k_m416"] = true,
["m9k_barret_m82"] = true,
["m9k_glock"] = true,
["m9k_famas"] = true,
["stungun"] = true,
["m9k_pkm"] = true,
["m9k_usp"] = true,
["m9k_l85"] = true,
}
 
  • Initiateur de la discussion
Yoko6001

Yoko6001

Geek suprême
Messages
130
Score réaction
4
Points
115
Je test sa et jte dis quoi :)
 
  • Initiateur de la discussion
Yoko6001

Yoko6001

Geek suprême
Messages
130
Score réaction
4
Points
115
Sa fonctionne pas non plus,sa serait également possible d'avoir les configs des autres fichiers du script si ce n'est trop te demander bien entendu?
 
Nardox

Nardox

Psychopathe
Messages
1 143
Score réaction
240
Points
250
Surrender_menu.lua
Code:
--y u no work as darkrp modules, dam u
hook.Add("PopulateToolMenu","surrender_shout_button_setting",function() spawnmenu.AddToolMenuOption("Options","Surrendering","shout_key_setting","Shout key setting","","",function(option) option:AddControl("Label",{Text = "When the following key is pressed, you will \"shout\" at a player, causing them, by random chance to surrender against their own will\n(This only works if you have a threatning weapon)"}) option:AddControl("Numpad",{Label = "",Command = "surrender_shout_key"}) end)
end)
cl_init.lua
Code:
CreateClientConVar("surrender_shout_key","17")
hook.Add("CalcView","surrender_firstperson_view",function(ply, pos, angles, fov) if ply:IsSurrendering() or ply:IsCableTied() then local attachid = ply:LookupAttachment("eyes") if attachid == 0 then attachid = ply:LookupAttachment("1") end if ply:GetAttachment(attachid) then local view = {} if ply:IsCableTied() then view.origin = ply:GetAttachment(attachid).Pos + ply:GetAttachment(attachid).Ang:Forward() * 5 + ply:GetAttachment(attachid).Ang:Right() * -10 else view.origin = ply:GetAttachment(attachid).Pos + ply:GetAttachment(attachid).Ang:Forward() * 5 end if ply:IsCableTied() then view.angles = ply:GetAttachment(attachid).Ang else view.angles = angles end view.fov = fov return view end end
end)
hook.Add("ShouldDrawLocalPlayer","surrender_shoulddraw_localplayer",function(ply) if LocalPlayer():IsSurrendering() or LocalPlayer():IsCableTied() then return true end
end)
hook.Add("PlayerBindPress","surrendering_disable_movements",function(ply,bind,pressd) if ply:IsSurrendering() or ply:IsCableTied() then if string.find(bind,"+jump") or string.find(bind,"+duck") then return true end end
end)
local sur_chat_open = false
hook.Add("StartChat","surrender_onchat_open",function() sur_chat_open = true end)
hook.Add("FinishChat","surrender_onchat_close",function() sur_chat_open = false end)
hook.Add("canRequestHit","surrender_prevent_hitmenu",function(hitman) if hitman:IsSurrendering() or hitman:IsCableTied() then return false, "Player is surrendering/tied" end end)
local shout_key_pressed = false
hook.Add("Think","surrender_shout_button",function() if not shout_key_pressed and not sur_chat_open and not gui.IsGameUIVisible() then if input.IsKeyDown(GetConVarNumber("surrender_shout_key")) then shout_key_pressed = true RunConsoleCommand("surrender_shout") end else if not input.IsKeyDown(GetConVarNumber("surrender_shout_key")) then shout_key_pressed = false end end
end)
hook.Add("HUDDrawTargetID","surrender´_hint",function() if LocalPlayer():IsCableTied() or LocalPlayer():IsSurrendering() then return end local tr = util.GetPlayerTrace( LocalPlayer() ) local trace = util.TraceLine( tr ) if (!trace.Hit) then return end if (!trace.HitNonWorld) then return end if LocalPlayer():GetShootPos():Distance(trace.HitPos) > 100 then return end if not trace.Entity:IsPlayer() then return end if trace.Entity:IsCableTied() or trace.Entity:IsSurrendering() then draw.DrawText("Press USE to to interact","ChatFont",ScrW() / 2,ScrH() / 1.5,Color(200,200,200,255),TEXT_ALIGN_CENTER) end
end)
usermessage.Hook("surrender_shout_viewmodel",function(um) local shout_viewmodel_controller = true local shout_viewmodel_multi = 0 local shout_pos = Vector(8.586, -6.018, 2) local shout_ang = Vector(-28.142, 36.583, -30.251) hook.Add("CalcViewModelView","surrender_shout_viewmodel",function(wep,vm,oldpos,oldang,pos,ang) if ( !IsValid( wep ) ) then return end local vm_origin, vm_angles = pos, ang -- Controls the position of all viewmodels local func = wep.GetViewModelPosition if ( func ) then local pos, ang = func( wep, pos*1, ang*1 ) vm_origin = pos or vm_origin vm_angles = ang or vm_angles end -- Controls the position of individual viewmodels func = wep.CalcViewModelView if ( func ) then local pos, ang = func( wep, vm, oldpos*1, oldang*1, pos*1, ang*1 ) vm_origin = pos or vm_origin vm_angles = ang or vm_angles end if shout_viewmodel_controller then if shout_viewmodel_multi >= 0.96 then shout_viewmodel_controller = false end shout_viewmodel_multi = Lerp(0.06,shout_viewmodel_multi,1) else if shout_viewmodel_multi <= 0.04 then hook.Remove("CalcViewModelView","surrender_shout_viewmodel") end shout_viewmodel_multi = Lerp(0.05,shout_viewmodel_multi,0) end vm_angles:RotateAroundAxis(vm_angles:Right(), shout_ang.x * shout_viewmodel_multi) vm_angles:RotateAroundAxis(vm_angles:Up(), shout_ang.y * shout_viewmodel_multi) vm_angles:RotateAroundAxis(vm_angles:Forward(), shout_ang.z * shout_viewmodel_multi) vm_origin = vm_origin + shout_pos.x * vm_angles:Right() * shout_viewmodel_multi vm_origin = vm_origin + shout_pos.y * vm_angles:Forward() * shout_viewmodel_multi vm_origin = vm_origin + shout_pos.z * vm_angles:Up() * shout_viewmodel_multi return vm_origin, vm_angles end)
end)
local surrender_interact_text = [[This player is surrendering.
Tu peux le mettre a terre
Lui rendre impossible de bouger
Pour 10 minutes
Le fouiller
Prendre ses arme
]]
local surrender_interact_text_tied = [[This player is tied up.
Tu peux le remettre debout
Lui rendre possible de bouger
tu peux le fouiller
Prendre ses arme
]]
function Surrender_Interact_Menu(um)
local surrenderer = um:ReadEntity()
local Interact_Frame = vgui.Create("DFrame")
Interact_Frame:SetSize(200,200)
Interact_Frame:SetTitle("Interact with "..surrenderer:GetName())
Interact_Frame:SetVisible( true )
Interact_Frame:SetDraggable( false )
Interact_Frame:ShowCloseButton( false )
Interact_Frame:Center()
Interact_Frame:SetSkin(GAMEMODE.Config.DarkRPSkin)
Interact_Frame:MakePopup()
Interact_Frame.Think = function() if not IsValid(surrenderer) or not surrenderer:IsSurrendering() and not surrenderer:IsCableTied() or LocalPlayer():GetPos():Distance(surrenderer:GetPos()) > 100 then Interact_Frame:Close() end
end
local Label = vgui.Create("DLabel",Interact_Frame)
Label:SetPos(10,30)
if surrenderer:IsCableTied() then Label:SetText(surrender_interact_text_tied)
else Label:SetText(surrender_interact_text)
end local CableTieButton = vgui.Create("DButton",Interact_Frame ) CableTieButton:SetPos(20,120) CableTieButton:SetSize(160,20) if not surrenderer:IsCableTied() then CableTieButton:SetText("Coucher au sol") CableTieButton.DoClick = function() RunConsoleCommand("surrender_cable_tie",tostring(surrenderer:EntIndex())) Interact_Frame:Close() end local cantie, msg = SurrenderSettings["cantie"](LocalPlayer(),surrenderer) if cantie == false then CableTieButton:SetDisabled(true) CableTieButton:SetText("Le coucher au sol "..msg or "(Unknown)") end else CableTieButton:SetText("Enlever le noeud") CableTieButton.DoClick = function() RunConsoleCommand("surrender_uncable_tie",tostring(surrenderer:EntIndex())) Interact_Frame:Close() end end local StripButton = vgui.Create("DButton",Interact_Frame) StripButton:SetPos(20,145) StripButton:SetText("Prendre cest armes") StripButton:SetSize(160,20) StripButton.DoClick = function() RunConsoleCommand("surrender_strip_weapons",tostring(surrenderer:EntIndex())) Interact_Frame:Close() end local CloseButton = vgui.Create( "DButton", Interact_Frame ) CloseButton:SetPos(20,170) CloseButton:SetText("Fermer") CloseButton:SetSize(160,20) CloseButton.DoClick = function() Interact_Frame:Close() end
Label:SizeToContents()
end
usermessage.Hook("surrender_open_interact_menu",Surrender_Interact_Menu)
function Surrender_Confirm_Dialog()
timer.Simple(0.5,function()
local SurrenderDialog = vgui.Create("DFrame")
SurrenderDialog:SetSize(200, 90 )
SurrenderDialog:SetTitle("Surrender")
SurrenderDialog:SetVisible(true)
SurrenderDialog:SetDraggable(false)
SurrenderDialog:ShowCloseButton(false)
SurrenderDialog:Center()
SurrenderDialog:SetSkin(GAMEMODE.Config.DarkRPSkin)
SurrenderDialog:MakePopup()
SurrenderDialog.Think = function() if LocalPlayer():GetVelocity():Length() > 5 or LocalPlayer():Crouching() or not LocalPlayer():OnGround() or not LocalPlayer():Alive() then SurrenderDialog:Close() end
end
local Label = vgui.Create("DLabel",SurrenderDialog)
Label:SetPos(10,25)
Label:SetText("Vous voulez vous mettre a genoux vous même?\nTu sera freeze 15 seconde") local CloseButton = vgui.Create("DButton",SurrenderDialog) CloseButton:SetPos(120,65) CloseButton:SetText("NON") CloseButton:SetSize(60,20) CloseButton.DoClick = function() SurrenderDialog:Close() end local ConfirmButton = vgui.Create("DButton",SurrenderDialog) ConfirmButton:SetPos(20,65) ConfirmButton:SetText("OUI") ConfirmButton:SetSize(60,20) ConfirmButton.DoClick = function() SurrenderDialog:Close() RunConsoleCommand("surrender_surrender") end
Label:SizeToContents()
end)
end
usermessage.Hook("surrender_confirm_dialog",Surrender_Confirm_Dialog)
sh_init.lua
Code:
DarkRP.registerDarkRPVar("In_Surrender_state",net.WriteBit,fc{tobool,net.ReadBit})
DarkRP.registerDarkRPVar("Is_Cable_tied",net.WriteBit,fc{tobool,net.ReadBit})
local plyMeta = FindMetaTable("Player")
function plyMeta:IsSurrendering() return (self:getDarkRPVar("In_Surrender_state") or false)
end
--There's nothing related to cables, except through the code... Just didnt want to change it... Whole reason why players look "tied" and why this is called "cable"
--was due to me being inspired by PAYDAY 2
function plyMeta:IsCableTied() return (self:getDarkRPVar("Is_Cable_tied") or false)
end
 
Dernière édition:
  • J'aime
Réactions: Yoh Sambre ♪
Nardox

Nardox

Psychopathe
Messages
1 143
Score réaction
240
Points
250
Ya des autres fichiers qui font plus de 15000 caracteres je te le fait sur Pastebin
 
Nardox

Nardox

Psychopathe
Messages
1 143
Score réaction
240
Points
250
http://pastebin.com/vAEqwX2i
 
  • Initiateur de la discussion
Yoko6001

Yoko6001

Geek suprême
Messages
130
Score réaction
4
Points
115
Merci sa fonctionne maintenant l'amis :) J'ai également un petit soucis,j'ai créer un grade sur mon serveur mais il ne peuvent pas porter les véhicules,comment dois je faire pour qu'ils puissent les porter?
 
Nardox

Nardox

Psychopathe
Messages
1 143
Score réaction
240
Points
250
Derien
Pour les voitures tu doit mettre en interet superadmin ou admin je crois
Dsl je sait plus trop
 
Discord d'entraide
Rejoignz-nous sur Discord