- Initiateur de la discussion
M
Membre supprimé 92858
Anonyme
(A supprimer s'il vous plait)
Dernière modification par un modérateur:
AntoGhost à dit:(Poste Edité)
Bonjour / Bonsoir à toutes et à tous !
Je serais plutôt du genre à enlever l'icon au-dessus des joueurs mais je ne sais pas comment faire:
Ceci est mon chatindicator et j'en ai besoin cependant dans self:SetModel("") il n'y a rien (Donc normalement pas de model) mais à la place c'est une "ERROR".Code:AddCSLuaFile("shared.lua") AddCSLuaFile("cl_init.lua") include("cl_init.lua") function ENT:Initialize() self:SetModel("") self:SetMoveType(MOVETYPE_NOCLIP) self:SetSolid(SOLID_NONE) end function ENT:Think() if not IsValid(self.ply) then -- just in case self:Remove() return end self:SetPos(self.ply:GetPos() + Vector(0, 0, 75)) end util.AddNetworkString("DarkRP_ToggleChat") local function ToggleChatIndicator(len, ply) if not IsValid(ply.ChatIndicator) then ply.ChatIndicator = ents.Create("chatindicator") ply.ChatIndicator.ply = ply -- plyception ply.ChatIndicator:SetPos(ply:GetPos() + Vector(0, 0, 85)) ply.ChatIndicator:Spawn() ply.ChatIndicator:Activate() if(ply:Team()==TEAM_CHIEF or ply:Team()==TEAM_POLICE_GHOST or ply:Team()==TEAM_REB_PC or ply:Team()==TEAM_POLICEC or ply:Team()==TEAM_POLICE_RCT or ply:Team()==TEAM_POLICE_05 or ply:Team()==TEAM_POLICE_04 or ply:Team()==TEAM_POLICE_03 or ply:Team()==TEAM_POLICE_02 or ply:Team()==TEAM_POLICE_01 or ply:Team()==TEAM_GUNPC ) then ply:EmitSound("npc/overwatch/radiovoice/on3.wav"); elseif(ply:Team()==TEAM_OTA or ply:Team()==TEAM_OTA_KING or ply:Team()==TEAM_OTA_PRISON) then ply:EmitSound("npc/overwatch/radiovoice/on3.wav"); end else ply.ChatIndicator:Remove() end end net.Receive("DarkRP_ToggleChat", ToggleChatIndicator) util.AddNetworkString("DarkRP_ToggleChat2") local function ToggleChatIndicator2(len, ply) if not IsValid(ply.ChatIndicator) then ply.ChatIndicator = ents.Create("chatindicator") ply.ChatIndicator.ply = ply -- plyception ply.ChatIndicator:SetPos(ply:GetPos() + Vector(0, 0, 85)) ply.ChatIndicator:Spawn() ply.ChatIndicator:Activate() else if(ply:Team()==TEAM_CHIEF or ply:Team()==TEAM_POLICE_GHOST or ply:Team()==TEAM_REB_PC or ply:Team()==TEAM_POLICEC or ply:Team()==TEAM_POLICE_RCT or ply:Team()==TEAM_POLICE_05 or ply:Team()==TEAM_POLICE_04 or ply:Team()==TEAM_POLICE_03 or ply:Team()==TEAM_POLICE_02 or ply:Team()==TEAM_POLICE_01 or ply:Team()==TEAM_GUNPC ) then ply:EmitSound("npc/overwatch/radiovoice/off2.wav"); elseif(ply:Team()==TEAM_OTA or ply:Team()==TEAM_OTA_KING or ply:Team()==TEAM_OTA_PRISON) then ply:EmitSound("npc/overwatch/radiovoice/off2.wav"); end ply.ChatIndicator:Remove() end end net.Receive("DarkRP_ToggleChat2", ToggleChatIndicator2) local function RemoveChatIndicator(ply) if IsValid(ply.ChatIndicator) then ply.ChatIndicator:Remove() end end hook.Add("PlayerDisconnected", "Disc_RemoveIndicator", RemoveChatIndicator) hook.Add("KeyPress", "Move_RemoveIndicator", RemoveChatIndicator) -- so people can't abuse the command. hook.Add("PlayerDeath", "Die_RemoveIndicator", RemoveChatIndicator)
Si une personne a une solution pour enlever l'icon (chatindicator) sans "ERROR" à la place je suis pour (En sachant qu'il faut que je garde le chatindicator (Modifié)".
Merci de votre futur aide, bonne journée / soirée à vous x)
Fais ce que je t'ai dit, supprime l'entités chatindicator, ça enlevera celle de base.AntoGhost à dit:@Hoper, Salut, oui c'est ça cependant j'ai un chatindicator modifié et je dois le garder:
Le modèle se modifie ici:Code:AddCSLuaFile("shared.lua") AddCSLuaFile("cl_init.lua") include("cl_init.lua") function ENT:Initialize() self:SetModel("") self:SetMoveType(MOVETYPE_NOCLIP) self:SetSolid(SOLID_NONE) end function ENT:Think() if not IsValid(self.ply) then -- just in case self:Remove() return end self:SetPos(self.ply:GetPos() + Vector(0, 0, 75)) end util.AddNetworkString("DarkRP_ToggleChat") local function ToggleChatIndicator(len, ply) if not IsValid(ply.ChatIndicator) then ply.ChatIndicator = ents.Create("chatindicator") ply.ChatIndicator.ply = ply -- plyception ply.ChatIndicator:SetPos(ply:GetPos() + Vector(0, 0, 85)) ply.ChatIndicator:Spawn() ply.ChatIndicator:Activate() if(ply:Team()==TEAM_CHIEF or ply:Team()==TEAM_POLICE_GHOST or ply:Team()==TEAM_REB_PC or ply:Team()==TEAM_POLICEC or ply:Team()==TEAM_POLICE_RCT or ply:Team()==TEAM_POLICE_05 or ply:Team()==TEAM_POLICE_04 or ply:Team()==TEAM_POLICE_03 or ply:Team()==TEAM_POLICE_02 or ply:Team()==TEAM_POLICE_01 or ply:Team()==TEAM_GUNPC ) then ply:EmitSound("npc/overwatch/radiovoice/on3.wav"); elseif(ply:Team()==TEAM_OTA or ply:Team()==TEAM_OTA_KING or ply:Team()==TEAM_OTA_PRISON) then ply:EmitSound("npc/overwatch/radiovoice/on3.wav"); end else ply.ChatIndicator:Remove() end end net.Receive("DarkRP_ToggleChat", ToggleChatIndicator) util.AddNetworkString("DarkRP_ToggleChat2") local function ToggleChatIndicator2(len, ply) if not IsValid(ply.ChatIndicator) then ply.ChatIndicator = ents.Create("chatindicator") ply.ChatIndicator.ply = ply -- plyception ply.ChatIndicator:SetPos(ply:GetPos() + Vector(0, 0, 85)) ply.ChatIndicator:Spawn() ply.ChatIndicator:Activate() else if(ply:Team()==TEAM_CHIEF or ply:Team()==TEAM_POLICE_GHOST or ply:Team()==TEAM_REB_PC or ply:Team()==TEAM_POLICEC or ply:Team()==TEAM_POLICE_RCT or ply:Team()==TEAM_POLICE_05 or ply:Team()==TEAM_POLICE_04 or ply:Team()==TEAM_POLICE_03 or ply:Team()==TEAM_POLICE_02 or ply:Team()==TEAM_POLICE_01 or ply:Team()==TEAM_GUNPC ) then ply:EmitSound("npc/overwatch/radiovoice/off2.wav"); elseif(ply:Team()==TEAM_OTA or ply:Team()==TEAM_OTA_KING or ply:Team()==TEAM_OTA_PRISON) then ply:EmitSound("npc/overwatch/radiovoice/off2.wav"); end ply.ChatIndicator:Remove() end end net.Receive("DarkRP_ToggleChat2", ToggleChatIndicator2) local function RemoveChatIndicator(ply) if IsValid(ply.ChatIndicator) then ply.ChatIndicator:Remove() end end hook.Add("PlayerDisconnected", "Disc_RemoveIndicator", RemoveChatIndicator) hook.Add("KeyPress", "Move_RemoveIndicator", RemoveChatIndicator) -- so people can't abuse the command. hook.Add("PlayerDeath", "Die_RemoveIndicator", RemoveChatIndicator)
Cependant quand je mets rien, il y a un model "Error" à la place donc je souhaite trouver un moyen pour enlever le model du script mais je ne sais pas comment faire.Code:self:SetModel("")