Wysłany: 2014-04-10, 16:49
Daisu
Programista Lua
Wiek: 26 Na forum: 4444 dni Posty: 193
SPONSOR
Nick w MP: Daisu
Piwa : 24
Witam mam skrypty na logowania jak w Temacie ale gui si? nie wy?wietla.
META.xml
< meta >
< info author = "KineQ" type = "script" version = "1.1" />
< script src = "server.lua" type = "server" />
< script src = "client.lua" type = "client" />
</ meta >
Client.lua
GUIEditor = {
button = {},
window = {},
label = {}
}
addCommandHandler ( "loginpoli" , resourceRoot .
function()
GUIEditor . window [ 1 ] = guiCreateWindow ( 234 , 135 , 329 , 279 , "Logowanie Do Frakcji" , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
guiSetAlpha ( GUIEditor . window [ 1 ], 0.68 )
button . login = guiCreateButton ( 48 , 193 , 232 , 52 , "Zaloguj" , false , GUIEditor . window [ 1 ])
GUIEditor . label [ 1 ] = guiCreateLabel ( 80 , 255 , 172 , 15 , "Logowanie Do Frakcji By KineQ" , false , GUIEditor . window [ 1 ])
GUIEditor . label [ 2 ] = guiCreateLabel ( 71 , 45 , 188 , 47 , "Logowanie Do Frakcji Policja" , false , GUIEditor . window [ 1 ])
guiLabelSetHorizontalAlign ( GUIEditor . label [ 2 ], "center" , false )
end
)
addEventHandler ( "OnClientGUIClick" , button . login , poli1 )
Server.lua
poli = createTeam ( "Policja" , 0 , 0 , 255 )
function poli1 ( thePlayer )
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. playerName , aclGetGroup ( "Policja" ) ) then
setPlayerTeam ( thePlayer , poli )
giveWeapon ( thePlayer , 12 , 10000 )
setPedArmor ( thePlayer , 100 )
setElementModel ( thePlayer , 281 )
setElementPosition ( thePlayer , - 1615.564453125 , 681.64276123047 , 7.1875 )
setPlayerNametagColor ( thePlayer , 0 , 0 , 255 )
else
outputChatBox ( "Nie jestes pracownikiem Policji." , getRootElement ())
end
end
Za Pomoc Daje
[ Dodano : 2014-04-10, 16:50 ]
I Jeszcze jedno jak zrobi? przycisk zamknij.
Wysłany: 2014-04-10, 17:02
TheTroll
Pan Majster
Wiek: 38 Na forum: 4764 dni Posty: 219
Nick w MP: TheTroll
Piwa : 1114
Musisz poczyta? troch? o funkcji guiSetVisible kt?ra pokazuj? lub chowa gui.
Masz tutaj kod (nie testowany)
Client
Kod: GUIEditor = {
button = {},
window = {},
label = {}
}
GUIEditor.window[1] = guiCreateWindow(234, 135, 329, 279, "Logowanie Do Frakcji", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.68)
button.login = guiCreateButton(48, 193, 232, 52, "Zaloguj", false, GUIEditor.window[1])
GUIEditor.label[1] = guiCreateLabel(80, 255, 172, 15, "Logowanie Do Frakcji By KineQ", false, GUIEditor.window[1])
GUIEditor.label[2] = guiCreateLabel(71, 45, 188, 47, "Logowanie Do Frakcji Policja", false, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false)
guiSetVisible(GUIEditor.window[1], false)
function otworzGUI()
guiSetVisible(GUIEditor.window[1], true)
end
addCommandHandler ( "loginpoli", otworzGUI)
function LoginPolicja()
triggerServerEvent ("ZalogujPoli",getLocalPlayer())
end
addEventHandler("OnClientGUIClick", button.login, LoginPolicja)
Server
Kod: poli = createTeam ( "Policja", 0, 0, 255 )
function poli1 ( thePlayer )
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Policja" ) ) then
setPlayerTeam ( thePlayer, poli )
giveWeapon ( thePlayer, 12, 10000 )
setPedArmor ( thePlayer, 100 )
setElementModel ( thePlayer, 281 )
setElementPosition ( thePlayer, -1615.564453125, 681.64276123047, 7.1875 )
setPlayerNametagColor ( thePlayer, 0, 0, 255 )
else
outputChatBox( "Nie jestes pracownikiem Policji.", getRootElement())
end
end
addEvent("ZalogujPoli", true)
addEventHandler("ZalogujPoli", getRootElement(), poli1)
Wysłany: 2014-04-10, 17:48
Daisu
Programista Lua
Wiek: 26 Na forum: 4444 dni Posty: 193
SPONSOR
Nick w MP: Daisu
Piwa : 24
Nie dzia?a tak samo jak przedtem bl?dy to :
1.Gui w?ancza si? z skryptem
2.Nie Ma Kursora
3.Nie Loguje Do Teamu
PIWKO LECI
Wysłany: 2014-04-10, 19:10
TheTroll
Pan Majster
Wiek: 38 Na forum: 4764 dni Posty: 219
Nick w MP: TheTroll
Piwa : 1114
Sprawd? ten kod
Client
Kod: GUIEditor = {
button = {},
window = {},
label = {}
}
GUIEditor.window[1] = guiCreateWindow(234, 135, 329, 279, "Logowanie Do Frakcji", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.68)
buttonlogin = guiCreateButton(48, 193, 232, 52, "Zaloguj", false, GUIEditor.window[1])
GUIEditor.label[1] = guiCreateLabel(80, 255, 172, 15, "Logowanie Do Frakcji By KineQ", false, GUIEditor.window[1])
GUIEditor.label[2] = guiCreateLabel(71, 45, 188, 47, "Logowanie Do Frakcji Policja", false, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false)
guiSetVisible(GUIEditor.window[1], false)
function otworzGUI()
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addCommandHandler ( "loginpoli", otworzGUI)
function LoginPolicja(thePlayer)
if source == buttonlogin then
triggerServerEvent ( "onTeamPolicja", getLocalPlayer(), "" )
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
end
end
addEventHandler("onClientGUIClick", buttonlogin, LoginPolicja)
Server
Kod: poli = createTeam ( "Policja", 0, 0, 255 )
function poli1 ()
accountname = getAccountName (getPlayerAccount(source))
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Policja" ) ) then
setPlayerTeam ( source, poli )
giveWeapon ( source, 12, 10000 )
setPedArmor ( source, 100 )
setElementModel ( source, 281 )
setElementPosition ( source, -1615.564453125, 681.64276123047, 7.1875 )
setPlayerNametagColor ( source, 0, 0, 255 )
else
outputChatBox( "Nie jestes pracownikiem Policji.", getRootElement())
end
end
addEvent("onTeamPolicja", true)
addEventHandler("onTeamPolicja",getRootElement(), poli1)
Wysłany: 2014-04-10, 20:38
Daisu
Programista Lua
Wiek: 26 Na forum: 4444 dni Posty: 193
SPONSOR
Nick w MP: Daisu
Piwa : 24
Dzi?ki dzia?a ten 1 tylko musia?em go przerobi? a 2 te? ?miga masz 2 priwko odemnie .
Tagi: logowanie :: teamu :: gui.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: