Gerne hier ist einmal der .lua Code:
Code
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 ) >= 1 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 Mitglied 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
und hier ist die Tabelle der 'gangs':
Tabelle der Gangs und Aufbau der Spalte Des Aufbaus der Spalte "Gangs".
Ich hoffe du kannst mir dabei helfen @Bonus Denn ich weiss sonst nicht mehr was ich sonst machen sollte.
Ich habe dort schon alles gemacht was ich als möglich hielt.
MFG
Robin