Traité Changement de skin auto

Statut
N'est pas ouverte pour d'autres réponses.

Skylisle

Master 🏆
Level 1

Torrents Stats

Messages
106
J'aime
4
Trophées
806
Inscrit
29 Novembre 2015
Salut a tous

Je voulais savoir si c'était possible, quand on met une personne en prison sa change son skin automatiquement sa le met en prisonnier sa serais pas mal pour plus de RP. Si oui comment ? Merci :p
 

Skylisle

Master 🏆
Level 1

Torrents Stats

Messages
106
J'aime
4
Trophées
806
Inscrit
29 Novembre 2015
ça c'est ton baton d'arrêt

Code:
AddCSLuaFile()

if CLIENT then
    SWEP.PrintName = "Arrest Baton"
    SWEP.Slot = 1
    SWEP.SlotPos = 3
end

DEFINE_BASECLASS("stick_base")

SWEP.Instructions = "Left click to arrest\nRight click to switch batons"
SWEP.IsDarkRPArrestStick = true

SWEP.Spawnable = true
SWEP.Category = "DarkRP (Utility)"

SWEP.StickColor = Color(255, 0, 0)

SWEP.Switched = true

DarkRP.hookStub{
    name = "canArrest",
    description = "Whether someone can arrest another player.",
    parameters = {
        {
            name = "arrester",
            description = "The player trying to arrest someone.",
            type = "Player"
        },
        {
            name = "arrestee",
            description = "The player being arrested.",
            type = "Player"
        }
    },
    returns = {
        {
            name = "canArrest",
            description = "A yes or no as to whether the arrester can arrest the arestee.",
            type = "boolean"
        },
        {
            name = "message",
            description = "The message that is shown when they can't arrest the player.",
            type = "string"
        }
    },
    realm = "Server"
}

function SWEP:Deploy()
    self.Switched = true
    return BaseClass.Deploy(self)
end

function SWEP:PrimaryAttack()
    BaseClass.PrimaryAttack(self)

    if CLIENT then return end

    self:GetOwner():LagCompensation(true)
    local trace = util.QuickTrace(self:GetOwner():EyePos(), self:GetOwner():GetAimVector() * 90, {self:GetOwner()})
    self:GetOwner():LagCompensation(false)

    if IsValid(trace.Entity) and trace.Entity.onArrestStickUsed then
        trace.Entity:onArrestStickUsed(self:GetOwner())
        return
    end

    local ent = self:GetOwner():getEyeSightHitEntity(nil, nil, function(p) return p ~= self:GetOwner() and p:IsPlayer() and p:Alive() end)

    if not IsValid(ent) or (self:GetOwner():EyePos():Distance(ent:GetPos()) > 90) or not ent:IsPlayer() then
        return
    end

    local canArrest, message = hook.Call("canArrest", DarkRP.hooks, self:GetOwner(), ent)
    if not canArrest then
        if message then DarkRP.notify(self:GetOwner(), 1, 5, message) end
        return
    end

    -- Send NPCs to Jail
    if ent:IsNPC() then
        ent:SetPos(DarkRP.retrieveJailPos())
        return
    end

    ent:arrest(nil, self:GetOwner())
    DarkRP.notify(ent, 0, 20, DarkRP.getPhrase("youre_arrested_by", self:GetOwner():Nick()))

    if self:GetOwner().SteamName then
        DarkRP.log(self:GetOwner():Nick() .. " (" .. self:GetOwner():SteamID() .. ") arrested " .. ent:Nick(), Color(0, 255, 255))
    end
end

function SWEP:startDarkRPCommand(usrcmd)
    if game.SinglePlayer() and CLIENT then return end
    if usrcmd:KeyDown(IN_ATTACK2) then
        if not self.Switched and self:GetOwner():HasWeapon("unarrest_stick") then
            usrcmd:SelectWeapon(self:GetOwner():GetWeapon("unarrest_stick"))
        end
    else
        self.Switched = false
    end
end

Maintenant faut trouver une fonction lorsqu'il arrete ça change de skins je connait pas la fonction mais peut être que quelqu'un la connait :)
C'est avec advanced arresting systeme sa ? Si c'est ça faut que je le mettent mais je pense que sa se remet automatiquement après chaque respawn normalement c'est logique j'essai sa demain je te dit quoi
 

Skylisle

Master 🏆
Level 1

Torrents Stats

Messages
106
J'aime
4
Trophées
806
Inscrit
29 Novembre 2015
Statut
N'est pas ouverte pour d'autres réponses.
Haut Bas