• Salut Visiteur ! ✌
    Découvre nos partenaires officiels avec VeryLeak's. Des choix réfléchis, dignes de confiance pour tes avantages.

    StoryFound | REFUNDER TEAM

    StoryFound

    Rejoindre le Canal ✨ ou Plus d'information 📃

    Une question ? Rejoingnez nos différents canaux (Discord, Telegram, Revolt)

    Nos Canaux Communautaires

    Cet affichage peut se clôturer définitivement via la croix en haut à droite.

Traitement.. F1 Third person (3ème personne)

Yamisaaf

Un méchant qui mange des fleurs
Level 5

Torrents Stats

Messages
109
J'aime
627
Trophées
617
Inscrit
27 Août 2017
Ce code à mettre dans: lua/autorun/

Code:
if CLIENT then
local on = false
 
function togglethirdperson()

if vgui.CursorVisible() then return end
on = not on
end
 
net.Receive("sv_togglethirdperson")
 
function CalcThirdperson(ply, pos, ang, fov)
if on then
             local view = {};
            local dist = 100;
            local trace = {};
            
            trace.start = pos;
            trace.endpos = pos - ( ang:Forward() * dist );
            trace.filter = LocalPlayer();
            local trace = util.TraceLine( trace );
            if( trace.HitPos:Distance( pos ) < dist - 10 ) then
                dist = trace.HitPos:Distance( pos ) - 10;
            end;
            view.origin = pos - ( ang:Forward() * dist );
            view.angles = ang;
            view.fov = fov;
            
            return view;
end
end
 
hook.Add("CalcView", "CalcThirdperson", CalcThirdperson)
 
hook.Add("ShouldDrawLocalPlayer", "MyHax ShouldDrawLocalPlayer", function(ply)
if on then
        return true
    end
end)
 
concommand.Add("togglethirdperson", togglethirdperson)
 
local lastf4 = false
hook.Add( "Tick", "CheckPlayerKey", function()
   if (input.IsKeyDown(KEY_F1) and lastf4 == false) then
   togglethirdperson()
   lastf4 = true
   timer.Simple(0.1,function()
   lastf4 = false
   end)
   end
end )
end
 

JeSuisAlex

l'Accru 🥇
Level 1

Torrents Stats

Messages
40
J'aime
0
Trophées
128
Inscrit
7 Décembre 2018
Merci ! J'essaye et je te dit si cela marche
 

JeSuisAlex

l'Accru 🥇
Level 1

Torrents Stats

Messages
40
J'aime
0
Trophées
128
Inscrit
7 Décembre 2018
Ce code à mettre dans: lua/autorun/

Code:
if CLIENT then
local on = false

function togglethirdperson()

if vgui.CursorVisible() then return end
on = not on
end

net.Receive("sv_togglethirdperson")

function CalcThirdperson(ply, pos, ang, fov)
if on then
             local view = {};
            local dist = 100;
            local trace = {};
           
            trace.start = pos;
            trace.endpos = pos - ( ang:Forward() * dist );
            trace.filter = LocalPlayer();
            local trace = util.TraceLine( trace );
            if( trace.HitPos:Distance( pos ) < dist - 10 ) then
                dist = trace.HitPos:Distance( pos ) - 10;
            end;
            view.origin = pos - ( ang:Forward() * dist );
            view.angles = ang;
            view.fov = fov;
           
            return view;
end
end

hook.Add("CalcView", "CalcThirdperson", CalcThirdperson)

hook.Add("ShouldDrawLocalPlayer", "MyHax ShouldDrawLocalPlayer", function(ply)
if on then
        return true
    end
end)

concommand.Add("togglethirdperson", togglethirdperson)

local lastf4 = false
hook.Add( "Tick", "CheckPlayerKey", function()
   if (input.IsKeyDown(KEY_F1) and lastf4 == false) then
   togglethirdperson()
   lastf4 = true
   timer.Simple(0.1,function()
   lastf4 = false
   end)
   end
end )
end
Fonctionne pas :/
 

JeSuisAlex

l'Accru 🥇
Level 1

Torrents Stats

Messages
40
J'aime
0
Trophées
128
Inscrit
7 Décembre 2018
Ton truc marche pas, mais j'ai trouvé un addons c bon ^^
 

Louchou001

VeryLeak's Unique Member 👑
Level 2

Torrents Stats

Messages
95
J'aime
3 980
Trophées
262
Inscrit
1 Juin 2020

zebiclaoui

Membre 🏅
Level 1

Torrents Stats

Messages
7
J'aime
0
Trophées
29
Inscrit
16 Mai 2021
Salut, tu peux me donner le nom de l'addon qui permet de faire ça ?
 
Haut Bas