SWEP.Primary.Sound = Sound( "ordner/soundfile.wav" )
SWEP.Secondary.Sound = Sound( "ordner/soundfile.wav" )
SWEP.Primary.ReloadSound = Sound( "odner/soundfile.wav" )
feheln (Wir wollen ja Waffensounds)
1.Primärsound
2.Sekundärsound
3.Reloadsound
Druckbare Version
SWEP.Primary.Sound = Sound( "ordner/soundfile.wav" )
SWEP.Secondary.Sound = Sound( "ordner/soundfile.wav" )
SWEP.Primary.ReloadSound = Sound( "odner/soundfile.wav" )
feheln (Wir wollen ja Waffensounds)
1.Primärsound
2.Sekundärsound
3.Reloadsound
Rein theoretisch hast du recht, aber sie werden in der "SWEP:PrimaryAttack()" Funktion definiert.Ich werde es trotz dem einfügen, da es übersichtlicher ist.Zitat:
/* Make sure we can shoot first*/
if ( !self:CanPrimaryAttack() ) then return end
/* Play shoot sound*/
self.Weapon:EmitSound("Weapon_AR2.Single")
...
jo danke
eine frage ist der code hier richtig?
ist fürs nachladen das soon sound abgespielt wird
funktioniert bei mir nämlich ned... weiß ned warum :/Code:SWEP.Primary.ReloadSound = Sound( "weapons/handgun/reload.wav" )
Ich sag nur eins. Anpinnen
Nein...
Da es sonst noch zu 5-Sec SWEP releases kommt!
laut tkone@selfhelp ist es so richtig, werde es mal schnell testen
Edit:
so, du hattest recht.
Habe den Fehler behoben.
Tipp: der "Sound" Ordner darf nicht angegeben werden zb.
"sound/weapon/reload.wav" wird zu "weapon/reload.wav"
Edit ENDE:
Ich weiß jetzt net ob ich das positiv oder negativ aufnehmen soll ^^
danke für deine infos aber das komische ist ja:
das der sound für normale schießen ja genauso ist... also wie folgt:
also der Primary.Sound befehl funktioniert ja... jetzt versteh ich nicht wieso der reloadsound nicht geht :/Code:[...]
SWEP.Primary.Sound = Sound( "weapons/handgun/handgun.wav" )
[...]
SWEP.Primary.ReloadSound = Sound( "weapons/handgun/reload.wav" )
[...]
hier ist mal der gesamte code vill. liegt der fehler ja irgendwo anders...
der ordner sieht wie folgt aus:Code:
if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
SWEP.HoldType = "pistol"
end
if ( CLIENT ) then
SWEP.PrintName = "HAND Gun"
SWEP.Author = "Denry (Remade by 0mighty_K)"
SWEP.ViewModelFOV = 60
SWEP.Slot = 1
SWEP.SlotPos = 1
SWEP.IconLetter = "b"
killicon.AddFont( "weapon_glock", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
end
SWEP.Base = "weapon_cs_base"
SWEP.ViewModelFlip = false
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.ViewModel = "models/denry/v_pistol.mdl"
SWEP.WorldModel = "models/weapons/w_colt.mdl"
SWEP.Weight = 5
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = true
SWEP.Primary.Sound = Sound( "weapons/handgun/handgun.wav" )
SWEP.Primary.Recoil = 1.6
SWEP.Primary.Damage = 15
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0.02
SWEP.Primary.ClipSize = 10
SWEP.Primary.Delay = 0.5
SWEP.Primary.DefaultClip = 301
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "smg1"
SWEP.Primary.ReloadSound = Sound( "weapons/handgun/reload.wav" )
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
der ordner ist Hand gun
und unter: sound/weapon/handgun/soundname.wav sind halt die sounds
die lua datei ist unter: /lua/weapons/weapon_HANDgun/shared.lua
und eine frage hätte ich noch wie heißt der befehl um den sound zu bestimmen wenn das magazin leer ist also so wie bei ner waffe wenn das magazin alle ist immer soon clicken kommt... diesen sound mein ich
hoffe ihr könnt mir helfen ^^
Also wichtig ist, damit die sounds abgespielt werden, das in der Reload funktion das steht:
und in der attack(p) funktion:Code:if (self.Weapon:DefaultReload( ACT_VM_RELOAD )) then
self.Weapon:EmitSound ( self.Primary.ReloadSound )
end
und in der attack(s) funktion:Code:self.Weapon:EmitSound ( self.Primary.Sound )
Dann müsste alles gehen, und bei mir geht es auch.Code:self.Weapon:EmitSound ( self.Secondary.Sound )
Aber da du dein swep net mit dem Generator erstellt hast(erkenne ich an der code struktur) gehört das hier net rein
den gesamten code hab ich doch schon oben gepostet
Zitat:
hier ist mal der gesamte code vill. liegt der fehler ja irgendwo anders...
Code:
Code:if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
SWEP.HoldType = "pistol"
end
if ( CLIENT ) then
SWEP.PrintName = "HAND Gun"
SWEP.Author = "Denry (Remade by 0mighty_K)"
SWEP.ViewModelFOV = 60
SWEP.Slot = 1
SWEP.SlotPos = 1
SWEP.IconLetter = "b"
killicon.AddFont( "weapon_glock", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
end
SWEP.Base = "weapon_cs_base"
SWEP.ViewModelFlip = false
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.ViewModel = "models/denry/v_pistol.mdl"
SWEP.WorldModel = "models/weapons/w_colt.mdl"
SWEP.Weight = 5
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = true
SWEP.Primary.Sound = Sound( "weapons/handgun/handgun.wav" )
SWEP.Primary.Recoil = 1.6
SWEP.Primary.Damage = 15
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0.02
SWEP.Primary.ClipSize = 10
SWEP.Primary.Delay = 0.5
SWEP.Primary.DefaultClip = 301
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "smg1"
SWEP.Primary.ReloadSound = Sound( "weapons/handgun/reload.wav" )
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
der befehl:
ist das jetzt dieses normalerweise clicken wenn das magazin leer ist?Code:if (self.Weapon:DefaultReload( ACT_VM_RELOAD )) then
self.Weapon:EmitSound ( self.Primary.ReloadSound )
end
sry ich kenn mich in lua noch ned wirklich gut aus...:oops: