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
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
Geändert von tkone@selfhelp (19.07.2008 um 23:59 Uhr)
Rein theoretisch hast du recht, aber sie werden in der "SWEPrimaryAttack()" Funktion definiert.
Ich werde es trotz dem einfügen, da es übersichtlicher ist./* Make sure we can shoot first*/
if ( !self:CanPrimaryAttack() ) then return end
/* Play shoot sound*/
self.Weapon:EmitSound("Weapon_AR2.Single")
...
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
Mein Pc
System: Windows 7 64Bit
Intel i5 750 2,6
Ram: 4.00GB
Grafikkarte : ATI HD Readon 5850
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![]()
Geändert von Richi (06.08.2008 um 20:05 Uhr)
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
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...![]()
Geändert von Richi (06.08.2008 um 20:36 Uhr)