Guten Abend zusammen,
ich habe einige Fehler auf meinem Server, welcher auf dem Vio-Extended Script basiert, welche ich aber nicht gefixt bekomme.
Vielleicht habt ihr ja einige Tipps für mich, oder wisst sogar die Lösungen, weil ihr selber diese Fehler hattet:
1) ERROR: vio\social\social_client.lua:211: attempt to call global 'vioGetElementData' (a nil value)
social_client.lua -> Funktion -> Zeile ROT markiert
function getPlayerSocialAvailableStates ()
local spielzeit = getElementData ( lp, "playingtime" )
local totalMoney = getElementData ( lp, "money" ) + getElementData ( lp, "bankmoney" )
availableSocialStates = nil
availableSocialStates = {}
reachableSocialStates = nil
reachableSocialStates = {}
for i = 1, socialStateCount do
reachableSocialStates = false
availableSocialStates[i] = false
end
-- **Gruppe 1 - Anfaengerraenge ** --
if malehomeless [ getElementModel ( lp ) ] or femalehomeless [ getElementModel ( lp ) ] then
-- Obdachloser
availableSocialStates[1] = true
reachableSocialStates[2] = true
elseif spielzeit >= 300 and getElementData ( lp, "curcars" ) >= 1 and getElementData ( lp, "job" ) ~= "none" then
-- Arbeiter
availableSocialStates[5] = true
reachableSocialStates[6] = true
reachableSocialStates[8] = true
reachableSocialStates[10] = true
reachableSocialStates[11] = true
reachableSocialStates[15] = true
elseif spielzeit >= 180 and getElementData ( lp, "spawnpos_y" ) ~= -2458.288085 then
-- Buerger
availableSocialStates[4] = true
reachableSocialStates[5] = true
elseif spielzeit >= 45 and getElementData ( lp, "perso" ) == 1 then
-- Immigrant
availableSocialStates[3] = true
reachableSocialStates[4] = true
else
-- Illegaler Immigrant
availableSocialStates[2] = true
reachableSocialStates[3] = true
end
-- **Gruppe 2 - Fraktionsbasiert** --
if getElementData ( lp, "fraktion" ) >= 1 then
if getElementData ( lp, "rang" ) >= 4 and spielzeit >= 15000 then
-- Faedenzieher --
availableSocialStates[14] = true
elseif getElementData ( lp, "rang" ) >= 2 and spielzeit >= 4500 then
-- Aufsteiger --
availableSocialStates[7] = true
reachableSocialStates[14] = true
elseif spielzeit >= 1200 then
-- Neuling --
availableSocialStates[6] = true
reachableSocialStates[7] = true
else
reachableSocialStates[6] = true
end
end
-- **Gruppe 3 - Jobbasiert** --
if getElementData ( lp, "job" ) == "dealer" then
-- Dealer --
availableSocialStates[8] = true
end
-- **Gruppe 4 - Achievmentbasiert** --
if getElementData ( lp, "gunloads" ) == "done" then
availableSocialStates[9] = true
end
if getElementData ( lp, "totalHorseShoes" ) == 25 then
availableSocialStates[23] = true
end
if getElementData ( lp, "chickendinner_achiev" ) == 1 and getElementData ( lp, "nichtsgehtmehr_achiev" ) == 1 then
availableSocialStates[24] = true
end
if getElementData ( lp, "job" ) == "none" then
if getElementData ( lp, "fraktion" ) == 0 then
if getElementData ( lp, "playingtime" ) >= 45000 then
availableSocialStates[19] = true
end
end
else
reachableSocialStates[19] = true
end
-- **Gruppe 5 - Geldbasiert** --
if totalMoney >= 3000000 then
availableSocialStates[13] = true
elseif totalMoney >= 1000000 then
availableSocialStates[12] = true
reachableSocialStates[13] = true
elseif totalMoney >= 500000 then
availableSocialStates[11] = true
reachableSocialStates[12] = true
else
reachableSocialStates[11] = true
end
-- **Gruppe 6 - Besitzbasiert** --
if spielzeit >= 30000 and getElementData ( lp, "housekey" ) > 0 and getElementData ( lp, "collectr_achiev" ) == "done" and getElementData ( lp, "yachtImBesitz" ) then
availableSocialStates[18] = true
elseif spielzeit >= 30000 and getElementData ( lp, "housekey" ) > 0 and getElementData ( lp, "yachtImBesitz" ) then
availableSocialStates[17] = true
reachableSocialStates[18] = true
elseif spielzeit >= 30000 and totalMoney >= 500000 and getElementData ( lp, "bizkey" ) >= 1 then
availableSocialStates[16] = true
reachableSocialStates[17] = true
elseif getElementData ( lp, "bizkey" ) >= 1 then
availableSocialStates[15] = true
reachableSocialStates[16] = true
elseif getElementData ( lp, "housekey" ) > 0 then
availableSocialStates[10] = true
reachableSocialStates[15] = true
else
reachableSocialStates[10] = true
end
-- **Gruppe 7 - Suchtbasiert** --
if vioGetElementData ( player, "drugAddictPoints" ) and vioGetElementData ( player, "alcoholAddictPoints" ) and vioGetElementData ( player, "cigarettAddictPoints" ) then
if math.floor ( vioGetElementData ( player, "cigarettAddictPoints" ) / addictLevelDivisors[1] ) >= 3 then
availableSocialStates[20] = true
elseif math.floor ( vioGetElementData ( player, "alcoholAddictPoints" ) / addictLevelDivisors[2] ) >= 3 then
availableSocialStates[21] = true
elseif math.floor ( vioGetElementData ( player, "drugAddictPoints" ) / addictLevelDivisors[3] ) >= 3 then
availableSocialStates[22] = true
end
end
-- **Gruppe 8 - Hobbybasiert** --
if vioGetElementData ( player, "club" ) == "rc" then
availableSocialStates[26] = true
elseif vioGetElementData ( player, "club" ) == "gartenverein" then
availableSocialStates[25] = true
end
return nil
end
2) ERROR: vio\client\nametag_client.lua:153: attempt to call global 'vioGetElementData' (a nil value)
nametag_client.lua -> Funktion -> Zeile ROT markiert
nametag_client.lua -> Funktion -> Zeile ROT markiert
function calcRGBByHP ( player )
local hp = getElementHealth ( player )
local armor = getPedArmor ( player )
if vioGetElementData(player, "suppmode") == false then
if hp <= 0 then
return 0, 0, 0
else
if armor > 0 then
armor = math.abs ( armor - 0.01 )
return (2.55* armor), 255, (2.55* armor)
else
hp = math.abs ( hp - 0.01 )
return ( 100 - hp ) * 2.55 / 2, ( hp * 2.55 ), 0
end
end
else
return 255, 0, 0 end
end
3) WARNING: vio\clothes\clothes_client.lua:27: Bad argument @ 'guiSetVisible' [Expected gui-element at argument 1, got nil]
clothes_client.lua -> Funktion -> Zeile ROT markiert
clothes_client.lua -> Funktion -> Zeile ROT markiert
function skinshow ()
if guiSetVisible ( SkinauswahlWindow ) == true then
local rowindex, columnindex = guiGridListGetSelectedItem ( SkinauswahlGrid )
local selectedText = guiGridListGetItemText ( SkinauswahlGrid, rowindex, skinnameColumn )
local selectedPrice = guiGridListGetItemText ( SkinauswahlGrid, rowindex, skinpreisColumn )
if selectedText == false or selectedPrice == false then
else
for i = 1, 288 do
if skinname[i] == selectedText then
if tostring ( skinpreis[i].." $" ) == selectedPrice then
setElementModel ( lp, i )
curskinPrice = skinpreis[i]
curskinID = i
end
end
end
end
end
end
Bezüglich der "[i]vioGetElementData"-Fehler habe ich hier noch die core/data.lua, in welcher die Funktion definiert wird:
data.lua
elementData = {}
function vioSetElementData ( player, dataString, value )
if player and dataString and value ~= nil then
if not elementData[player] then
elementData[player] = {}
end
elementData[player][dataString] = value
setElementData ( player, dataString, value )
else
return nil
end
end
function vioGetElementData ( player, dataString )
if player and dataString then
if not elementData[player] then
elementData[player] = {}
return nil
end
if elementData[player][dataString] then
return elementData[player][dataString]
elseif not elementData[player][dataString] and dataString ~= "adminlvl" and dataString ~= "loggedin" then
elementData[player][dataString] = getElementData ( player, dataString )
return elementData[player][dataString]
end
else
return nil
end
end
function freeElementData ()
if elementData then
if getElementType ( source ) ~= "player" then
if elementData[source] then
elementData[source] = nil
end
end
end
end
addEventHandler ( "onElementDestroy", getRootElement(), freeElementData )
function findPlayerByName( playerPart )
if playerPart then
local pl = getPlayerFromName( playerPart )
if isElement(pl) then
return pl
else
for i,v in ipairs (getElementsByType ("player")) do
if (string.find(string.gsub ( string.lower(getPlayerName(v)), '#%x%x%x%x%x%x', '' ),string.lower(playerPart))) then
return v
end
end
end
end
end
Vielleicht kann @[Rise]Bonus helfen?
Schonmal vorab vielen Dank!
MfG,
ViperAC