Szerző Téma: Unexpected symbol  (Megtekintve 907 alkalommal)

Unexpected symbol
« Dátum: 2017. Január 14. - 21:52:48 »
0 Show voters
Sziasztok kerestem neten illetve mindenhol de nem találtam konkrétan erre az errorra megoldást vagy akármit.
 
39. Sorra ami ez -->     local sourceName
 
ezt írja : unexpected symbol near \'

Unexpected symbol
« Válasz #1 Dátum: 2017. Január 14. - 22:23:48 »
0 Show voters
Másold már be az egész kódot

Unexpected symbol
« Válasz #2 Dátum: 2017. Január 15. - 09:52:55 »
0 Show voters

function runString (commandstring, outputTo, source)
    local sourceName \'
    if source then
        sourceName = getPlayerName(source)
    else
        sourceName = \"Console\"
    end
    function getLocalPlayer( )
        return source
    end
    _G[\'source\'] = source
    if getElementType(source) == \'player\' then
        vehicle = getPedOccupiedVehicle(source) or getPedContactElement(source)
        car = vehicle
    end
    local notReturned
    local commandFunction,errorMsg = loadstring(\"return \"..commandstring)
    if errorMsg then
        notReturned = true
        commandFunction, errorMsg = loadstring(commandstring)
    end
    if errorMsg then
        outputChatBox(\"Hiba: \"..errorMsg, outputTo)
        return
    end
    results = { pcall(commandFunction) }
    if not results[1] then
        outputChatBox(\"Hiba: \"..results[2], outputTo)
        return
    end
    if not notReturned then
        local resultsString = \"\"
        local first = true
        for i = 2, #results do
            if first then
                first = false
            else
                resultsString = resultsString..\", \"
            end
            local resultType = type(results[i])
            if isElement(results[i]) then
                resultType = \"element:\"..getElementType(results[i])
            end
            resultsString = resultsString..tostring(results[i])..\" [\"..resultType..\"]\"
        end
        outputChatBox(\"Eredmény: \"..resultsString, outputTo)
    elseif not errorMsg then
        outputChatBox(\"Parancs lefuttatva!\", outputTo)
    end
end

 
 

Unexpected symbol
« Válasz #3 Dátum: 2017. Január 15. - 10:00:49 »
0 Show voters
a local sourceName után nem kell a \' jel

Unexpected symbol
« Válasz #4 Dátum: 2017. Január 15. - 10:04:45 »
0 Show voters
azt már én írtam oda hogy hátha kell oda, anélkül is ezt írja

Unexpected symbol
« Válasz #5 Dátum: 2017. Január 15. - 11:28:15 »
0 Show voters
local sourceName = \"\"
 
vagy local sourceName = false
 
Nem adtál meg neki semmit

Unexpected symbol
« Válasz #6 Dátum: 2017. Január 15. - 11:28:55 »
0 Show voters
megoldva, kitöröltem ezt a cuccot és jó

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal