[Unsupported] Say my Weapon

[Unsupported] Say my Weapon 1

Aucune autorisation de téléchargement
  • Initiateur de la discussion Linventif
  • Date de début
  • Initiateur de la discussion
Linventif

Linventif

https://linv.dev/discord
Messages
276
Score réaction
109
Points
150
Linventif a posté une nouvelle ressource :

Say my Weapon - LICENCE -> CC BY-NC-SA 3.0

Inforamtions
| This script displays a message in the chat when a player picks up a listed weapon.
| Ce script permet d'afficher un message dans le chat quand un joueur prend une arme lister.



Installation
| Move the file into the folder garrysmod/lua/autorun/client of your server.
| Déplacez simplement le fichier dans le dossier garrysmod/lua/autorun/client de votre serveur.



Configuration
| Add weapon name in the table weapon_trigger
|...
En savoir plus sur cette ressource...
 
jukww2

jukww2

Rulio Dla Muerte
Messages
156
Score réaction
80
Points
130
Utilise la fonction wepon:GetPrintName() pour récupérer le nom du swep et pas la classe.
 
jukww2

jukww2

Rulio Dla Muerte
Messages
156
Score réaction
80
Points
130
JavaScript:
weapon_trigger = { ["weapon_357"] = true, ["weapon_crowbar"] = true, ["add_weapon_name"] = true,
}
hook.Add("PlayerSwitchWeapon", "Linventif:SayMyWep", function(ply, oldWeapon, newWeapon) if ply != LocalPlayer() then return end if not IsValid(newWeapon) then return end if weapon_trigger[newWeapon:GetClass()] then RunConsoleCommand("say", "/me sort un.e "..newWeapon:GetPrintName()) end
end)
Voila ton code sans boucle stv
 
Discord d'entraide
Rejoignz-nous sur Discord