ZaraZoo.
Wiek: 25 Na forum: 2637 dni Posty: 1
Nick w MP: Zarazoo
Problem polega na tym, ?e pr?buj?c usun?? Equipped w paczce Tekkena, w pewien spos?b mi si? to uda?o. Jednak?e wyskakuje taki b??d:
Kod: WARNING: dayz/core.lua:459: Bad argument @ 'takeWeapon' [Expected weapon-type at argument 2, got boolean]
Plik:
Kod: addEventHandler("removeBackWeaponOnDrop", root, function(check, slot)
if (slot == 1) then
removeWeaponBack(source);
removeWeaponReplace(source);
elseif (slot == 2) then
removeWeaponBack2(source);
end
if check then
local weapon = getElementData(source, "currentweapon_"..tostring(slot));
local _,id,_ = getWeaponAmmoType(weapon);
takeWeapon(source, id);
if (slot == 3) then
takeWeapon(client, id);
local weapon = getElementData(client, "currentweapon_3");
if weapon then
setElementData(client, weapon.." (Equipped)", getElementData(client, weapon.." (Equipped)") - 1);
setElementData(client, "currentweapon_3", "");
end
end
setElementData(source, "currentweapon_"..tostring(slot), "");
triggerClientEvent(source, "refreshInventoryManual", source);
end
end);
Co podejrzewam o z?e dzia?anie?
Kod: addEventHandler("onPlayerMoveItemOutOFInventory", root, function(itemName, loot)
local itemPlus = getItemPlus(itemName)
if itemPlus == 1 and itemName then
triggerServerEvent("removeBackWeaponOnDrop", localPlayer, true, getEquippedWeaponSlot(itemName));
end
[ Dodano : 2019-03-16, 19:39 ]
+ Dodam ?e tak wygl?da "OnPlayerUnequipWeapon"
Kod: addEventHandler("onPlayerUnequipWeapon", root, function(eweapon, slot)
local weap = getElementData(source, "currentweapon_"..tostring(slot));
local name,id,model = getWeaponAmmoType(weap);
takeWeapon(source, id);
if (slot < 3) then
setElementData(source, weap, getElementData(source, weap) + 0);
setElementData(source, eweapon, getElementData(source, eweapon) - 0);
setElementData(source, "currentweapon_"..tostring(slot), "");
if (slot == 1) then
removeWeaponBack(source);
removeWeaponReplace(source);
else
removeWeaponBack2(source);
end
else
setElementData(source, weap, getElementData(source, weap.." (Equipped)"));
setElementData(source, eweapon, 0);
setElementData(source, "currentweapon_"..tostring(slot), "");
end
triggerClientEvent(source, "refreshInventoryManual", source);
end);