Szerző Téma: Frakció ,szerelő  (Megtekintve 992 alkalommal)

Frakció ,szerelő
« Dátum: 2016. Augusztus 25. - 22:19:04 »
0 Show voters
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

Frakció ,szerelő
« Válasz #1 Dátum: 2016. Augusztus 26. - 08:17:10 »
0 Show voters
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

Frakció ,szerelő
« Válasz #2 Dátum: 2016. Augusztus 26. - 13:08:39 »
0 Show voters
Úgysem akar menni. :D

Frakció ,szerelő
« Válasz #3 Dátum: 2016. Augusztus 29. - 16:02:20 »
0 Show voters
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.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal