PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : LUA-SWEP-Addon problem: Die SWEP wird nicht im Spawn-menu angezeigt



Loadup[GER]
06.10.2009, 17:37
Nun ja, ich fange gerade ( habe vor 3 Tagen angefangen ) mit LUA an, ich wollte nur mal wissen, wie man Waffen modelle von www.fpsbanana.com auf eine SWEP übertragen kann, da ich niemanden kenne der mir helfen könnte, musste ich wohl oder übel selbst vorarbeiten.
Das Problem: Die SWEP wird nicht im Spawn-Menu, oder auch Q-Menu genannt, angezeigt.

Da ich denke das ich die Dateien schicken muss, gebe ich sie hier zum Download:

http://rapidshare.com/files/289461140/SWEP.zip.html

Joker
06.10.2009, 17:44
Lies' dir das (http://wiki.garrysmod.com/?title=Category:Lua:Articles:Scripted_Weapons), die Weapon-Hooks und die Weapons-Funktionen im GMod-LUA-Wiki (http://wiki.garrysmod.com/?title=Lua) durch.
Bitte poste den Script direkt, mit PHP-Tags eingebunden, hierher. Ich habe keine Lust, mich wieder mit dem Rapidshare-Freeuserismus herumplagen zu müssen.
Übrigens gehört dieser Thread in den LUA-Bereich.

Loadup[GER]
06.10.2009, 17:49
Hm, ich konnte mich nicht entscheiden, da ich dachte das es eventuell am Addon format liegen könnte.

ok hier die init.lua:

AddCSLuaFile ("cl_init.lua")
AddCSLuaFile ("shared.lua")

include ("shared.lua")

SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false


cl_init.lua:

include('shared.lua')

SWEP.PrintName = "TS Gyurza"
SWEP.Slot = 1
SWEP.SlotPos = 1
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false


shared.lua:

// Show debug info?
local debug = true

//----------------------------------------------
//Author Info
//----------------------------------------------
SWEP.Author = "--- Loadup[GER] ---"
SWEP.Contact = "--- [email protected] ---"
SWEP.Purpose = "--- It's just a realistic-test-SWEP ---"
SWEP.Instructions = "--- just shoot man. ---"
//----------------------------------------------

SWEP.Spawnable = true
SWEP.AdminSpawnable = true
// First person Model
SWEP.ViewModel = "models/weapons/v_Gyurza.mdl"
// Third Person Model
SWEP.WorldModel = "models/weapons/w_Gyurza.mdl"
// Weapon Details
SWEP.Primary.Clipsize = 210
SWEP.Primary.DefaultClip = 31
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "pistol"
SWEP.Secondary.Clipsize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Category = "Favorite SWEP's"
// Sound
SWEP.Sound = Sound ("weapon_357.Single")
SWEP.Damage = 50
SWEP.Spread = 0.02
SWEP.NumBul = 1
SWEP.Force = 3


//--------------------------------------------
// Called when it reloads
//--------------------------------------------
function SWEP:Reload()
if debug then
print("Reload")
// Shove your debugging code in here
end
self.Weapon:DefaultReload( ACT_VM_RELOAD ) //animation for reloading
end


//--------------------------------------------
// Called each frame when the Swep is active
//--------------------------------------------
function SWEP:Think()

end


//--------------------------------------------
// Called when the player Shoots
//--------------------------------------------
function SWEP:PrimaryAttack()
if debug then
print("Primary Attack")
// Put Your debugging Code in here
end

// Any Code you want to be executed when the player uses primary attack goes in here
self.Weapon:EmitSound(ShootSound)
end


//--------------------------------------------
// Called when the player Uses secondary attack
//--------------------------------------------
function SWEP:SecondaryAttack()
if debug then
print("Secondary Attack")
// Put your debugging code in here
end

// Any Code you want to my executed when the player uses secondary attack goes in here
self.Weapon:EmitSound(ShootSound)
end

Kapulta
06.10.2009, 17:52
So sieht eine Addoninfo aus:
"AddonInfo"
{
"name" "Rifle Sweps"
"version" "V1"
"up_date" "4th Oktober 2009"
"author_name" "Kodiak"
"author_email" ""
"author_url" ""
"info" ""
"override" "0"
}

Wenn du noch fragen hast, ich hab dich mal in Steam geaddet

Loadup[GER]
06.10.2009, 17:54
achso ja, hier die info.txt:

"AddonInfo"
{
"name" "TS_Gyurza"
"version" "0.01"
"author_name" "Loadup[GER]"
"info" ""
"override" "0"
}

//EDIT:
angenommen, ich denke der tread ist nun sinnlos :)

//EDIT:
ok bitte closen, hat sich erledigt ^^