Wysłany: 2016-01-29, 13:41
mlodasnygo
Wiek: 16 Na forum: 3973 dni Posty: 205
Piwa : 518
Cze??, witajcie. Mam problem z skryptem kt?ry odpowiada za szukanie gracza..
Wywala DB3:
Kod:
ERROR: Loading script failed: findPlayer/utils.lua:3: ')' expected near '='
I nie mog? sobie z nim poradzi?... Pr?bowa?em na r??ne sposoby, ale ni lampki i monitora nie mog? zrobi?.
Kod:
function findPlayer ( plr , cel )
local target = nil
if ( tonumber ( cel ) = nil ) then
target = getElementByID ( "p" .. cel )
else -- podano fragment nicku
for _ , thePlayer in ipairs ( getElementsByType ( "player" )) do
if string . find ( string . gsub ( getPlayerName ( thePlayer ): lower (), "#%x%x%x%x%x%x" , "" ), cel : lower (), 1 , true ) then
if ( target ) then
outputChatBox ( "Znaleziono wiecej niz jednego gracza o pasujacym nicku, podaj wiecej liter." , plr )
return nil
end
target = thePlayer
end
end
end
return target
end
Prosz? o naprowadzenie na poprawne dzia?anie, a nie dawanie gotowca.
Prosz? o pomoc,
Oczywi?cie za pomoc oraz
Pozdrawiam,
mlodasnygo
Wysłany: 2016-01-29, 14:41
Gerano
Mleko,Kakao,LUA
Wiek: 38 Na forum: 4266 dni Posty: 187
Nick w MP: Gerano
Piwa : 1460
Witaj zobacz to powinno teraz dzia?ac.
function findPlayer ( plr , cel )
local target = nil
if ( tonumber ( cel ) ~= nil then
target = getElementByID ( "p" .. cel )
else -- podano fragment nicku
for _ , thePlayer in ipairs ( getElementsByType ( "player" )) do
if string . find ( string . gsub ( getPlayerName ( thePlayer ): lower (), "#%x%x%x%x%x%x" , "" ), cel : lower (), 1 , true ) then
if ( target ) then
outputChatBox ( "Znaleziono wiecej niz jednego gracza o pasujacym nicku, podaj wiecej liter." , plr )
return nil
end
target = thePlayer
end
end
end
return target
end
Podpis
BUDOWA SERWERA: XXX
Prace: XXX%
Tagi: niedziałająca :: funkcja :: findplayer
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: