Hallo Gemeinde
Ich möchte jedem Team sowie UEFA, champions league einen Ball zu weisen.
Ich habe auch schon einem Code doch funktioniert nicht.
vielleicht kann mir jemand helfen
mfg und danke
--------------------------------------------------------------------------------------------------------------
--SPECIAL ADBOARD FUNCTION
--------------------------------------------------------------------------------------------------------------
--Set to true to enable, set to false to disable
specialBalltrue = true
--Set ID of special Ball
specialBallID = 1

function assignCustomBallIDs()
--------------------------------------------------------------------------------------------------------------
--PLACE CUSTOM ASSIGNMENTS BELOW HERE
--------------------------------------------------------------------------------------------------------------
assignTournamentBall(120016,23)
assignTournamentBallSnow(120016,23)
--------------------------------------------------------------------------------------------------------------
--PLACE CUSTOM ASSIGNMENTS ABOVE HERE
--------------------------------------------------------------------------------------------------------------
end

--------------------------------------------------------------------------------------------------------------

function BallUpdate(idx)
local as = gSportsRNA
local state = as:GetTable("wvState")
local ball = as:GetTable("wvBall", idx)

local wipe3d = as:GetTable("wvWipe", idx)
local stadium = as:GetTable("wvStadium", idx)

db.wipe3d[idx].leagueID = as:GetInt(wipe3d, "leagueID")
db.wipe3d[idx].leagueID = getTournamentGraphics(db.wipe3d[idx].leagueID)
db.stadium[idx].homeKitTeamID = as:GetInt(stadium, "homeKitTeamID" )
weather = as:GetInt(state, "wvAttribStadWeather" )

db.ball[idx].model = as:GetInt(ball, "ballModel")
db.ball[idx].envLighting = as:GetInt(state, "wvAttribEnvLighting")
db.ball[idx].stadLightID = as:GetInt(state, "wvAttribStadLightID")
db.ball[idx].stadiumID = as:GetInt(state, "wvAttribStadID")

--assignCustomBallIDs()
db.ball[idx].model = getBallID(db.stadium[idx].homeKitTeamID,db.ball[idx].model,db.wipe3d[idx].leagueID,idx,weather)

end

function BallAssetBind(ball)
local gr = gRenderables
local lod = 0

gr:AddCallback(ball, lod, "BallUpdate(?)")
gr:AddAsset(ball, lod, "shader", "data/fifarna/shader.big")
gr:AddAsset(ball, lod, "ballmesh", "data/sceneassets/ball/ball_${db.ball[?].model}.rx3")
gr:AddAsset(ball, lod, "balltex", "data/sceneassets/ball/ball_${db.ball[?].model}_textures.rx3")
gr:AddAsset(ball, lod, "charcmn", "data/sceneassets/charactercmn/charactercmn_${db.ball[?].envLighting}.rx3")
gr:CreateMaterialFromAttribulator(ball, lod, "ballmesh", "ball", "${AttribMaterial('ball')}" )
gr:SetTexture(ball, lod, "ballmesh", "textures", "diffuseTexture", "balltex", "ball_cm")
gr:SetTexture(ball, lod, "ballmesh", "textures", "normalMap", "balltex", "ball_nm")
gr:SetTexture(ball, lod, "ballmesh", "textures", "envDiffuseTexture", "charcmn", "envd_")
gr:SetTexture(ball, lod, "ballmesh", "textures", "envSpecTexture", "charcmn", "envs_")
gr:SetTextureFromRuntime(ball, lod, "ballmesh", "textures", "coverageMap", "covmap_${db.ball[?].stadiumID}_${db.ball[?].stadLightID}")
return ball
end


teamBalls = {}
tournamentBalls = {}

function getBallID(team,ad,tourn,idx,weatherID)

if (globalBallEnabled) then
return globalBallID
elseif ((idx == 0) and (arenaModeBall ~= -1)) then
return arenaModeBall
elseif ((weatherID == 2) and (tournamentBallsSnow[tourn] ~= nil)) then
return tournamentBallsSnow[tourn]
elseif (tournamentBalls[tourn] ~= nil) then
return tournamentBalls[tourn]
elseif ((weatherID == 2) and (teamBallsSnow[team] ~= nil)) then
return teamBallsSnow[team]
elseif (teamBalls[team] ~= nil) then
return teamBalls[team]
else
return ad
end

end

function assignTeamBall(team,ad)
teamBalls[team] = ad
end

function assignTournamentBall(tourn,ad)
tournamentBalls[tourn] = ad
end

globalBallEnabled = false
globalBallID = 1

function useGlobalBall(id)
globalBallEnabled = true
globalBallID = id
end


arenaModeBall = -1

function setArenaModeBall(id)
arenaModeBall = id
end

teamBallsSnow = {}
tournamentBallsSnow = {}

function assignTeamBallSnow(team,ad)
teamBallsSnow[team] = ad
end

function assignTournamentBallSnow(tourn,ad)
tournamentBallsSnow[tourn] = ad
end


frTourn = -1
gloTourn = nil

function useTournamentGraphicsInFriendly(id)
frTourn = id
end

function useGlobalTournamentGraphics(id)
gloTourn = id
end

function getTournamentGraphics(id)

if (gloTourn ~= nil) then
return gloTourn
end

if (id == -1) then
return frTourn
end

return id
end


assignCustomBallIDs()

--Revolution Mod 13 1.1
--Edited by scouser09