GTA Közösség - A magyar GTA fórum

Multi Theft Auto (MTA) => MTA: Szerverfejlesztés => Segítségkérés => A témát indította: jeae1220 - 2016. Augusztus 25. - 22:19:04

Cím: Frakció ,szerelő
Írta: jeae1220 - 2016. Augusztus 25. - 22:19:04
Sziasztok.
Nos  a script müködik, és él is ha kiveszem belőle azt a részét, ami a frakcióhoz köti.
De ha kiveszem, semmi...
Nem reagál a parancsra.
A script.
 
function onFix()
--if (getElementData(localPlayer, \"char.faction\") == 3) then 
if tonumber(getPlayerFactionType(p)) == 3 then
if #args < 2 then
   if inMechanicPoint then
      local targetVehicle = getNearVehicle()
      if (targetVehicle) then
         if not getElementData(targetVehicle, \"inFix\") then
            if fixProgress then
            outputChatBox(\"Egy alkatrész éppen javítás alatt áll!\")
            else
               setElementData(targetVehicle, \"inFix\", true)
               damageComponents = {}
               getVehicleDamagedComponent(targetVehicle)
               showFix = true
               activeVehicle = targetVehicle
            end
         else
            outputChatBox(\"Éppen szerelik ezt az autót!\")
         end
      else
         outputChatBox(\"Nincs a közeledben jármű!\")
      end
   else
      outputChatBox(\"Csak a szerelőtelepen javíthatsz!\")
   end
end
end
end
addCommandHandler(\"fix\", onFix)

 
Itt consolba azt írja: attempt to call global \'getPlayerFactionType\'(a nill value)
Persze ha a a fenti van.
Ha a  a következő van:



function onFix()
if (getElementData(localPlayer, \"char.faction\") == 3) then
   if inMechanicPoint then
      local targetVehicle = getNearVehicle()
      if (targetVehicle) then
         if not getElementData(targetVehicle, \"inFix\") then
            if fixProgress then
               outputChatBox(\"Egy alkatrész éppen javítás alatt áll!\")
            else
               setElementData(targetVehicle, \"inFix\", true)
               damageComponents = {}
               getVehicleDamagedComponent(targetVehicle)
               showFix = true
               activeVehicle = targetVehicle
            end
         else
            outputChatBox(\"Éppen szerelik ezt az autót!\")
         end
      else
         outputChatBox(\"Nincs a közeledben jármű!\")
      end
   else
      outputChatBox(\"Csak a szerelőtelepen javíthatsz!\")
   end
end
end
addCommandHandler(\"fix\", onFix)
 
Akkor erre hibát ír:
 
function isSoundFinished(theSound)
    if (getSoundPosition(theSound) == getSoundLength(theSound)) then
return true
else
return false <---
end
end

 
Miért írja ezt? Viszont ha nincs ott egyik frakcióhoz kötő részlet, akkor természetesen tökéletesen megy. O.o
Cím: Frakció ,szerelő
Írta: Hasirama - 2016. Augusztus 26. - 08:17:10
if tonumber(getPlayerFactionType(p)) == 3 then
Elvileg az a gondja, hogy nincs meghatározva a \"p\"
function onFix(p) - Írd át erre
Elnézést, ha hülyeséget írtam
Cím: Frakció ,szerelő
Írta: jeae1220 - 2016. Augusztus 26. - 13:08:39
Úgysem akar menni. :D
Cím: Frakció ,szerelő
Írta: marknoe - 2016. Augusztus 29. - 16:02:20
Szia! Csütörtökön el tudok neked küldeni igazából egy teljesen másik scriptet. ha akarod átirogatod, de fix, hogy megy, mivel a házi szerveremen próbáltam másik emberrel.