赤 table 为 string.find
Chek table for string.find
如何检查 table 是否为 string.find?
我的代码:
WEAPON_TABLE = { -- I need check this weaponclass of sweps
"swep_1",
"swep_2",
"swep_3"
}
if string.find(v:GetWeaponClass(), ???) then
--
end
试试这个:
WEAPON_TABLE = {
["swep_1"]=true,
["swep_2"]=true,
["swep_3"]=true,
}
if WEAPON_TABLE[v:GetWeaponClass()] then
如何检查 table 是否为 string.find?
我的代码:
WEAPON_TABLE = { -- I need check this weaponclass of sweps
"swep_1",
"swep_2",
"swep_3"
}
if string.find(v:GetWeaponClass(), ???) then
--
end
试试这个:
WEAPON_TABLE = {
["swep_1"]=true,
["swep_2"]=true,
["swep_3"]=true,
}
if WEAPON_TABLE[v:GetWeaponClass()] then