Wysłany: 2017-07-15, 15:20
MicHaLeQZ
Wiek: 37 Na forum: 3595 dni Posty: 5
Nick w MP: RussianDoge
GUIEditor = {
button = {},
window = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
GUIEditor . window [ 1 ] = guiCreateWindow ( 0 , 343 , 130 , 213 , "Rozpocz?cie pracy" , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
guiSetAlpha ( GUIEditor . window [ 1 ], 1.00 )
guiSetProperty ( GUIEditor . window [ 1 ], "CaptionColour" , "FF0101FC" )
GUIEditor . button [ 1 ] = guiCreateButton ( 18 , 153 , 95 , 50 , "Rozpocz?cie pracy" , false , GUIEditor . window [ 1 ])
end
local marker = createMarker ( 2327.13 , 2535.24 , 1027.81 , 'cylinder' , 1.5 , 0 , 50 , 255 , 255 )
setElementInterior ( marker , 0 )
local licz = {}
local t = createElement ( 'text' )
setElementData ( t , 'name' , 'San Andreas Police Department\n Praca Policjanta' )
setElementInterior ( t , 0 )
setElementPosition ( t , 2327.13 , 2535.24 , 1027.81 )
local Panel = guiCreateWindow ( 565 , 271 , 336 , 207 , "Rozpocz?cie pracy" , false )
guiWindowSetSizable ( Panel , false )
local panel2 = guiCreateButton ( 9 , 31 , 137 , 67 , "Rozpocz?cie\npracy" , false , Panel
end
guiWindowSetSizable ( Panel , true )
guiSetVisible ( Panel , true )
showCursor ( true )
end
addEventHandler ( "onClientMarkerHit" , marker , open_panel )
function Close_panel ( thePlayer )
guiWindowSetSizable ( panel , false )
guiSetVisible ( panel2 , false )
showCursor ( false )
end
addEventHandler ( "onClientMarkerLeave" , marker , Close_panel )
----------------------------
function isPlayerInPoliceFaction ( 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;' , "SAPD" , uid )
if result [ 1 ] then
return true
else
return false
end
addEventHandler ( 'onMarkerHit' , marker , function( el , md )
if isPlayerInPoliceFaction ( el ) then
if getElementData ( hitElement , "player:duty" ) == "SAPD" then
if not getElementData ( el , 'player:duty' ) then
setElementModel ( el , 280 )
exports [ 'frakcja' ]: rozpocznijnaliczanie ( el )
setElementData ( el , 'player:duty' , 'SAPD' )
local rank = exports [ 'frakcja' ]: getPlayerFactionRank ( el , 'SAPD' )
setElementData ( el , "player:rank" , rank )
giveWeapon ( el , 23 , 9999 )
giveWeapon ( el , 22 , 9999 )
setElementData ( el , "last:nick" , getPlayerName ( el ))
setElementData ( el , "last:color" , tostring ( getPlayerNametagColor ( el )))
setPlayerName ( el , "#0000CD" .. getPlayerName ( el ): gsub ( "#%x%x%x%x%x%x" , "" ))
executeCommandHandler ( "setblipcolor" , el , 0 , 0 , 205 )
else
takeWeapon ( el , 23 )
takeWeapon ( el , 22 )
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" ))
executeCommandHandler ( "setblipcolor" , el , 255 , 255 , 255 )
end
else
outputChatBox ( '* Nie jeste? zatrudniony jako SAPD.' , el , 255 , 0 , 0 )
end
end )
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
local bronie2 = createMarker (- 1612.94 , 695.85 , 13.90 - 0.90 , "cylinder" , 1.0 , 0 , 0 , 0 , 255 )
setElementDimension ( bronie2 , 0 )
setElementInterior ( bronie2 , 0 )
local t = createElement ( "text" )
setElementData ( t , "name" , "WYPOSA?ENIE\nSAPD\nOBOWI?ZKOWE" )
setElementPosition ( t ,- 1612.94 , 695.85 , 13.90 - 0.5 )
setElementDimension ( t , 0 )
setElementInterior ( t , 0 )
end
end [color=yellow][/color]
Wysłany: 2017-07-15, 15:23
BoCzKu
Mapper & Lua
Wiek: 24 Na forum: 3465 dni Posty: 87
Nick w MP: BoKu
Piwa : 331
Wysłany: 2017-07-15, 15:46
Szymczu
Programista bo tak
Wiek: 27 Na forum: 3434 dni Posty: 194
Nick w MP: Szymczu
Piwa : 36
Stawiasz za du?o end'?w
GUIEditor = {
button = {},
window = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot , function()
GUIEditor . window [ 1 ] = guiCreateWindow ( 0 , 343 , 130 , 213 , "Rozpocz?cie pracy" , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
guiSetAlpha ( GUIEditor . window [ 1 ], 1.00 )
guiSetProperty ( GUIEditor . window [ 1 ], "CaptionColour" , "FF0101FC" )
GUIEditor . button [ 1 ] = guiCreateButton ( 18 , 153 , 95 , 50 , "Rozpocz?cie pracy" , false , GUIEditor . window [ 1 ])
end )
local marker = createMarker ( 2327.13 , 2535.24 , 1027.81 , 'cylinder' , 1.5 , 0 , 50 , 255 , 255 )
setElementInterior ( marker , 0 )
local licz = {}
local t = createElement ( 'text' )
setElementData ( t , 'name' , 'San Andreas Police Department\n Praca Policjanta' )
setElementInterior ( t , 0 )
setElementPosition ( t , 2327.13 , 2535.24 , 1027.81 )
local Panel = guiCreateWindow ( 565 , 271 , 336 , 207 , "Rozpocz?cie pracy" , false )
guiWindowSetSizable ( Panel , false )
local panel2 = guiCreateButton ( 9 , 31 , 137 , 67 , "Rozpocz?cie\npracy" , false , Panel
guiWindowSetSizable ( Panel , true )
guiSetVisible ( Panel , true )
showCursor ( true )
end
addEventHandler ( "onClientMarkerHit" , marker , open_panel )
function Close_panel ( thePlayer )
guiWindowSetSizable ( panel , false )
guiSetVisible ( panel2 , false )
showCursor ( false )
end
addEventHandler ( "onClientMarkerLeave" , marker , Close_panel )
----------------------------
function isPlayerInPoliceFaction ( 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;' , "SAPD" , uid )
if result [ 1 ] then return true
else return false
end
addEventHandler ( 'onMarkerHit' , marker , function( el , md )
if isPlayerInPoliceFaction ( el ) then
if getElementData ( hitElement , "player:duty" ) == "SAPD" then
if not getElementData ( el , 'player:duty' ) then
setElementModel ( el , 280 )
exports [ 'frakcja' ]: rozpocznijnaliczanie ( el )
setElementData ( el , 'player:duty' , 'SAPD' )
local rank = exports [ 'frakcja' ]: getPlayerFactionRank ( el , 'SAPD' )
setElementData ( el , "player:rank" , rank )
giveWeapon ( el , 23 , 9999 )
giveWeapon ( el , 22 , 9999 )
setElementData ( el , "last:nick" , getPlayerName ( el ))
setElementData ( el , "last:color" , tostring ( getPlayerNametagColor ( el )))
setPlayerName ( el , "#0000CD" .. getPlayerName ( el ): gsub ( "#%x%x%x%x%x%x" , "" ))
executeCommandHandler ( "setblipcolor" , el , 0 , 0 , 205 )
else
takeWeapon ( el , 23 )
takeWeapon ( el , 22 )
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" ))
executeCommandHandler ( "setblipcolor" , el , 255 , 255 , 255 )
end
else
outputChatBox ( '* Nie jeste? zatrudniony jako SAPD.' , el , 255 , 0 , 0 )
end
end )
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
local bronie2 = createMarker (- 1612.94 , 695.85 , 13.90 - 0.90 , "cylinder" , 1.0 , 0 , 0 , 0 , 255 )
setElementDimension ( bronie2 , 0 )
setElementInterior ( bronie2 , 0 )
local t = createElement ( "text" )
setElementData ( t , "name" , "WYPOSA?ENIE\nSAPD\nOBOWI?ZKOWE" )
setElementPosition ( t ,- 1612.94 , 695.85 , 13.90 - 0.5 )
setElementDimension ( t , 0 )
setElementInterior ( t , 0 )
Wysłany: 2017-07-15, 15:49
BoCzKu
Mapper & Lua
Wiek: 24 Na forum: 3465 dni Posty: 87
Nick w MP: BoKu
Piwa : 331
W linijce 27 jest te? b??d...
Zamie?
local panel2 = guiCreateButton ( 9 , 31 , 137 , 67 , "Rozpocz?cie\npracy" , false , Panel
Na
local panel2 = guiCreateButton ( 9 , 31 , 137 , 67 , "Rozpocz?cie\npracy" , false , Panel )
Niby ma?y b??d, lecz chwilka nie uwagi i skrypt le?y ;D
Wysłany: 2017-07-15, 17:21
MicHaLeQZ
Wiek: 37 Na forum: 3595 dni Posty: 5
Nick w MP: RussianDoge
"BoCzKu" napisał/a :W linijce 27 jest te? b??d...
Zamie?
local panel2 = guiCreateButton ( 9 , 31 , 137 , 67 , "Rozpocz?cie\npracy" , false , Panel
Na
local panel2 = guiCreateButton ( 9 , 31 , 137 , 67 , "Rozpocz?cie\npracy" , false , Panel )
Niby ma?y b??d, lecz chwilka nie uwagi i skrypt le?y ;D
Tylo ten kod mia? za zadanie otwiera? GUI do rozpoczynania pracy we frakcji SAPD. Prosze o poprawienie kodu aby dzia?a? w ten spos?b.
Za pomoc przy tym kodzie daje Respekt oraz stawiam zimne
Wysłany: 2017-07-15, 19:15
BoCzKu
Mapper & Lua
Wiek: 24 Na forum: 3465 dni Posty: 87
Nick w MP: BoKu
Piwa : 331
To ponawiam pytanie, Jakie? b??dy w DB3?
Wysłany: 2017-07-15, 19:17
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
MicHaLeQZ , dodaj warunek, kt?ry sprawdza czy policjant jest wpisany w frakcji w evencie on marker hit
Tagi: nie :: działające :: gui :: prosze :: poprawienie :: kodu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: