Hey Leute ,
seid ein paar tagen quält mich dieser Bug.
Es geht um das Gangwar System.
Man kann niemanden Attacken.
Es kommt dieser Error :
[2013-08-27 20:08:20] WARNING: [vio]/vio/fraktionen/gangareas.lua:242: Bad argument @ 'getElementPosition' [Expected element at argument 1, got nil]
[2013-08-27 20:08:20] WARNING: [vio]/vio/fraktionen/gangareas.lua:243: Bad argument @ 'getDistanceBetweenPoints3D'
[2013-08-27 20:08:20] ERROR: [vio]/vio/fraktionen/gangareas.lua:243: attempt to compare boolean with number
hier das gangwar script( habe es jetzt nur die attack func reingeschrieben weil es sonst zu lang wäre ):
Spoiler anzeigen
Lua
function attack_func ( player )
if validGangs[vioGetElementData ( player, "fraktion" )] and vioGetElementData ( player, "rang" ) >= 3 then
local x1, y1, z1 = getElementPosition ( player )
sucess = false
validID = nil
for i = 1, gangCount do
local x2, y2, z2 = getElementPosition ( _G["gangPickup"..i] )
if getDistanceBetweenPoints3D ( x1, y1, z1, x2, y2, z2 ) <= 3 then
validID = i
sucess = true
break
end
end
if sucess then
local pickup = _G["gangPickup"..validID]
local owner = tonumber ( vioGetElementData ( pickup, "gang" ) )
if owner ~= vioGetElementData ( player, "fraktion" ) then
if getFactionMembersOnline ( owner ) >= 3 then
if not gangAreaUnderAttack then
local lastAttacked = tonumber ( MySQL_GetString("gangs", "LastAttacked", "Nummer LIKE '" ..tonumber(validID).."'") )
local time = getRealTime()
if time.timestamp > lastAttacked then
startGangAreaAttack ( player, pickup, owner, validID )
end
else
outputChatBox ( "Es kann immer nur ein Angriff zur selben Zeit stattfinden!", player, 125, 0, 0 )
end
else
outputChatBox ( "Es muessen mindestens 3 Mitglieder der verteidigenden Gang online sein!", player, 125, 0, 0 )
end
else
outputChatBox ( "Du kannst nicht dein eigenes Gebiet angreifen!", player, 125, 0, 0 )
end
else
outputChatBox ( "Du bist bei keinem Ganggebiet!", player, 125, 0, 0 )
end
else
outputChatBox ( "Du bist nicht befugt!", player, 125, 0, 0 )
end
end
addCommandHandler ( "attack", attack_func )
Alles anzeigen
Hoffe mir kann endlich jemand helfen