Nabend,
ich habe mal wieder ein Problem. Ich hab ein Wettersystem gescriptet, die Meldungen kommen auch, aber es ändert sich einfach kein Wetter.
Kann mir bitte jemand helfen?
Lua
function dynamicweather()
local variable = math.random(0,18)
if variable == 8 then
variable = 18
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es kommt eine leichte Hitze nach San Andreas", playeritem, 200, 200, 0)
end
end
end
if variable == 1 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird leicht bewölkt!", playeritem, 200, 200, 0)
end
end
end
if variable == 2 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird leicht bewölkt!", playeritem, 200, 200, 0)
end
end
end
if variable == 3 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird leicht bewölkt!", playeritem, 200, 200, 0)
end
end
end
if variable == 4 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird leicht bewölkt!", playeritem, 200, 200, 0)
end
end
end
if variable == 5 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird leicht bewölkt!", playeritem, 200, 200, 0)
end
end
end
if variable == 6 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird leicht bewölkt!", playeritem, 200, 200, 0)
end
end
end
if variable == 7 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird leicht bewölkt!", playeritem, 200, 200, 0)
end
end
end
if variable == 9 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird neblig und bewölkt!", playeritem, 200, 200, 0)
end
end
end
if variable == 10 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird schönes Wetter in San Andreas", playeritem, 200, 200, 0)
end
end
end
if variable == 11 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es kommt eine große Hitzewelle!", playeritem, 200, 200, 0)
end
end
end
if variable == 12 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird grau und trist!", playeritem, 200, 200, 0)
end
end
end
if variable == 13 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird grau und trist!", playeritem, 200, 200, 0)
end
end
end
if variable == 14 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird grau und trist!", playeritem, 200, 200, 0)
end
end
end
if variable == 15 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es wird grau und trist!", playeritem, 200, 200, 0)
end
end
end
if variable == 16 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es kommt wird bewölkt und Regen kommt dazu!", playeritem, 200, 200, 0)
end
end
end
if variable == 17 then
for id, playeritem in ipairs(getElementsByType("player")) do
if tonumber(getElementData ( playeritem, "Fraktion" )) == 3 then
outputChatBox("Es kommt eine leichte Hitze nach San Andreas", playeritem, 200, 200, 0)
end
end
end
setWeatherBlended ( variable )
setTimer( dynamicweather, math.random( 180000, 720000 ), 1 )
end
setTimer( dynamicweather, 3000, 1 )
Alles anzeigen