Wysłany: 2018-06-24, 08:02
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
Witam, baze danych z pysa, oraz paczke gm z niego.
Nie dzia?a?a mi frakcja samc, wi?c wgra?em now? z internetu, z gm Sky Game.
Problem jest w tym ?e chyba nie jest pod??czona pod m?j gm, bo dodaje siebie do samc, i pisze ?e nie jestem dodany.
Kod z s_duty samc
--[[
Developers : Yolos And Spli
]]
local marker = createMarker (- 2633.30 , 632.90 , 56.34 - 0.9 , 'cylinder' , 1.5 , 0 , 0 , 255 )
setElementDimension ( marker , 0 )
setElementInterior ( marker , 0 )
local t = createElement ( 'text' )
setElementData ( t , 'name' , 'Rozpocz?cie pracy' )
setElementDimension ( t , 0 )
setElementInterior ( t , 0 )
setElementPosition ( t ,- 2633.30 , 632.90 , 56.34 )
local licz = {}
function isPlayerInFaction ( plr )
local uid = getElementData ( plr , 'player:uid' )
if not uid then return end
local result = exports [ 'ogrpg-db' ]: dbGet ( 'SELECT 1 FROM ogrpg_factions WHERE code=? AND uid=? LIMIT 1;' , "SAMC" , uid )
if result [ 1 ] then
return true
else
return false
end
end
addEventHandler ( 'onMarkerHit' , marker , function( el , md )
if isPlayerInFaction ( el ) then
if not getElementData ( el , 'player:duty' ) then
setElementModel ( el , 274 )
exports [ 'frakcja' ]: rozpocznijnaliczanie ( el )
setElementData ( el , 'player:duty' , "SAMC" )
local rank = exports [ 'frakcja' ]: getPlayerFactionRank ( el , 'SAMC' )
setElementData ( el , "player:rank" , rank )
setElementData ( el , "last:color" , tostring ( getPlayerNametagColor ( el )))
setPlayerName ( el , "#00FCFF" .. getPlayerName ( el ): gsub ( "#%x%x%x%x%x%x" , "" ))
else
exports [ 'frakcja' ]: zatrzymajnaliczanie ( el )
takeWeapon ( el , 41 )
setElementData ( el , 'player:duty' , false )
setElementData ( el , "player:rank" , false )
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , skin )
setPlayerName ( el , getElementData ( el , "last:nick" ))
-- setPlayerNametagColor ( el , false )
setPlayerName ( el , getElementData ( el , "last:nick" ))
setPlayerName ( el , getPlayerName ( v ): gsub ( "#%x%x%x%x%x%x" , "" ))
end
else
outputChatBox ( 'Nie jeste? zatrudniony jako SAMC.' , el , 255 , 0 , 0 )
end
end )
function naliczanie ( el )
if isElement ( el ) then
local x = getElementData ( el , "player:workinjob" ) or 0
setElementData ( el , "player:workinjob" , x + 1 )
else
if isTimer ( licz [ el ]) then
killTimer ( licz [ el ])
licz [ el ] = nil
end
end
end
Wysłany: 2018-06-24, 10:17
PatryKK.
Emeryt LUA
Wiek: 26 Na forum: 3061 dni Posty: 1060
Nick w MP: PatryKK.
Piwa : 2322
Daj mi tabele z pysa, kt?ra odpowiada za frakcje oraz jak si? nazywa pys-db? Gdy? masz pozmieniane nazwy zasob?w I nie wyszukuje Ci bazy.
Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔
Aktualny projekt: BRAK
Wysłany: 2018-06-24, 11:01
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
Nazwa tabeli: pystories_factions
a skrypt pystories-db
Wysłany: 2018-06-24, 11:07
PatryKK.
Emeryt LUA
Wiek: 26 Na forum: 3061 dni Posty: 1060
Nick w MP: PatryKK.
Piwa : 2322
--[[
Developers : Yolos And Spli
]]
local marker = createMarker (- 2633.30 , 632.90 , 56.34 - 0.9 , 'cylinder' , 1.5 , 0 , 0 , 255 )
setElementDimension ( marker , 0 )
setElementInterior ( marker , 0 )
local t = createElement ( 'text' )
setElementData ( t , 'name' , 'Rozpocz?cie pracy' )
setElementDimension ( t , 0 )
setElementInterior ( t , 0 )
setElementPosition ( t ,- 2633.30 , 632.90 , 56.34 )
local licz = {}
function isPlayerInFaction ( plr )
local uid = getElementData ( plr , 'player:uid' )
if not uid then return end
local result = exports [ 'pystories-db' ]: dbGet ( 'SELECT 1 FROM pystories_factions WHERE code=? AND uid=? LIMIT 1;' , "SAMC" , uid )
if result [ 1 ] then
return true
else
return false
end
end
addEventHandler ( 'onMarkerHit' , marker , function( el , md )
if isPlayerInFaction ( el ) then
if not getElementData ( el , 'player:duty' ) then
setElementModel ( el , 274 )
exports [ 'frakcja' ]: rozpocznijnaliczanie ( el )
setElementData ( el , 'player:duty' , "SAMC" )
local rank = exports [ 'frakcja' ]: getPlayerFactionRank ( el , 'SAMC' )
setElementData ( el , "player:rank" , rank )
setElementData ( el , "last:color" , tostring ( getPlayerNametagColor ( el )))
setPlayerName ( el , "#00FCFF" .. getPlayerName ( el ): gsub ( "#%x%x%x%x%x%x" , "" ))
else
exports [ 'frakcja' ]: zatrzymajnaliczanie ( el )
takeWeapon ( el , 41 )
setElementData ( el , 'player:duty' , false )
setElementData ( el , "player:rank" , false )
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , skin )
setPlayerName ( el , getElementData ( el , "last:nick" ))
-- setPlayerNametagColor ( el , false )
setPlayerName ( el , getElementData ( el , "last:nick" ))
setPlayerName ( el , getPlayerName ( v ): gsub ( "#%x%x%x%x%x%x" , "" ))
end
else
outputChatBox ( 'Nie jeste? zatrudniony jako SAMC.' , el , 255 , 0 , 0 )
end
end )
function naliczanie ( el )
if isElement ( el ) then
local x = getElementData ( el , "player:workinjob" ) or 0
setElementData ( el , "player:workinjob" , x + 1 )
else
if isTimer ( licz [ el ]) then
killTimer ( licz [ el ])
licz [ el ] = nil
end
end
end
Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔
Aktualny projekt: BRAK
Wysłany: 2018-06-24, 11:34
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
Wysłany: 2018-06-24, 11:36
PatryKK.
Emeryt LUA
Wiek: 26 Na forum: 3061 dni Posty: 1060
Nick w MP: PatryKK.
Piwa : 2322
s_duty frakcji SAMC. Masz podmieni? ten kod co Ty da?e? na ten co ja Ci da?em.
Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔
Aktualny projekt: BRAK
Wysłany: 2018-06-24, 11:53
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
nadal nie dzia?a zalogowanie sie
Wysłany: 2018-06-24, 11:59
PatryKK.
Emeryt LUA
Wiek: 26 Na forum: 3061 dni Posty: 1060
Nick w MP: PatryKK.
Piwa : 2322
Pokaz jak wype?ni?e? tabele w pystories-factions
Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔
Aktualny projekt: BRAK
Wysłany: 2018-06-24, 13:18
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
Logowanie ju? mi dzia?a, loguje mnie i panel dzia?a, lecz aby si? wylogowa? z SAMC, to musze reconnect robi?, bo jak wchodze ponownie w marker do logowania i wylogowania to mnie nie wylogowuje z samc.
kod:
& #65279;--[[
Developers : Yolos And Spli
]]
local marker = createMarker (- 2630.38 , 631.04 , 56.34 - 0.9 , 'cylinder' , 1.5 , 255 , 0 , 0 )
setElementDimension ( marker , 0 )
setElementInterior ( marker , 0 )
local t = createElement ( 'text' )
setElementData ( t , 'name' , 'S?u?ba\nSan Andreas Medical Center\n[SAMC]' )
setElementDimension ( t , 0 )
setElementInterior ( t , 0 )
setElementPosition ( t ,- 2630.38 , 631.04 , 56.34 )
local licz = {}
function isPlayerInFaction ( plr )
local sid = getElementData ( plr , 'player:sid' )
if not sid then return end
local result = exports [ 'pystories-db' ]: dbGet ( 'SELECT 1 FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;' , "SAMC" , sid )
if result [ 1 ] then
return true
else
return false
end
end
addEventHandler ( 'onMarkerHit' , marker , function( el , md )
if isPlayerInFaction ( el ) then
if not getElementData ( el , 'player:duty' ) then
setElementModel ( el , 274 )
exports [ 'pystories-frakcja-ustawienia' ]: rozpocznijnaliczanie ( el )
setElementData ( el , 'player:faction' , 'SAMC' )
local rank = exports [ 'pystories-frakcja-ustawienia' ]: getPlayerFactionRank ( el , 'SAMC' )
setElementData ( el , "player:rank" , rank )
else
exports [ 'pystories-frakcja-ustawienia' ]: zatrzymajnaliczanie ( el )
takeWeapon ( el , 41 )
setElementData ( el , 'player:faction' , false )
setElementData ( el , "player:rank" , false )
local skin = getElementData ( el , "player:skin" )
setElementModel ( el , skin )
setPlayerName ( el , getElementData ( el , "last:nick" ))
setElementData ( el , "last:nick" , getPlayerName ( el ))
setElementData ( el , "last:color" , tostring ( getPlayerNametagColor ( el )))
-- setPlayerNametagColor ( el , false )
end
else
outputChatBox ( 'Nie jeste? zatrudniony jako SAMC.' , el , 255 , 0 , 0 )
end
end )
function naliczanie ( el )
if isElement ( el ) then
local x = getElementData ( el , "player:workinjob" ) or 0
setElementData ( el , "player:workinjob" , x + 1 )
else
if isTimer ( licz [ el ]) then
killTimer ( licz [ el ])
licz [ el ] = nil
end
end
end
Tagi: podłączenie :: frakcji :: pod :: swoją :: baze :: danych
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: