Wysłany: 2017-07-20, 22:57
KilusTv
Wiek: 28 Na forum: 3998 dni Posty: 58
Nick w MP: KilusTv
Piwa : 1
Czesc otoz zrobilem sb ladne gui wchodzenia i schodzrnia ze sluzby. Napisalem istatnio skrypt na syrene psp gdzie panel gui zrobilem z latwoscia i all smiga. Teraz jednak gdy robie podobnie panel logowania do frakcji, po wejsciu w marker nic mi sie nie wyswietla. Uzylem onMarkerHit ale nie pyka cos. Czy macie moze frakgment jakiegos podobnego kody, badz komendy jakich moglbym uzycndo napisania tego? Daje repke oraz piweczko
Wysłany: 2017-07-20, 23:37
BoCzKu
Mapper & Lua
Wiek: 24 Na forum: 3465 dni Posty: 87
Nick w MP: BoKu
Piwa : 331
local marker = createMarker (- 2721.48 , 684.16 , 51.23 - 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 ,- 2721.48 , 684.16 , 51.23 )
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;' , "SAMA" , 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' , "SAMA" )
local rank = exports [ 'frakcja' ]: getPlayerFactionRank ( el , 'SAMA' )
setElementData ( el , "player:rank" , rank )
setElementData ( el , "last:nick" , getPlayerName ( el ))
setElementData ( el , "last:color" , tostring ( getPlayerNametagColor ( el )))
setPlayerName ( el , "#00A0FF" .. getPlayerName ( el ): gsub ( "#%x%x%x%x%x%x" , "" ))
executeCommandHandler ( "setblipcolor" , el , 0 , 160 , 255 )
local uid = getElementData ( el , 'player:uid' )
exports [ 'ogrpg-db' ]: dbSet ( 'UPDATE ogrpg_factions set actived=NOW() WHERE code=? AND uid=? LIMIT 1;' , "SAMA" , uid )
else
exports [ 'frakcja' ]: zatrzymajnaliczanie ( el )
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" ))
takeAllWeapons ( el )
executeCommandHandler ( "setblipcolor" , el , 255 , 255 , 255 )
end
else
outputChatBox ( 'Nie jeste? zatrudniony jako SAMA.' , 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
Z tego sobie podpatrz. ( KOD NIE JEST M?J )
Wysłany: 2017-07-21, 09:03
KilusTv
Wiek: 28 Na forum: 3998 dni Posty: 58
Nick w MP: KilusTv
Piwa : 1
BoCzKu , dzieki ale ja umiem napisac taki skrypt. Chodzi mi o to ze jak wejde w marker to ma mi wyskoczyc gui i tam jest rozpocznij sluzbe, zakoncz sluzbe. Po kliknienciu rozpocznij sluzbe ma mnie zalogowac do frakcji
Wysłany: 2017-07-21, 13:26
Cholewka
Zakorzeniony w LUA
Wiek: 22 Na forum: 3583 dni Posty: 190
Piwa : 707
Nie mamy tutaj w zwyczaju pisa? gotowych skrypt?w, wi?c tylko Ci? pokieruje.
marker1 = createMarker ( x , y , z , typ , wielkosc , r , g , b , opcjonalnie alpha )
--[[
Miejsce
na
Twoje
GUI
]]--
function onHit ()
guiSetVisible ( twojeGUI , true )
showCursor ( true )
end
addEventHandler ( "onClientMarkerHit" , marker1 , onHit )
function onRozpoczyna ()
guiSetVisible ( twojeGUI , false )
showCursor ( false )
-- i cos tam dalej
end
addEventHandler ( "onClientGUIClick" , przycisk rozpoczynajacy , onRozpoczyna )
function onNierozpoczyna ()
guiSetVisible ( twojeGUI , false )
showCursor ( false )
-- i cos tam dalej
end
addEventHandler ( "onClientGUIClick" , przycisk nierozpoczynajacy , onNierozpoczyna )
A je?li chodzi o to logowanie, to na MySQL czy ACL?
Wysłany: 2017-07-21, 13:35
KilusTv
Wiek: 28 Na forum: 3998 dni Posty: 58
Nick w MP: KilusTv
Piwa : 1
mysql. A powiedz mi jeszcze co musze po stronie serwera
Tagi: logowanie :: sluzbe :: poprzez :: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: