Ich sehe hier ein kleines Problem mit der benennung deiner Variablen
local map = crossMaps[rn] -- map ist ein Text
outputChatBox("map: "..map)
for playerKey2, playerValue2 in ipairs ( players2 ) do
local x,y,z,rx,ry,rz = map[playerKey2][1],map[playerKey2][2],map[playerKey2][3],map[playerKey2][4],map[playerKey2][5],map[playerKey2][6] -- du behandelst einen Text wie eine Tabelle
Weiss nicht wie deine Tabelle "map" aussieht, also schätze ich jetzt einfach mal
crossMaps = {
[1]="derby1",
[2]="atmosfera",
[3]="blacksabbath",
[4]="crossly",
[5]="crossmey",
[6]="crossmonde",
[7]="crosss",
[8]="crosst",
[9]="crossxl",
[10]="crossxl-b",
[11]="crosszl",
[12]="crosszy",
[13]="dynamium",
[14]="maracaibo",
[15]="maracaibozm",
}
map = {
["derby1"] = {
[1] = 2153,
[2] = 124,
[3] = 4521,
[4] = 2453,
[5] = 532,
[6] = 2153,
},
["atmosfera"] = {
[1] = 2153,
[2] = 124,
[3] = 4521,
[4] = 2453,
[5] = 532,
[6] = 2153,
},
--usw usw
}
function createStartPositionCross ()
dasTeam = getPlayerTeam(getLocalPlayer())
local players2 = getPlayersInTeam ( dasTeam )
local rn = math.random(1,3)
local dieMap = crossMaps[rn]
outputChatBox("map: "..map)
for playerKey2, playerValue2 in ipairs ( players2 ) do
-- Du moechtest glaube ich in die zufallsgenerierte Karte
local x,y,z,rx,ry,rz = map[dieMap][1],map[dieMap][2],map[dieMap][3],map[dieMap][4],map[dieMap][5],map[dieMap][6]
outputChatBox("Number "..playerKey2.. " and team "..getTeamName(dasTeam) )
outputChatBox(x.. "|"..y.."|"..z.."|"..rx.."|"..ry.."|"..rz)
triggerServerEvent("createVehicle",playerValue2,x,y,z,rx,ry,rz)
playerlist(getPlayerName(playerValue2),playerKey2)
end
end
Alles anzeigen
Habs jedoch nicht getestet