Hallo,
ich benötige Hilfe bei meinem Script. Es handelt sich um ein Team-Modus Script. Die Fehler sind wie folgt:
Lua
[2016-07-08 01:38:06] WARNING: aduty/server.lua:4: Bad argument @ 'getElementPosition' [Expected element at argument 1, got string 'restart']
[2016-07-08 01:38:06] WARNING: aduty/server.lua:6: Bad argument @ 'createBlip' [Expected vector3 at argument 1, got boolean]
[2016-07-08 01:38:06] WARNING: aduty/server.lua:7: Bad argument @ 'getPlayerName' [Expected element at argument 1, got string 'restart']
[2016-07-08 01:38:06] WARNING: aduty/server.lua:8: Bad argument @ 'getElementData' [Expected element at argument 1, got string 'restart']
[2016-07-08 01:38:06] ERROR: aduty/server.lua:8: attempt to compare boolean with number
Das Script:
Lua
local block = {}
function aduty (player)
x, y, z = getElementPosition ( player )
adutyb = createMarker ( 0, 0, 0, "arrow", .40, 0, 249, 224, 76 )
ablip = createBlip ( x, y, z, 0, 2, 0, 249, 224, 76, 0, 99999.0, getRootElement() )
name = getPlayerName ( player )
if getElementData(player, "getPlayerSpecialRights") < 1 then return false end
attachElements ( adutyb, player, 0, 0, 1.9 )
attachElements ( ablip, player, 0, 0, 0 )
outputChatBox( "Das Teammitglied "..name.." ist nun für alle Fragen / Vorschläge kontaktierbar!", getRootElement(), 249, 224, 76, true )
if (not block[player]) then
block[player] = 1
elseif (block[player]) == 2 then
cancelEvent()
outputChatBox( "Du bist schon im Team-Modus!", player, 255, 0, 0, true )
else
block[player] = block[player] + 1
end
end
addCommandHandler ("tmode", aduty)
addEventHandler("onPlayerCommand", root, aduty)
function offaduty (player)
attached = getAttachedElements ( player, adutyb )
name = getPlayerName (player)
if getElementData(player, "getPlayerSpecialRights") < 1 then return false end
if (attached) then
destroyElement(ablip)
destroyElement(adutyb)
outputChatBox( "Das Teammitglied "..name.." ist nun nicht mehr erreichbar!", getRootElement(), 249, 224, 76, true )
end
end
addCommandHandler ("toff", offaduty)
Alles anzeigen
Gruß, LuBe.