Torrents Stats
- Partagées
- 130 Go
- Téléchargées
- 0 bytes
- Ratio
- -
- Messages
- 16
- J'aime
- 0
- Trophées
- 25
- Inscrit
- 2 Mai 2017
Bonjour/Bonsoir,
Je voudrais que vous m'aidez s'il vous plaît à me faire le côté SERVER car actuellement j'ai que le côté CLIENT :
Voici le code côté CLIENT :
Merci d'avance :)
Je voudrais que vous m'aidez s'il vous plaît à me faire le côté SERVER car actuellement j'ai que le côté CLIENT :
Voici le code côté CLIENT :
Code:
-----------------------------------------------------
if SERVER then
resource.AddFile( "materials/microphone.png" )
hook.Add( "PlayerCanHearPlayersVoice", "VoiceEditSystemHookCanHear", function( listener, talker )
if talker:GetNWInt("VoiceSystemEditNW") == 0 and listener:GetPos():Distance( talker:GetPos() ) > 100 then return false end
if talker:GetNWInt("VoiceSystemEditNW") == 1 and listener:GetPos():Distance( talker:GetPos() ) > 300 then return false end
if talker:GetNWInt("VoiceSystemEditNW") == 2 and listener:GetPos():Distance( talker:GetPos() ) > 600 then return false end
end )
hook.Add( "PlayerInitialSpawn", "VoiceEditSystemHookInitSpawn", function(ply)
ply:SetNWInt("VoiceSystemEditNW",1)
end)
hook.Add( "PlayerSay", "VoiceEditSystemHookSay", function( ply, text, public )
text = string.lower( text ) -- Make the chat message entirely lowercase
if ( text == "/changevoice" ) then
ply:SetNWInt("VoiceSystemEditNW",ply:GetNWInt("VoiceSystemEditNW") + 1)
if ply:GetNWInt("VoiceSystemEditNW") == 3 then ply:SetNWInt("VoiceSystemEditNW",0) end
if ply:GetNWInt("VoiceSystemEditNW") == 0 then
ply:ChatPrint("Vous parlez bas")
end
if ply:GetNWInt("VoiceSystemEditNW") == 1 then
ply:ChatPrint("Vous parlez normalement")
end
if ply:GetNWInt("VoiceSystemEditNW") == 2 then
ply:ChatPrint("Vous parlez fortement")
end
return ""
end
end )
end
if CLIENT then
hook.Add( "HUDPaint", "VoiceEditSystemHookHUD", function()
if LocalPlayer():IsSpeaking() then
surface.SetDrawColor( 30, 30, 30, 255 )
surface.SetMaterial( Material("materials/microphone.png"))
surface.DrawTexturedRect( ScrW() - 55, 5, 32,32 )
draw.RoundedBoxEx( 4, ScrW() - 180,12,130,20,Color(0, 0, 0, 240), true, false, true, false )
if ply:GetNWInt("VoiceSystemEditNW") == 0 then
draw.SimpleText("Chuchotement ( F6 )","Trebuchet18",ScrW() - 175,13,Color(47, 179, 43, 150))
end
if ply:GetNWInt("VoiceSystemEditNW") == 1 then
draw.SimpleText("Normalement ( F6 )","Trebuchet18",ScrW() - 175,13,Color(47, 179, 43, 150))
end
if ply:GetNWInt("VoiceSystemEditNW") == 2 then
draw.SimpleText("Fortement ( F6 )","Trebuchet18",ScrW() - 175,13,Color(47, 179, 43, 150))
end
--draw.SimpleText("F6 pour changer le mode de parole","Trebuchet18",ScrW() - 150,10,Color(0,255,0),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
end
end )
hook.Add( "Think", "VoiceEditSystemHookKeyDown", function()
if input.IsKeyDown(KEY_F6) then
LocalPlayer():ConCommand("say /changevoice")
end
end )
end
Merci d'avance :)