Skrypt jako tako dzia?a lecz widz? go tylko osoby kt?re napisz? og?oszenie, czy jest kto? wstanie podpowiedzie? w jaki spos?b to zrobi? aby te og?oszenie widzia? ka?da osoba obecna na serwerze>?
Witam, ostatnio z nud?w postawi?em sobie serwer na GM XyzzyRP i chcia?em pod??czy? panel administracji, tylko problem polega na tym ?e nie do ko?ca wiem jak to zrobi?. Pod??czy?em go tak jak w instrukcji, czyli w pliku init.php poda?em dane do bazy danych. Lecz po uruchomieniu strony pojawia si? b??d o tre?ci.
Czy kto? wie jak rozwi?za? m?j problem?
Z g?ry przepraszam je?li temat umie?ci?em w z?ym dziale.
Witajcie chc? zrobi? system administracji lecz nie wiem jak za to si? zabra? w sensie jakie funkcje etc. Chc? to zrobi? za pomoc? elementdat oraz p?tel
Witam nie dzia?a mi system administracji.Brak b??du w db3
[lua]
function Pomocnik(plr,ranga)
local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), Pomocnik)
if result and #result > 0 then
return true
else
return false
end
end
function Administrator(plr,ranga)
local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), Administrator)
if result and #result > 0 then
return true
else
return false
end
end
function HeadAdministrator(plr,ranga)
local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), HeadAdministrator)
if result and #result > 0 then
return true
else
return false
end
end
function AdministratorRcon(plr,ranga)
local result = exports.mysql:wykonaj("SELECT * from administracja WHERE sid=? AND nick=? AND serial=? AND ranga=?",sid, getPlayerName(plr),getPlayerSerial(plr), AdministratorRcon)
if result and #result > 0 then
return true
else
return false
end
end
function loadPlayerData (plr)
if Pomocnik(plr) or Administrator(plr) or HeadAdministrator(plr) or AdministratorRcon(plr) then
if not getElementData(plr,"ek...
Jak ten kod przerobi? aby si? gracze wy?wietlali od razu, a nie po ok. 10 minutach? Gdy restartuje skrypt to tak oko?o 10 minut musi min?? aby si? wy?wietli?y tam nicki graczy.
[lua]local admins = ""
function processAdminList()
players = getElementsByType ( "player" )
admins = ""
for k,v in ipairs(players) do
local accountname = ""
if (isGuestAccount(getPlayerAccount(v)) == false) then
accountname = getAccountName (getPlayerAccount(v))
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "" ) ) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "" ) ) then
if (admins == "") then
admins = getPlayerName(v)
else
admins = admins .. ", " .. getPlayerName(v)
end
end
end
end
end