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