Steam 설치
로그인
|
언어
简体中文(중국어 간체)
繁體中文(중국어 번체)
日本語(일본어)
ไทย(태국어)
Български(불가리아어)
Čeština(체코어)
Dansk(덴마크어)
Deutsch(독일어)
English(영어)
Español - España(스페인어 - 스페인)
Español - Latinoamérica(스페인어 - 중남미)
Ελληνικά(그리스어)
Français(프랑스어)
Italiano(이탈리아어)
Bahasa Indonesia(인도네시아어)
Magyar(헝가리어)
Nederlands(네덜란드어)
Norsk(노르웨이어)
Polski(폴란드어)
Português(포르투갈어 - 포르투갈)
Português - Brasil(포르투갈어 - 브라질)
Română(루마니아어)
Русский(러시아어)
Suomi(핀란드어)
Svenska(스웨덴어)
Türkçe(튀르키예어)
Tiếng Việt(베트남어)
Українська(우크라이나어)
번역 관련 문제 보고
ENT.WeaponUsed= "cw_ar15" -- name of the swep that the case is for
^ this variable already lets us know what weapon class it is, so you can just get it's data by doing:
local wepData = weapons.GetStored(self.WeaponUsed)
and then assign SwepName, AmmoUsed and AmmoAmountToGive like this:
self.SwepName = wepData.PrintName
self.AmmoUsed = wepData.Primary.Ammo
self.AmmoAmountToGive = wepData.Primary.ClipSize
you'd need to put this in a shared ENT:Initialize hook, the entire code snippet (which is pseudo-code, but it should work) would look like this:
ENT:Initialize()
-- do stuff that your cases do
local wepData = weapons.GetStored(self.WeaponUsed)
self.SwepName = wepData.PrintName
self.AmmoUsed = wepData.Primary.Ammo
self.AmmoAmountToGive = wepData.Primary.ClipSize
end
and bam, now you only have to enter 1 variable (instead of 4), and the rest would be handled for you
this way you'll reduce the amount of code needed to enter to just 1 variable, and it also means that if there are changes to the weapon code at any time in the base CW 2.0 pack or elsewhere (ie. weapon name change, mag size change, caliber change, etc.) you don't have to change anything at all in your case code
This is perfect, thank you just, I will defenitly use this. I am still new to lua so I will accept all advice given, even to a professional such as yourself.
The new code is already implemented, go nuts.
i ask permission to upload this for use as an pseudo-shipment of sorts.