Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: findplayer
1. funkcja findPlayer
Dobry Wiecz?r znuf
Mam tu taki system BW
Kod:

addEvent("spawnPlayer",true)
addEventHandler("spawnPlayer",root,function()
local x,y,z=getElementPosition(source)
local skin=getElementModel(source)
local n,a,rot=getElementRotation(source)
spawnPlayer(source,x,y,z,rot,skin,getElementInterior(source),getElementDimension(source),getPlayerTeam(source))
end)

function unbw(plr,cmd,t)
if getElementData(plr,"player:admin") then
if not t then outputChatBox("Uzyj /unbw (id/nick)",plr,255,0,0,false) return end
local target=exports['ogrpg-core']:findPlayer(plr,t)
if not target then outputChatBox("Nie znaleziono gracza",plr,255,0,0,false) return end
triggerClientEvent(target,"removeBW",resourceRoot)
triggerEvent("spawnPlayer",target)
end
end
addCommandHandler("unbw",unbw)

Kt?rego chce przerobi? pod ACL < To umiem
Ale nie wiem co zrobi? z ogrpg gdy? nie ogarniam, a po tym jest funkcja szukaj gracza
Za ch?ci pifko i respekt ;)
2. Niedziałająca funkcja findPlayer
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) = nilthen
        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(), 1truethen
                
if (targetthen
                    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 :arrow: :piwo: oraz R* :)

Pozdrawiam,
mlodasnygo :)