Wysłany: 2019-08-09, 15:57
DaVeCS
Mapper
Wiek: 31 Na forum: 3386 dni Posty: 193
Nick w MP: DaVe
Piwa : 59
Wysłany: 2019-11-30, 19:33
Kasoo
Wiek: 24 Na forum: 2378 dni Posty: 1
Nick w MP: Kasoo
[color=cyan][/color] Witam! Szukam osoby kt?ra mi przerobi CA?? paczk? denverMTA. Na nazw? HeronityMTA. P?ac? kontem ORIGIN z simsami i innymi grami b?d? ranga na serwerze / niczym.
Wysłany: 2020-02-21, 18:16
LoloV16
Wiek: 25 Na forum: 2933 dni Posty: 19
Nick w MP: LoloV16
Piwa : 4
Wysłany: 2020-05-27, 09:35
PirczyK
Totalnie Polski RPG
Wiek: 25 Na forum: 3047 dni Posty: 23
Nick w MP: PirczyK
Piwa : 605
Nie wiem czy ten dzia? kto? przegl?da, bo ostatni post jeszcze z lutego, ale mam skrypt na szlaban, dzia?aj?cy. Jest jeden mankament, je?eli kto? wejdzie kilka razy w marker, kt?ry odpowiada za moveobject to szlaban zaczyna i?? dalej i si? zatrzymuje w innym miejscu.
Kto? ma jaki? pomys?, jak to zablokowa?? Prosi?bym o napisanie od razu ca?ego skryptu
Kod: function onStartup ()
AMarker = createMarker( 1052.8000488281, 2059, 9.8000001907349, 'cylinder', 4.0, 0, 0, 0, 0)
szlaban = createObject ( 968, 1048.9000244141, 2063.1999511719, 10.60000038147, 0, 90, 0)
addEventHandler( "onMarkerHit", AMarker, MarkerHit )
addEventHandler( "onMarkerLeave", AMarker, MarkerLeave )
end
function MarkerHit( hitElement, matchingDimension )
moveObject ( szlaban, 2000, 1048.9000244141, 2063.1999511719, 10.60000038147, 0, -90, 0)
end
function MarkerLeave( leaveElement, matchingDimension )
setTimer(cos,3000,1)
end
function cos()
moveObject ( szlaban, 4000, 1048.9000244141, 2063.1999511719, 10.60000038147, 0, 90, 0)
end
[ Dodano : 2020-05-27, 10:47 ]
Ju? nie wa?ne, sam zdo?a?em problem. Nie by?o to takie trudne
Wystarczy?o usun?? marker, kt?ry odpowiada za moveobject i po pewnym czasie zn?w go postawi?
Wstawiam poni?ej, mo?e komu? si? przyda.
Kod: function onStartup ()
AMarker = createMarker( 1052.8000488281, 2059, 9.8000001907349, 'cylinder', 4.0, 0, 0, 0, 255)
szlaban = createObject ( 968, 1048.9000244141, 2063.1999511719, 10.60000038147, 0, 90, 0)
addEventHandler( "onMarkerHit", AMarker, MarkerHit )
addEventHandler( "onMarkerLeave", AMarker, MarkerLeave )
end
function MarkerHit( hitElement, matchingDimension )
moveObject ( szlaban, 2000, 1048.9000244141, 2063.1999511719, 10.60000038147, 0, -90, 0)
end
function MarkerLeave( leaveElement, matchingDimension )
setTimer(cos,3000,1)
destroyElement(AMarker)
end
function cos()
moveObject ( szlaban, 4000, 1048.9000244141, 2063.1999511719, 10.60000038147, 0, 90, 0)
setTimer(nowy,4100,1)
end
function nowy ()
AMarker = createMarker( 1052.8000488281, 2059, 9.8000001907349, 'cylinder', 4.0, 0, 0, 0, 255)
addEventHandler( "onMarkerHit", AMarker, MarkerHit )
addEventHandler( "onMarkerLeave", AMarker, MarkerLeave )
end
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStartup)
Wysłany: 2020-06-05, 10:18
HEATEX
Wiek: 25 Na forum: 2250 dni Posty: 109
Nick w MP: HEATEX
Piwa : 1336
Przerobi?by kto? ten skrypt na pystories zeby dziala? bo przerabia?em to lecz nie chce to dzia?ac
local zaproszenia = {}
local max_people_in_org = 55 ---- MAKSYMALNA LICZBA LUDZI W ORGANIZACJI !
function findPlayer ( plr , cel )
local target = nil
if ( tonumber ( cel ) ~= nil ) then
for _ , thePlayer in ipairs ( getElementsByType ( "player" )) do
if getElementData ( thePlayer , "player:uid" ) == tonumber ( cel ) then target = thePlayer end
end
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 (), 0 , 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
if target and getElementData ( target , "p:inv" ) then return nil end
return target
end
addEvent ( "lidero:editUser" , true )
addEventHandler ( "lidero:editUser" , resourceRoot , function( text , rank , faction )
local result1 = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ogrpg_users WHERE id=?" , text )
if not result1 or #result1 < 0 then outputChatBox("* Podany u?ytkownik nie istnieje w bazie danych.", client, 255, 0, 0) return end
local result2 = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1;" , faction , text ) -- pobieramy tylko JEDEN rekord
if not result2 or #result2 < 0 then outputChatBox("* Podany u?ytkownik nie znajduje si? w tej organizacji",client,255,0,0) return end
local ranke = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1;" , faction , getElementData ( client , "player:uid" )) -- pobieramy tylko JEDEN rekord
if not ranke or #ranke < 0 then outputChatBox("* Nie znajdujesz si? w tej organizacji!",client,255,0,0) return end
if tonumber ( ranke [ 1 ]. rank ) <= 3 and ( tonumber ( rank ) > 2 ) then outputChatBox ( "*Posiadasz za ma?? range!" , client , 255 , 0 , 0 ) return end
local query1 = exports [ "pystories-db" ]: dbSet ( "UPDATE ms_organizacje SET rank=? WHERE uid=? AND code=?" , rank , text , faction )
if query1 then
local resulted = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=?" , faction )
triggerClientEvent ( client , "lidero:refresh" , resourceRoot , resulted )
outputChatBox ( "* Pomy?lnie zmieniono rang? graczowi " .. result1 [ 1 ]. login .. " o id: " .. faction .. " na " .. rank .. " w organizacji." , client )
end
local target = findPlayer ( client , text )
if target then outputChatBox ( "* Twoja przynale?no?? w organizacji: " .. faction .. " zosta?a zaaktualizowana. Aby odej?? wpisz /opuscorg" , target ) end
end )
addEvent ( "zmienbank" , true )
addEventHandler ( "zmienbank" , resourceRoot , function( text , rank , faction )
local result1 = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_users WHERE id=?" , text )
if not result1 or #result1 < 0 then outputChatBox("* Podany u?ytkownik nie istnieje w bazie danych.", client, 255, 0, 0) return end
local result2 = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1;" , faction , text ) -- pobieramy tylko JEDEN rekord
if not result2 or #result2 < 0 then outputChatBox("* Podany u?ytkownik nie znajduje si? w tej organizacji",client,255,0,0) return end
local ranke = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1;" , faction , getElementData ( client , "player:uid" )) -- pobieramy tylko JEDEN rekord
if not ranke or #ranke < 0 then outputChatBox("* Nie znajdujesz si? w tej organizacji!",client,255,0,0) return end
if tonumber ( ranke [ 1 ]. rank ) <= 3 then outputChatBox ( "*Posiadasz za ma?? range!" , client , 255 , 0 , 0 ) return end
local query1 = exports [ "pystories-db" ]: dbSet ( "UPDATE ms_organizacje SET bank=? WHERE uid=? AND code=?" , rank , text , faction )
outputChatBox ( "#606060[Organizacja]#ffffff Dost?p do banku gracza " .. result1 [ 1 ]. login .. " zosta? zmieniony na: #ccc000" .. rank .. "" , client , 255 , 255 , 255 , true )
end )
addEvent ( "lidero:addUser" , true )
addEventHandler ( "lidero:addUser" , resourceRoot , function( text , faction )
if string . len ( text ) <= 0 then return end
local result1 = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_users WHERE id=?" , text )
if not result1 or #result1 < 0 then outputChatBox("* Podany u?ytkownik nie istnieje w bazie danych.", client, 255, 0, 0) return end
local result2 = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE uid=? and code=?" , text , faction )
if result2 and #result2 > 0 then outputChatBox("* Podany u?ytkownik ju? znajduje si? w tej organizacji.", client, 255, 0, 0) return end
local ranke = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1;" , faction , getElementData ( client , "player:uid" )) -- pobieramy tylko JEDEN rekord
if not ranke or #ranke < 0 then outputChatBox("* Nie znajdujesz si? w tej organizacji!",client,255,0,0) return end
if tonumber ( ranke [ 1 ]. rank ) < 3 then outputChatBox ( "*Posiadasz za ma?? range!" , client , 255 , 0 , 0 ) return end
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=?" , faction )
if result and #result >= max_people_in_org then outputChatBox("* Posiadasz ju? maksymaln? liczbe ludzi w organizacji.", client, 255, 0, 0) return end
local result3 = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE uid=?" , text )
if result3 and #result3 > 0 then outputChatBox("* Podany u?ytkownik ju? znajduje si? w innej organizacji.", client, 255, 0, 0) return end
local target = findPlayer ( client , text )
if target then
if zaproszenia [ target ] then outputChatBox ( "** Gracz ju? dosta? zaproszenie !" , client ) return end
if zaproszenia [ target ] and isTimer ( zaproszenia [ target ][ 3 ]) then killTimer ( zaproszenia [ target ][ 3 ]) end
zaproszenia [ target ] = { faction , client , setTimer (function() zaproszenia [ target ] = nil end , 10000 , 1 )}
outputChatBox ( "* Zosta?e?(a?) zaproszony(a) do organizacji o nazwie :" .. faction .. " !" , target , 0 , 255 , 0 )
outputChatBox ( "* Masz 10 sekund na zaakceptowanie zaproszenia! (Wpisz /akceptuj)" , target , 0 , 255 , 0 )
end
end )
addEvent ( "lidero:deleteUser" , true )
addEventHandler ( "lidero:deleteUser" , resourceRoot , function( text , faction )
local result1 = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_users WHERE id=?" , text )
if not result1 or #result1 < 0 then outputChatBox("* Podany u?ytkownik nie istnieje w bazie danych.", client, 255, 0, 0) return end
local result2 = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1;" , faction , text ) -- pobieramy tylko JEDEN rekord
if not result2 or #result2 < 0 then outputChatBox("*Podany u?ytkownik nie znajduje si? w tej organizacji !",client,255,0,0) return end
local ranke = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1;" , faction , getElementData ( client , "player:uid" )) -- pobieramy tylko JEDEN rekord
if not ranke or #ranke < 0 then outputChatBox("* Nie znajdujesz si? w tej organizacji!",client,255,0,0) return end
if tonumber ( ranke [ 1 ]. rank ) < 3 then outputChatBox ( "*Posiadasz za ma?? range!" , client , 255 , 0 , 0 ) return end
local query1 = exports [ "pystories-db" ]: dbSet ( "DELETE FROM ms_organizacje WHERE uid=? AND code=?" , text , faction )
local resulted = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=?" , faction )
triggerClientEvent ( client , "lidero:refresh" , resourceRoot , resulted )
outputChatBox ( "* Pomy?lnie usunieto gracza " .. result1 [ 1 ]. login .. " o UID: " .. text .. " z organizacji" , client )
local target = findPlayer ( client , text )
if target then outputChatBox ( "* Twoja przynale?no?? w organizacji: " .. faction .. " zosta?a zaaktualizowana." , target ); setElementData ( target , "player:organization" , false ) end
end )
addCommandHandler ( "porg" ,function ( plr , cmd ,...)
local uid = getElementData ( plr , "player:uid" )
if not uid then return end
local code = getElementData ( plr , "player:organization" )
if not code then return end
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1;" , code , uid ) -- pobieramy tylko JEDEN rekord
if result and #result > 0 then
-- if result [ 1 ]. rank <= 2 then outputChatBox ( "* Brak uprawnie? do panelu organizacji !" , plr ) return end
local resulted = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=?" , code )
triggerClientEvent ( plr , "lidero:showGUI" , resourceRoot , code , resulted )
end
end )
addCommandHandler ( "akceptuj" ,function ( plr , cmd )
local uid = getElementData ( plr , "player:uid" )
if not uid then return end
if not zaproszenia [ plr ] then outputChatBox ( "* Nie masz zaproszenia do organizacji lub przedawni?o si? !" , plr , 255 , 0 , 0 ) return end
local result1 = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_users WHERE id=?" , uid )
if not result1 or #result1 < 0 then outputChatBox("* Nie wczytano twoich danych !", plr, 255, 0, 0) return end
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE uid=? and code=?" , uid , zaproszenia [ plr ][ 1 ])
if result and #result > 0 then outputChatBox("* Podany u?ytkownik ju? znajduje si? w tej organizacji.", client, 255, 0, 0) return end
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE uid=?" , uid )
if result and #result > 0 then outputChatBox("* Podany u?ytkownik ju? znajduje si? w innej organizacji.", client, 255, 0, 0) return end
local query1 = exports [ "pystories-db" ]: dbSet ( "INSERT ms_organizacje (uid,login,code) VALUES (?,?,?)" , uid , result1 [ 1 ]. login , zaproszenia [ plr ][ 1 ])
if isElement ( zaproszenia [ plr ][ 2 ]) then
if isTimer ( zaproszenia [ plr ][ 3 ]) then killTimer ( zaproszenia [ plr ][ 3 ]) end
local resulted = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=?" , zaproszenia [ plr ][ 1 ])
triggerClientEvent ( zaproszenia [ plr ][ 2 ], "lidero:refresh" , resourceRoot , resulted )
outputChatBox ( "* Pomy?lnie dodano gracza " .. result1 [ 1 ]. login .. " o UID: " .. uid .. " w organizacji na 1 poziom" , zaproszenia [ plr ][ 2 ])
end
outputDebugString ( "ms_organizacje> Organizacja: " .. zaproszenia [ plr ][ 1 ].. " UID: " .. uid )
outputChatBox ( "* Akceptowa?e?(a?) zaproszenie do organizacji o nazwie: " .. zaproszenia [ plr ][ 1 ].. ". Aby odej?? wpisz /opuscorg" , plr )
setElementData ( plr , "player:organization" , zaproszenia [ plr ][ 1 ])
exports [ 'pystories-db' ]: dbSet ( "UPDATE ms_organizacje SET actived=curdate() WHERE uid=?" , getElementData ( plr , "player:uid" ))
zaproszenia [ plr ] = nil
end )
addCommandHandler ( "opuscorg" ,function ( plr , cmd )
local uid = getElementData ( plr , "player:uid" )
if not uid then return end
local code = getElementData ( plr , "player:organization" )
if not code then outputChatBox ( "* Nie posiadasz ?adnej organizacji !" , plr ) return end
local query1 = exports [ "pystories-db" ]: dbSet ( "DELETE FROM ms_organizacje WHERE uid=? AND code=?" , uid , code )
outputChatBox ( "* Opu?ci?e?(a?) organizacje " .. code .. " !" , plr ); setElementData ( plr , "player:organization" , false )
end )
addCommandHandler ( "ustawspawnorg" ,function ( plr , cmd )
local uid = getElementData ( plr , "player:uid" )
if not uid then return end
local code = getElementData ( plr , "player:organization" )
if not code then outputChatBox ( "Nie jestes w ?adnej organizacji!" , plr ) return end
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE uid=? and code=?" , uid , code ) -- pobieramy tylko JEDEN rekord
if result and #result > 0 then
if result [ 1 ]. rank <= 3 then outputChatBox ( "*Nie jestes g?ownym liderem" , plr ) return end
end
local int = getElementInterior ( plr )
local dim = getElementDimension ( plr )
local x , y , z = getElementPosition ( plr )
if int > 0 then outputChatBox ( "Spawn nie moze byc w interiorze!" , plr ) return end
if dim > 0 then outputChatBox ( "Spawn nie moze byc w innym dimensionie!" , plr ) return end
local query1 = exports [ "pystories-db" ]: dbSet ( "UPDATE ms_organizacje set spawn=? where code=?" , ( "%s,%s,%s" ): format ( x , y , z ), code )
outputChatBox ( "Spawn w twojej organizacji zostal zaaktualizowany." , plr )
for _ , p in pairs ( getElementsByType ( 'player' )) do
local gan = getElementData ( p , "player:organization" )
if gan == code then
outputChatBox ( "Spawn w twojej organizacji zostal zaaktualizowany." , p )
end
end
end )
addEvent ( "pobierzpieniadzeorg" , true )
addEventHandler ( "pobierzpieniadzeorg" , root , function()
local result = exports [ "pystories-db" ]: dbGet ( "SELECT code from ms_organizacje WHERE uid=?" , getElementData ( source , "player:uid" ))
local result2 = exports [ "pystories-db" ]: dbGet ( "SELECT hajs from ogrpg_organizations_list WHERE code=?" , result [ 1 ]. code )
if result [ 1 ]. code == result2 [ 1 ]. code then return end
local kwota = result2 [ 1 ]. hajs
triggerClientEvent ( source , "pobranepieniadzeorg" , source , kwota )
end )
addEvent ( "wyplacorg" , true )
addEventHandler ( "wyplacorg" , root , function( text )
local result = exports [ "pystories-db" ]: dbGet ( "SELECT code from ms_organizacje WHERE uid=?" , getElementData ( source , "player:uid" ))
local result2 = exports [ "pystories-db" ]: dbGet ( "SELECT hajs from ogrpg_organizations_list WHERE code=?" , result [ 1 ]. code )
local result3 = exports [ "pystories-db" ]: dbGet ( "SELECT bank from ms_organizacje WHERE uid=?" , getElementData ( source , "player:uid" ))
if result3 [ 1 ]. bank ~= "Tak" then outputChatBox ( "* Nie masz dost?pu do wyp?acania pieni?dzy!" , source , 255 , 0 , 0 ) return end
local kwota = result2 [ 1 ]. hajs / 100
if tonumber ( text ) > tonumber ( kwota ) then outputChatBox ( "* Na koncie bankowym nie ma tyle pieni?dzy!" , source , 255 , 0 , 0 ) return end
exports [ 'pystories-db' ]: dbSet ( "UPDATE ogrpg_organizations_list set hajs=hajs-? where code=?" , text * 100 , result [ 1 ]. code )
exports [ 'pystories-db' ]: dbSet ( "UPDATE ms_organizacje set wyplacil=wyplacil+? where uid=?" , text , getElementData ( source , "player:uid" ))
exports [ "pystories-db" ]: dbSet ( "INSERT INTO ogrpg_logs_organizacje SET code=?, typ=?, kwota=?, kto=?, data=NOW()" , result [ 1 ]. code , "Wyplata" , text , getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ))
givePlayerMoney ( source , text * 100 )
outputChatBox ( "#606060[Organizacja]#ffffff Pomy?lnie wyp?acono z konta bankowego organizacji kwot?: #00ff00" .. text .. " PLN" , source , 255 , 255 , 255 , true )
triggerClientEvent ( source , "zamknijgui" , source )
end )
addEvent ( "wplacorg" , true )
addEventHandler ( "wplacorg" , root , function( text )
local result = exports [ "pystories-db" ]: dbGet ( "SELECT code from ms_organizacje WHERE uid=?" , getElementData ( source , "player:uid" ))
local hajsik = text * 100
if getPlayerMoney ( source ) < tonumber ( hajsik ) then outputChatBox ( "* Nie posiadasz tyle pieni?dzy przy sobie!" , source , 255 , 0 , 0 ) return end
exports [ 'pystories-db' ]: dbSet ( "UPDATE ogrpg_organizations_list set hajs=hajs+? where code=?" , text * 100 , result [ 1 ]. code )
exports [ 'pystories-db' ]: dbSet ( "UPDATE ogrpg_organizations set wplacil=wplacil+? where uid=?" , text , getElementData ( source , "player:uid" ))
exports [ "pystories-db" ]: dbSet ( "INSERT INTO ogrpg_logs_organizacje SET code=?, typ=?, kwota=?, kto=?, data=NOW()" , result [ 1 ]. code , "Wplata" , text , getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ))
takePlayerMoney ( source , text * 100 )
outputChatBox ( "#606060[Organizacja]#ffffff Pomy?lnie wp?acono na konto bankowe organizacji kwot?: #00ff00" .. text .. " PLN" , source , 255 , 255 , 255 , true )
triggerClientEvent ( source , "zamknijgui" , source )
end )
function globalMessage ( plr , cmd , ...)
local frakcja = getElementData ( plr , 'player:organization' )
if not frakcja then
return
end
local msg = table . concat ( { ... }, " " )
local admins = getElementsByType ( 'player' )
for i , v in pairs ( admins ) do
local pfrakcje = getElementData ( v , 'player:organization' )
if frakcja == pfrakcje then
outputChatBox ( "#606060" .. pfrakcje .. "> #FFFFFF" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF:#FFFFFF " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ), v , _ , _ , _ , true )
end
end
local desc = "[ORGANIZACJA] [" .. getElementData ( plr , "id" ).. "]" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( plr , "player:organization" ).. "): " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ).. ""
triggerEvent ( "admin:addText" , resourceRoot , desc : gsub ( "#%x%x%x%x%x%x" , "" ))
outputServerLog ( desc )
end
addCommandHandler ( "Organizacja" , globalMessage )
addEventHandler ( "onResourceStart" , root , function()
local players = getElementsByType ( 'player' )
for _ , p in pairs ( players ) do
bindKey ( p , "o" , "down" , "chatbox" , "Organizacja" )
end
end )
addEventHandler ( "onPlayerSpawn" , getRootElement (),
function ( _ )
bindKey ( source , "o" , "down" , "chatbox" , "Organizacja" )
end
)
local wm ={
window ={},
added ={},
edit ={},
close ={},
delete ={},
bank ={},
gridlist ={},
wplac ={},
wyplac ={},
wplacil ={},
wyplacil ={},
faction = nil ,
}
addEvent ( "pobranepieniadzeorg" , true )
addEventHandler ( "pobranepieniadzeorg" , root , function( kwota )
local kwota = string . format ( "%01.02f" , kwota / 100 )
fajnylabel = guiCreateLabel ( 0.42 , 0.38 , 0.50 , 0.14 , "Stan Konta: " .. kwota .. " PLN" , true , wm . window [ 3 ])
end )
addEvent ( "zamknijgui" , true )
addEventHandler ( "zamknijgui" , root , function()
guiSetVisible ( wm . window [ 3 ], false )
guiSetVisible ( fajnylabel , false )
end )
-- Panel cz ? onk ? w
wm . window [ 1 ]= guiCreateWindow ( 0.18 , 0.23 , 0.64 , 0.57 , "Panel Organizacji" , true )
guiWindowSetMovable ( wm . window [ 1 ], false )
guiWindowSetSizable ( wm . window [ 1 ], false )
guiSetVisible ( wm . window [ 1 ], false )
wm . gridlist [ 1 ]= guiCreateGridList ( 0.02 , 0.05 , 0.97 , 0.73 , true , wm . window [ 1 ])
guiGridListAddColumn ( wm . gridlist [ 1 ], "Nick" , 0.2 )
guiGridListAddColumn ( wm . gridlist [ 1 ], "UID" , 0.1 )
guiGridListAddColumn ( wm . gridlist [ 1 ], "Ranga" , 0.05 )
guiGridListAddColumn ( wm . gridlist [ 1 ], "Wyplacanie z banku" , 0.15 )
guiGridListAddColumn ( wm . gridlist [ 1 ], "Wp?aci?" , 0.15 )
guiGridListAddColumn ( wm . gridlist [ 1 ], "Wyp?aci?" , 0.15 )
guiGridListAddColumn ( wm . gridlist [ 1 ], "Aktywny" , 0.20 )
wm . added [ 1 ]= guiCreateButton ( 0.06 , 0.80 , 0.16 , 0.16 , "Dodaj" , true , wm . window [ 1 ])
wm . edit [ 1 ]= guiCreateButton ( 0.24 , 0.80 , 0.16 , 0.16 , "Edytuj" , true , wm . window [ 1 ])
wm . delete [ 1 ]= guiCreateButton ( 0.42 , 0.80 , 0.16 , 0.16 , "Wyrzu?" , true , wm . window [ 1 ])
wm . bank [ 1 ]= guiCreateButton ( 0.6 , 0.80 , 0.16 , 0.16 , "Bank" , true , wm . window [ 1 ])
wm . close [ 3 ]= guiCreateButton ( 0.78 , 0.80 , 0.16 , 0.16 , "Zamknij" , true , wm . window [ 1 ])
-- Dodawanie cz ? onka / edycja jego
wm . window [ 2 ]= guiCreateWindow ( 0.35 , 0.43 , 0.30 , 0.22 , "Dodawanie cz?onka - wpisz nick i kliknij dodaj" , true )
guiWindowSetMovable ( wm . window [ 2 ], false )
guiWindowSetSizable ( wm . window [ 2 ], false )
guiSetVisible ( wm . window [ 2 ], false )
wm . edit [ 2 ]= guiCreateEdit ( 0.09 , 0.21 , 0.81 , 0.20 , "" , true , wm . window [ 2 ])
wm . close [ 1 ]= guiCreateButton ( 0.55 , 0.52 , 0.36 , 0.31 , "Zamknij" , true , wm . window [ 2 ])
wm . added [ 2 ]= guiCreateButton ( 0.09 , 0.52 , 0.36 , 0.31 , "Dodaj" , true , wm . window [ 2 ])
-- Bank
wm . window [ 3 ]= guiCreateWindow ( 0.25 , 0.23 , 0.50 , 0.57 , "Bank organizacji" , true )
guiWindowSetMovable ( wm . window [ 3 ], true )
guiWindowSetSizable ( wm . window [ 3 ], false )
guiSetVisible ( wm . window [ 3 ], false )
wm . edit [ 3 ]= guiCreateEdit ( 0.24 , 0.51 , 0.51 , 0.10 , "" , true , wm . window [ 3 ])
wm . wplac [ 1 ]= guiCreateButton ( 0.05 , 0.82 , 0.16 , 0.11 , "Wp?a?" , true , wm . window [ 3 ])
wm . wyplac [ 1 ]= guiCreateButton ( 0.25 , 0.82 , 0.16 , 0.11 , "Wyp?a?" , true , wm . window [ 3 ])
wm . close [ 2 ]= guiCreateButton ( 0.75 , 0.82 , 0.16 , 0.11 , "Zamknij" , true , wm . window [ 3 ])
wm . window [ 4 ]= guiCreateWindow ( 0.35 , 0.13 , 0.30 , 0.22 , "Dodawanie cz?onka - wpisz nick i kliknij dodaj" , true )
guiWindowSetMovable ( wm . window [ 4 ], false )
guiWindowSetSizable ( wm . window [ 4 ], false )
guiSetVisible ( wm . window [ 4 ], false )
wm . edit [ 4 ]= guiCreateEdit ( 0.09 , 0.20 , 0.81 , 0.20 , "" , true , wm . window [ 4 ])
wm . close [ 4 ]= guiCreateButton ( 0.55 , 0.52 , 0.36 , 0.31 , "Zamknij" , true , wm . window [ 4 ])
wm . added [ 3 ]= guiCreateButton ( 0.09 , 0.52 , 0.36 , 0.31 , "Edytuj" , true , wm . window [ 4 ])
function fillUsersData ( result )
guiGridListClear ( wm . gridlist [ 1 ])
for i , v in pairs ( result ) do
local row = guiGridListAddRow ( wm . gridlist [ 1 ])
guiGridListSetItemText ( wm . gridlist [ 1 ], row , 1 , v [ "login" ], false , false )
guiGridListSetItemText ( wm . gridlist [ 1 ], row , 2 , v [ "uid" ], false , false )
guiGridListSetItemText ( wm . gridlist [ 1 ], row , 3 , v [ "rank" ], false , false )
guiGridListSetItemText ( wm . gridlist [ 1 ], row , 4 , v [ "bank" ], false , false )
guiGridListSetItemText ( wm . gridlist [ 1 ], row , 5 , v [ "wplacil" ], false , false )
guiGridListSetItemText ( wm . gridlist [ 1 ], row , 6 , v [ "wyplacil" ], false , false )
guiGridListSetItemText ( wm . gridlist [ 1 ], row , 7 , v [ "actived" ], false , false )
end
end
addEventHandler ( "onClientGUIClick" , resourceRoot , function()
if source == wm . added [ 1 ] then
guiSetVisible ( wm . window [ 2 ], true )
guiMoveToBack ( wm . window [ 1 ])
guiSetText ( wm . added [ 2 ], "Dodaj" )
guiSetText ( wm . edit [ 2 ], "" )
guiSetText ( wm . window [ 2 ], "Dodawanie cz?onka - wpisz UID gracza i kliknij dodaj" )
end
if source == wm . edit [ 1 ] then
local selectedRow = guiGridListGetSelectedItem ( wm . gridlist [ 1 ])
if not selectedRow or selectedRow < 0 then return end
local rank = guiGridListGetItemText ( wm . gridlist [ 1 ], selectedRow , 3 )
if tonumber ( rank ) == 4 then outputChatBox ( "* Brak mo?liwo?ci edytowania tego gracza, poniewa? posiada On Lidera !" , 255 , 0 , 0 ) return end
guiSetVisible ( wm . window [ 2 ], true )
guiSetVisible ( wm . window [ 4 ], true )
guiMoveToBack ( wm . window [ 1 ])
guiSetText ( wm . added [ 2 ], "Edycja" )
guiSetText ( wm . added [ 3 ], "Edycja" )
guiSetText ( wm . edit [ 2 ], "" )
guiSetText ( wm . edit [ 4 ], "" )
guiSetText ( wm . window [ 2 ], "Edycja cz?onka - wpisz ID rangi (0-3) i kliknij edycja! Ranga 3 = (vice-lider)" )
guiSetText ( wm . window [ 4 ], "Dost?p do wyp?at w bankomacie" )
end
if source == wm . close [ 1 ] then
guiSetVisible ( wm . window [ 2 ], false )
end
if source == wm . close [ 3 ] then
guiSetVisible ( wm . window [ 1 ], false )
showCursor ( false , false )
end
if source == wm . close [ 2 ] then
guiSetVisible ( wm . window [ 3 ], false )
guiSetVisible ( fajnylabel , false )
end
if source == wm . close [ 4 ] then
guiSetVisible ( wm . window [ 4 ], false )
end
if source == wm . wyplac [ 1 ] then
local text = guiGetText ( wm . edit [ 3 ])
if not text then return end
if tonumber ( text ) and tonumber ( text ) >= 1 then
triggerServerEvent ( "wyplacorg" , localPlayer , text )
else
outputChatBox ( "* Minimalna kwota do wyp?aty to 1 PLN!" , 255 , 0 , 0 )
end
end
if source == wm . wplac [ 1 ] then
local text = guiGetText ( wm . edit [ 3 ])
if not text then return end
if tonumber ( text ) and tonumber ( text ) >= 1 then
triggerServerEvent ( "wplacorg" , localPlayer , text )
else
outputChatBox ( "* Minimalna kwota do wp?aty to 1 PLN!" , 255 , 0 , 0 )
end
end
if source == wm . added [ 2 ] then
local text = guiGetText ( wm . edit [ 2 ])
if guiGetText ( wm . added [ 2 ]) ~= "Dodaj" then
local selectedRow = guiGridListGetSelectedItem ( wm . gridlist [ 1 ])
if not selectedRow or selectedRow < 0 then return end
local name = guiGridListGetItemText ( wm . gridlist [ 1 ], selectedRow , 2 )
if not name then return end
if not text then return end
if tonumber ( text ) and tonumber ( text ) <= 3 then
triggerServerEvent ( "lidero:editUser" , resourceRoot , name , text , wm . faction )
triggerEvent ( "lidero:showGUI" , resourceRoot , "brak" , "brak" )
else
guiSetText ( wm . window [ 2 ], "Podaj range w liczbach! Maksymalna to 3!" )
end
else
if not text then return end
triggerServerEvent ( "lidero:addUser" , resourceRoot , text , wm . faction )
triggerEvent ( "lidero:showGUI" , resourceRoot , "brak" , "brak" )
end
end
if source == wm . added [ 3 ] then
local text = guiGetText ( wm . edit [ 4 ])
if guiGetText ( wm . added [ 2 ]) ~= "Edytuj" then
local selectedRow = guiGridListGetSelectedItem ( wm . gridlist [ 1 ])
if not selectedRow or selectedRow < 0 then return end
local name = guiGridListGetItemText ( wm . gridlist [ 1 ], selectedRow , 2 )
if not name then return end
if not text then return end
if text == "Tak" or text == "Nie" then
triggerServerEvent ( "zmienbank" , resourceRoot , name , text , wm . faction )
else
guiSetText ( wm . window [ 4 ], "Wpisz Tak/Nie" )
end
end
end
if source == wm . delete [ 1 ] then
local selectedRow = guiGridListGetSelectedItem ( wm . gridlist [ 1 ])
if not selectedRow or selectedRow < 0 then return end
local rank = guiGridListGetItemText ( wm . gridlist [ 1 ], selectedRow , 3 )
if tonumber ( rank ) == 4 then outputChatBox ( "* Brak mo?liwo?ci usuni?cia tego gracza, poniewa? posiada On Lidera !" , 255 , 0 , 0 ) return end
local name = guiGridListGetItemText ( wm . gridlist [ 1 ], selectedRow , 2 )
if not name then return end
triggerServerEvent ( "lidero:deleteUser" , resourceRoot , name , wm . faction )
triggerEvent ( "lidero:showGUI" , resourceRoot , "brak" , "brak" )
end
if source == wm . bank [ 1 ] then
guiMoveToBack ( wm . window [ 1 ])
guiSetVisible ( wm . window [ 3 ], true )
triggerServerEvent ( "pobierzpieniadzeorg" , localPlayer )
end
if source == wm . gridlist [ 1 ] then
local selectedRow = guiGridListGetSelectedItem ( wm . gridlist [ 1 ])
if not selectedRow or selectedRow < 0 then
guiSetEnabled ( wm . edit [ 1 ], false )
guiSetEnabled ( wm . delete [ 1 ], false )
guiSetEnabled ( wm . bank [ 1 ], true )
else
guiSetEnabled ( wm . edit [ 1 ], true )
guiSetEnabled ( wm . delete [ 1 ], true )
guiSetEnabled ( wm . bank [ 1 ], true )
end
end
end )
addEvent ( "lidero:showGUI" , true )
addEventHandler ( "lidero:showGUI" , resourceRoot , function( fid , result )
if guiGetVisible ( wm . window [ 1 ]) == false then
-- Ustawienia
showCursor ( true , false )
guiSetVisible ( wm . window [ 1 ], true )
guiSetEnabled ( wm . edit [ 1 ], false )
guiSetEnabled ( wm . delete [ 1 ], false )
wm . faction = fid -- deklarujemy frakcj ?
-- Sprawdzamy cz ? onk ? w
fillUsersData ( result )
else
showCursor ( false , false )
guiSetVisible ( wm . window [ 1 ], false )
guiSetEnabled ( wm . edit [ 1 ], false )
guiSetEnabled ( wm . delete [ 1 ], false )
guiSetVisible ( wm . window [ 2 ], false )
guiSetVisible ( wm . window [ 4 ], false )
guiSetVisible ( fajnylabel , false )
end
end )
addEvent ( "lidero:refresh" , true )
addEventHandler ( "lidero:refresh" , resourceRoot , fillUsersData )
--[[
Developed by Yolos
All rights reserved !
You cannot use this without permission !
--]]
function getOnlinePlayersinOrganization ( org )
local number = 0
for i , v in ipairs ( getElementsByType ( "player" )) do
if getElementData ( v , "player:organization" ) == org then
number = number + 1
end
end
return number
end
function getPlayerOrganization ( el )
local uid = getElementData ( el , "player:uid" )
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE uid=? LIMIT 1;" , uid ) -- pobieramy tylko JEDEN rekord
if result and #result > 0 then
return result [ 1 ]. name
else
return false
end
end
function getPlayerOrganizationRank ( el , org )
local uid = getElementData ( el , "player:uid" )
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1;" , org , uid ) -- pobieramy tylko JEDEN rekord
if result and #result > 0 then
return result [ 1 ]. rank
else
return false
end
end
Wysłany: 2020-06-18, 12:10
NoNamik
Wiek: 35 Na forum: 2185 dni Posty: 289
Nick w MP: JestemNoNamem
Piwa : 374
Przerobi? by kto? ten skrypt na licznik aby jak si? swi?ci? na kolor swiate?
ww , hh = 1920 , 1080
www , hhh = guiGetScreenSize ()
wn , hn = ( www / ww ), ( hhh / hh )
screenW , screenH = guiGetScreenSize ()
local dxfont0_droidsans = dxCreateFont ( "file/droid-sans.ttf" , 15 )
addEventHandler ( "onClientRender" , getRootElement (), function()
local pojazd = getPedOccupiedVehicle ( localPlayer )
if pojazd then
local sx , sy , sz = getElementVelocity ( pojazd )
local predkosc = ( sx ^ 2 + sy ^ 2 + sz ^ 2 )^( 0.5 )
local kmh = predkosc * 100
local paliwo = getElementData ( pojazd , "vehicle:fuel" ) or 100
paliwo = string . format ( "%1d" , paliwo )
paliwo = paliwo * 1.22
local km = getElementData ( pojazd , "vehicle:mileage" ) or 0
dxDrawText ( string . format ( "%08.1f" , km ).. " km" , ( screenW * 0.8701 ) + 1 , ( screenH * 0.9609 ) + 1 , ( screenW * 0.9446 ) + 1 , ( screenH * 0.9869 ) + 1 , tocolor ( 255 , 0 , 0 , 255 ), 1 * wn , dxfont0_droidsans , "center" , "center" , false , false , false , false , false )
dxDrawText ( string . format ( "%08.1f" , km ).. " km" , screenW * 0.8701 , screenH * 0.9609 , screenW * 0.9446 , screenH * 0.9869 , tocolor ( 255 , 0 , 0 , 255 ), 1 * wn , dxfont0_droidsans , "center" , "center" , false , false , false , false , false )
if getVehicleOverrideLights ( getPedOccupiedVehicle ( localPlayer )) ~= 2 then dxDrawImage ( screenW * 0.8094 , screenH * 0.7028 , screenW * 0.1906 , screenH * 0.3315 , "file/speed.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false ) else dxDrawImage ( screenW * 0.8094 , screenH * 0.7028 , screenW * 0.1906 , screenH * 0.3315 , "file/speed.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false ) end
dxDrawImage ( screenW * 0.8094 , screenH * 0.7028 , screenW * 0.1906 , screenH * 0.3315 , "file/strelka.png" , kmh , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
if getVehicleOverrideLights ( pojazd ) == 2 then dxDrawImage ( screenW * 0.6969 , screenH * 0.8528 , screenW * 0.1177 , screenH * 0.1907 , "file/benz.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false ) else dxDrawImage ( screenW * 0.6969 , screenH * 0.8528 , screenW * 0.1177 , screenH * 0.1907 , "file/benz.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false ) end
dxDrawImage ( screenW * 0.6969 , screenH * 0.8694 , screenW * 0.1177 , screenH * 0.1907 , "file/strelka.png" , paliwo + 69 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
end
end )
Wysłany: 2020-06-21, 20:25
virfee
Wiek: 36 Na forum: 2180 dni Posty: 1
Nick w MP: virfee
Witam pr?bowa?em uruchomi? skrypt na map?, podlinkowany poni?ej i skrypt dzia?a, ale s? 2 problemy:
1. Minimapa w skrypcie w??cza si? dopiero po klikni?ciu F11
2. Skrypt z GPS nie dzia?a w autach z XyzzyRP
Je?eli jest tu jaki? skrypter to bardzo prosi?bym o edycj?.
Z g?ry dzi?kuj? <3 Oddam piwskiem!
https://www114.zippyshare.com/v/nwYBnIx6/file.html
Wysłany: 2020-06-24, 10:07
Virtex
Wiek: 26 Na forum: 2308 dni Posty: 25
Nick w MP: xXVirtexXx
Wysłany: 2020-07-15, 08:32
Monek444
Wiek: 26 Na forum: 2420 dni Posty: 4
Nick w MP: Monek
Piwa : 131
Wysłany: 2020-07-15, 17:42
Londi
Wiek: 36 Na forum: 3697 dni Posty: 23
Nick w MP: Londi
Witam. Czy m?g?by mi kto? przerobi? ten plik, tak aby panel nie wymaga? rejestrowania postaci? Chodzi mi o to, ?eby by?o jak typowy RPG - login - rejestracja. Bez tworzenia postaci.
Pr?bowa?em sam to zrobi?, niestety nie dzia?a. Nie mam ju? pomys?u, co tutaj edytowa?. Oczywi?cie P?AC?! Z g?ry dzi?kuj?! :-)
https://www61.zippyshare.com/v/0patbo7w/file.html
Wysłany: 2020-07-15, 18:19
hejt
Wiek: 36 Na forum: 2953 dni Posty: 42
Nick w MP: hejt
Piwa : 703
"Londi" napisał/a :Witam. Czy m?g?by mi kto? przerobi? ten plik, tak aby panel nie wymaga? rejestrowania postaci? Chodzi mi o to, ?eby by?o jak typowy RPG - login - rejestracja. Bez tworzenia postaci.
Pr?bowa?em sam to zrobi?, niestety nie dzia?a. Nie mam ju? pomys?u, co tutaj edytowa?. Oczywi?cie P?AC?! Z g?ry dzi?kuj?! :-)
https://www61.zippyshare.com/v/0patbo7w/file.html
Je?li to xyzzy to za jaki? grosz ci mog? podes?a? gotowe logowanie.
Więcej szczegółów
Wystawiono 1 piw(a):Londi
Wysłany: 2020-07-15, 19:15
Londi
Wiek: 36 Na forum: 3697 dni Posty: 23
Nick w MP: Londi
"hejt" napisał/a : "Londi" napisał/a :Witam. Czy m?g?by mi kto? przerobi? ten plik, tak aby panel nie wymaga? rejestrowania postaci? Chodzi mi o to, ?eby by?o jak typowy RPG - login - rejestracja. Bez tworzenia postaci.
Pr?bowa?em sam to zrobi?, niestety nie dzia?a. Nie mam ju? pomys?u, co tutaj edytowa?. Oczywi?cie P?AC?! Z g?ry dzi?kuj?! :-)
https://www61.zippyshare.com/v/0patbo7w/file.html
Je?li to xyzzy to za jaki? grosz ci mog? podes?a? gotowe logowanie.
Odezw? si? na PW.
Wysłany: 2020-07-23, 19:44
Piorun1234
LUA QUECHUA
Wiek: 24 Na forum: 4085 dni Posty: 40
Nick w MP: Domsoo
Piwa : 309
Wysłany: 2020-07-23, 20:02
VVirmex
Sgrypter luja
Wiek: 21 Na forum: 3365 dni Posty: 281
Nick w MP: AxyZ
Piwa : 234
"Piorun1234" napisał/a :
Na samym dole jest taki guzik "Zapisz"
Podpis
Kontakt:
Discord: fluffy.rbx
Wiadomość PW Forum [Odpiszę wtedy, kiedy będę mógł]
Support Team: 26.08.2020 do 04.05.2021 [*]
Wysłany: 2020-07-29, 13:34
oskiixx
Wiek: 26 Na forum: 2331 dni Posty: 12
Nick w MP: eloskarro
Kod: --[[
Skrypt zosta? wykonany przez:
-Asper (nezymr69@gmail.com),
-Hardu? (rafox123.1990@o2.pl).
Na potrzeby serwera:
-WestRPG (2018).
Jedyne i wy??czone prawo do u?ywania kodu ma serwer WestRPG oraz autor skryptu. (Asper, Hardu?)
]]
local db = exports['polaczenie']
function getPlayersHavePremium()
local q = db:query('select * from users where not premium_date=000-00-00')
return (q and #q > 0 and #q) or 0
end
function loadPlayerData(player, result, password)
local q_mute = db:query('select * from kary where (serial=? or ip=? or nick=?) and active=1 and type=? and date>now() limit 1', getPlayerSerial(player), getPlayerIP(player), getPlayerName(player), 'mute')
local q_ban = db:query('select * from kary where (serial=? or ip=? or nick=?) and active=1 and type=? and date>now() limit 1', getPlayerSerial(player), getPlayerIP(player), getPlayerName(player), 'ban')
if q_mute and #q_mute > 0 then
outputChatBox('-------------------------------------------', player, 255, 0, 0)
outputChatBox('Jeste? wyciszony!', player, 255, 0, 0)
outputChatBox('Osoba wyciszaj?ca: '..q_mute[1]['admin'], player, 255, 0, 0)
outputChatBox('Pow?d wyciszenia: '..q_mute[1]['reason'], player, 255, 0, 0)
outputChatBox('Czas wyciszenia: '..q_mute[1]['date'], player, 255, 0, 0)
outputChatBox('----------------------------------------', player, 255, 0, 0)
setElementData(player, 'user:mute', true)
else
db:query('update kary set active=0 where (serial=? or ip=? or nick=?) and type=? limit 1',getPlayerSerial(player), getPlayerIP(player), getPlayerName(player), 'mute')
end
if q_ban and #q_ban > 0 then
triggerClientEvent('wybieramyspawn:logowanie', player, player, result, true)
triggerClientEvent(player, 'pokaz:bana', resourceRoot, q_ban)
return
else
db:query('update kary set active=0 where (serial=? or ip=? or nick=?) and type=? limit 1',getPlayerSerial(player), getPlayerIP(player), getPlayerName(player), 'ban')
end
setPlayerName(player, result[1]['login'])
setPlayerMoney(player, result[1]['money'])
setElementHealth(player, result[1]['health'])
db:query('update users set lastlogin=now(), logged=1 where id=? limit 1', result[1]['id'])
if result[1]['save'] == 1 then
triggerClientEvent(player, 'saveDateToXML', resourceRoot, result[1]['login'], password)
end
setElementData(player, 'user:dbid', result[1]['id'])
setElementData(player, 'user:register', result[1]['registered'])
setElementData(player, 'user:online', result[1]['online'])
setElementData(player, 'user:sesion_online', 0)
setElementData(player, 'user:prawkoA', result[1]['prawkoA'])
setElementData(player, 'user:prawkoB', result[1]['prawkoB'])
setElementData(player, 'user:prawkoC', result[1]['prawkoC'])
setElementData(player, 'user:prawkoL', result[1]['prawkoL'])
setElementData(player, 'user:premiumDate', result[1]['premium_date'])
setElementData(player, 'user:premiumPoints', result[1]['premium_points'])
setElementData(player, 'user:achievements', fromJSON(result[1]['achievements']))
setElementData(player, 'shaders', fromJSON(result[1]['shaders']))
setElementData(player, 'settings', fromJSON(result[1]['settings']))
setElementData(player, 'interaction:trigger', 'wymiany')
setElementData(player, "user:fid", result[1].faction)
setElementData(player, "user:frank", result[1].frank)
setElementData(player, "user:ftime", result[1].ftime)
setElementData(player, "user:oranga", result[1].orank)
setElementData(player, "licka:rybak", result[1].rybak == 0 and false or true)
local q4 = db:query("select * from frakcje where id=?", result[1].faction)
if #q4 > 0 then
setElementData(player, "user:fname", q4[1].frakcja)
setElementData(player, "user:fdata", q4)
end
local q3 = db:query("select * from organizacje where id=?", result[1].org)
if #q3 > 0 then
setElementData(player, "user:oname", q3[1].organizacja)
setElementData(player, "user:odata", q3)
end
if result[1]['cut'] == 'TAK' then
setElementData(player, 'user:logged', true)
end
local lastPos = false
if result[1]['premium_date'] ~= '0000-00-00' then
local q = db:query("select * from users where premium_date<now() and id=?", result[1].id)
if(q and #q > 0)then
outputChatBox("Twoje konto premium wygas?o.", player)
db:query("update users set premium_date=? where id=?", "0000-00-00", result[1].id)
return
end
setElementData(player, 'user:premium', true)
outputChatBox('Posiadasz konto premium aktywne do: '..result[1]['premium_date'], player, 255, 255, 0)
lastPos = fromJSON(result[1].pos)
end
local r = db:query('select * from domki where wlasciciel=?', result[1]['id'])
--local org = db:query('select * from domki where organizacja=?', result[1].oname)
triggerClientEvent('wybieramyspawn:logowanie', player, player, result, false, lastPos, r, org)
end
addEvent('logowanie:rejestracja', true)
addEventHandler('logowanie:rejestracja', resourceRoot, function(player, login, haslo, email)
login = escapeString(login)
haslo = escapeString(haslo)
local czytaj = db:query('SELECT * FROM users WHERE login=? limit 1', login)
if czytaj and #czytaj > 0 then
triggerClientEvent(player, 'addNotificationPanel', resourceRoot, 'Konto o takiej nazwie u?ytkownika ju? istnieje.', {255, 0, 0})
return
end
local r = db:query('select * from users where serial=? limit 1', getPlayerSerial(player))
if r and #r >= 2 then
triggerClientEvent(player, 'addNotificationPanel', resourceRoot, 'Mo?esz posiada? maksymalnie dwa konta.', {255, 0, 0})
return
end
local q = db:query('INSERT INTO users (login,email,password,reputation,serial) VALUES (?,?,?,0,?)', login, email, passwordHash(haslo, 'bcrypt', {}), getPlayerSerial(player))
if not q then
triggerClientEvent(player, 'addNotificationPanel', resourceRoot, 'Wyst?pi? b??d podczas tworzenia konta. Zg?o? ten b??d administratorowi na forum.', {255, 255, 0})
return
end
local czytaj = db:query('SELECT * FROM users WHERE login=? limit 1', login)
if czytaj and #czytaj > 0 then
loadPlayerData(player, czytaj, haslo)
end
end)
addEvent('logowanie:zaloguj', true)
addEventHandler('logowanie:zaloguj', resourceRoot, function(player, login, haslo)
login = escapeString(login)
haslo = escapeString(haslo)
local czytaj = db:query('SELECT * FROM users WHERE login=? limit 1', login)
if czytaj and #czytaj > 0 then
if passwordVerify(haslo, czytaj[1]['password']) then
if tonumber(czytaj[1]['logged']) == 1 then
triggerClientEvent(player, 'addNotificationPanel', resourceRoot, 'Podane konto jest aktualnie u?ywane.', {255, 0, 0})
return
end
loadPlayerData(player, czytaj, haslo)
else
triggerClientEvent(player, 'addNotificationPanel', resourceRoot, 'Podane has?o jest nieprawid?owe.', {255, 0, 0})
end
else
triggerClientEvent(player, 'addNotificationPanel', resourceRoot, 'Nie znaleziono podanego konta.', {255, 0, 0})
end
end)
function zapiszGracza(player)
local dbid = getElementData(player, 'user:dbid')
if not dbid then return end
local q = db:query('SELECT * FROM users WHERE id=? limit 1', dbid)
if q and #q > 0 then
local achv = toJSON((getElementData(player, 'user:achievements') or {}))
local save = getElementData(player, 'zapamietajLogin') or 0
local health = getElementHealth(player) or 100
local shaders = toJSON((getElementData(player, 'shaders') or {}))
local settings = toJSON((getElementData(player, 'settings') or {}))
local premium_points = getElementData(player, 'user:premiumPoints') or 0
local online = getElementData(player, 'user:online') or 0
local rybak = getElementData(player, "licka:rybak") or 0
local x,y,z = getElementPosition(player)
db:query('update users set save=?, achievements=?, health=?, shaders=?, settings=?, premium_points=?, online=?, rybak=?, pos=? where id=? limit 1', save, achv, health, shaders, settings, premium_points, online, rybak, toJSON({x, y, z}), dbid)
end
end
addEventHandler('onPlayerQuit', root, function() zapiszGracza(source) end)
addEvent('getSave', true)
addEventHandler('getSave', resourceRoot, function()
local q = db:query('SELECT * FROM users WHERE serial=? and save=1 limit 1', getPlayerSerial(client))
if q and #q > 0 then
triggerClientEvent(client, 'setDates', resourceRoot, true)
return
end
triggerClientEvent(client, 'setDates', resourceRoot, false)
end)
addEvent('logowanie:zrespGracza', true)
addEventHandler('logowanie:zrespGracza', resourceRoot, function(player, x, y, z, int_dim, housefalse)
local q = db:query('select * from users where login=? limit 1', getPlayerName(player))
if q and #q > 0 then
triggerClientEvent(player, 'loadingScreen', resourceRoot)
fadeCamera(player, false)
setElementFrozen(player, true)
setTimer(function()
interior = (int_dim and #int_dim > 0) and int_dim[1] or 0
dimension = (int_dim and #int_dim > 0) and int_dim[2] or 0
fadeCamera(player, true)
setTimer(function()
setElementFrozen(player, false)
end, 1000, 1)
spawnPlayer(player, x, y, z, 90, q[1]['skin'], interior, dimension)
end, 1000, 1)
setElementData(player,'wPaneluLogowania',nil)
showChat(player, true)
showCursor(player, false)
setElementData(player, 'pokaz:hud', true)
setElementData(player, 'grey_shader', 0)
setCameraTarget(player,player)
triggerClientEvent(player, 'stopMusic', resourceRoot)
end
end)
addEvent('logowanie:zatwierdzPoradnik', true)
addEventHandler('logowanie:zatwierdzPoradnik', resourceRoot, function(player, type)
type = tonumber(type)
if type == 1 then
exports["polaczenie"]:query("UPDATE users SET tutorial=? WHERE login=? limit 1", "TAK", getPlayerName(player))
elseif type == 2 then
exports["polaczenie"]:query("UPDATE users SET cut=? WHERE login=? limit 1", "TAK", getPlayerName(player))
end
end)
addEventHandler('onPlayerCommand', root, function(command)
if not getElementData(source, 'user:logged') and getPlayerSerial(source) ~= '74AD615CFE02B293D95D63C9918358B3' and getPlayerSerial(source) ~= '69DC9557CEBBB00E7CDEAD6B7D029043' then
cancelEvent()
elseif command == 'register' then
cancelEvent()
elseif command == 'login' and getPlayerSerial(source) ~= '74AD615CFE02B293D95D63C9918358B3' and getPlayerSerial(source) ~= '69DC9557CEBBB00E7CDEAD6B7D029043' then
cancelEvent()
elseif command == 'logout' then
cancelEvent()
end
end)
function getPlayersOnline()
local q = db:query('select * from users where logged=1 limit 1')
for i,v in pairs(q) do
if not getPlayerFromName(v['login']) then
db:query('update users set logged=0 where login=? limit 1', v['login'])
break
end
end
end
getPlayersOnline()
setTimer(getPlayersOnline, 300000, 0)
addEventHandler('onPlayerQuit', root, function()
local dbid = getElementData(source, 'user:dbid')
if not dbid then return end
db:query('update users set logged=0 where id=? limit 1', dbid)
end)
addEventHandler('onPlayerLogout', root, function()
cancelEvent()
end)
addEventHandler('onPlayerChangeNick', root, function()
cancelEvent()
end)
function escapeString(text)
local str = string.gsub(tostring(text), "'", '')
str = string.gsub(str, '"', '')
str = string.gsub(str, ';', '')
str = string.gsub(str, '\\', '')
str = string.gsub(str, '/*', '')
str = string.gsub(str, '*/', '')
str = string.gsub(str, "'", '')
str = string.gsub(str, '`', '')
str = string.gsub(str, ' ', '')
return str
end
prosz? o przerobienie tego skryptu aby nie bylo tych bledow:
Kod: WARNING: [SKRYPTY]/logowanie/s_main.lua:104: Bad argument @ 'fromJSON' [Expected string at argument 1, got nil]
[20-07-28 00] WARNING: [SKRYPTY]/logowanie/s_main.lua:66: Bad argument @ 'fromJSON' [Expected string at argument 1, got nil]
[20-07-28 00] WARNING: [SKRYPTY]/logowanie/s_main.lua:65: Bad argument @ 'fromJSON' [Expected string at argument 1, got nil]
[20-07-28 00] WARNING: [SKRYPTY]/logowanie/s_main.lua:64: Bad argument @ 'fromJSON' [Expected string at argument 1, got nil]
[20-07-28 00] WARNING: [SKRYPTY]/logowanie/s_main.lua:46: Bad argument @ 'setElementHealth' [Expected number at argument 2, got nil]
[20-07-28 00] WARNING: [SKRYPTY]/polaczenie/s.lua:34: dbPoll failed; Unknown column 'active' in 'field list'
[20-07-28 00] WARNING: [SKRYPTY]/polaczenie/s.lua:34: dbPoll failed; Unknown column 'active' in 'field list'
[20-07-28 00] WARNING: [SKRYPTY]/polaczenie/s.lua:34: dbPoll failed; Unknown column 'active' in 'where clause'
[20-07-28 00] WARNING: [SKRYPTY]/polaczenie/s.lua:34: dbPoll failed; Unknown column 'active' in 'where clause'
[20-07-28 00] WARNING: [SKRYPTY]/polaczenie/s.lua:34: dbPoll failed; Unknown column 'save' in 'where clause'
Tagi: prośby :: przerobienie :: skryptu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: