Wysłany: 2018-02-06, 07:33
Husky123
Wiek: 20 Na forum: 3320 dni Posty: 45
Nick w MP: fabeN
Piwa : 750
Jak naprawi? prace na gm OwnWorld ?
Kiedy w chodze w marker to pojawia mi Si? "Rozpocznij Prace" klikam i mam wybra? poziom po czym klikam na poziom i mi nie rozpoczynam pracy, jak to naprawi? ?
oto kod:
--[[
autor : Asper & Payro
for: Own World
All rights reserved !
]]
local screenW , screenH = guiGetScreenSize ()
local sx , sy = guiGetScreenSize ()
function isMouseIn ( psx , psy , pssx , pssy , abx , aby )
if not isCursorShowing () then return end
cx , cy = getCursorPosition ()
cx , cy = cx * sx , cy * sy
if cx >= psx and cx <= psx + pssx and cy >= psy and cy <= psy + pssy then
return true , cx , cy
else
return false
end
end
local showed = false
local showed2 = false
addEvent ( "onPlayerStartJob" , true )
addEvent ( "onPlayerResign" , true )
addEvent ( "onClientPlayerPayday" , true )
local top = {}
addEvent ( "createJobsWindow" , true )
addEventHandler ( "createJobsWindow" , root , function( det )
details = det
addEventHandler ( "onClientRender" , root , guiPrace )
showCursor ( true )
showed = true
end )
addEvent ( "destroyJobsWindow" , true )
addEventHandler ( "destroyJobsWindow" , root , function()
removeEventHandler ( "onClientRender" , root , guiPrace )
removeEventHandler ( "onClientRender" , root , guiLevels )
showCursor ( false )
showed = false
end )
local r , g , b = 50 , 50 , 50
local lvl_text = ""
function guiPrace ()
local b = "Zatrudnij si?"
if getElementData ( localPlayer , "user:job" ) == details [ 2 ] then
b = "Zwolnij si?"
end
exports [ "buttons" ]: createCustomWindow ( "Panel pracy" , screenW * 0.3599 , screenH * 0.2417 , screenW * 0.2802 , screenH * 0.5176 , tocolor ( 255 , 255 , 255 , 255 ), false )
-- exports [ "buttons" ]: createCustomText ( "Ranking pracy:\n" .. table . concat ( details [ 3 ], "\n" ), screenW * 0.3510 , screenH * 0.2489 , screenW * 0.6490 , screenH * 0.5815 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , font , "center" , "center" , false , true , false , false , false )
exports [ "buttons" ]: createCustomButton ( b , screenW * 0.4130 , screenH * 0.61 , screenW * 0.1740 , screenH * 0.0565 , tocolor ( 255 , 255 , 255 , 255 ), false )
exports [ "buttons" ]: createCustomButton ( "Anuluj" , screenW * 0.4130 , screenH * 0.67 , screenW * 0.1740 , screenH * 0.0565 , tocolor ( 255 , 255 , 255 , 255 ), false )
end
function guiLevels ()
exports [ "buttons" ]: createCustomWindow ( "Wybierz poziom" , screenW * 0.3599 , screenH * 0.2417 , screenW * 0.2802 , screenH * 0.5176 , tocolor ( 255 , 255 , 255 , 255 ), false )
-- texty leveli
if isMouseIn ( screenW * 0.4323 , screenH * 0.4796 , screenW * 0.1354 , screenH * 0.0426 ) then
lvl_text = details [ 4 ]
elseif isMouseIn ( screenW * 0.4323 , screenH * 0.5269 , screenW * 0.1354 , screenH * 0.0426 ) then
lvl_text = details [ 5 ]
elseif isMouseIn ( screenW * 0.4323 , screenH * 0.5741 , screenW * 0.1354 , screenH * 0.0426 ) then
lvl_text = details [ 6 ]
end
--
exports [ "buttons" ]: createCustomText ( "Opis poziomu:\n" .. lvl_text , screenW * 0.3510 , screenH * 0.1989 , screenW * 0.6490 , screenH * 0.5815 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , font , "center" , "center" , false , true , false , false , false )
-- 3 levele
exports [ "buttons" ]: createCustomButton ( "Poziom 1" , screenW * 0.4323 , screenH * 0.4796 , screenW * 0.1354 , screenH * 0.0426 , tocolor ( 255 , 255 , 255 , 255 ), tocolor ( r , g , b ))
exports [ "buttons" ]: createCustomButton ( "Poziom 2" , screenW * 0.4323 , screenH * 0.5269 , screenW * 0.1354 , screenH * 0.0426 , tocolor ( 255 , 255 , 255 , 255 ), tocolor ( r , g , b ))
exports [ "buttons" ]: createCustomButton ( "Poziom 3" , screenW * 0.4323 , screenH * 0.5741 , screenW * 0.1354 , screenH * 0.0426 , tocolor ( 255 , 255 , 255 , 255 ), tocolor ( r , g , b ))
--
exports [ "buttons" ]: createCustomButton ( "Anuluj" , screenW * 0.4130 , screenH * 0.67 , screenW * 0.1740 , screenH * 0.0565 , tocolor ( 255 , 255 , 255 , 255 ), false )
end
addEventHandler ( "onClientClick" , root , function( btn , state )
if btn == "left" and state == "down" then
if isMouseIn ( screenW * 0.4130 , screenH * 0.61 , screenW * 0.1740 , screenH * 0.0565 ) and showed then
if getElementData ( localPlayer , "user:job" ) and getElementData ( localPlayer , "user:job" ) == details [ 2 ] then
endJob ()
else
acceptJob ()
end
elseif isMouseIn ( screenW * 0.4130 , screenH * 0.67 , screenW * 0.1740 , screenH * 0.0565 ) and showed2 then
removeEventHandler ( "onClientRender" , root , guiLevels )
showed2 = false
showCursor ( false )
elseif isMouseIn ( screenW * 0.4130 , screenH * 0.67 , screenW * 0.1740 , screenH * 0.0565 ) and showed then
removeEventHandler ( "onClientRender" , root , guiPrace )
showed = false
showCursor ( false )
elseif isMouseIn ( screenW * 0.4323 , screenH * 0.4796 , screenW * 0.1354 , screenH * 0.0426 ) and showed2 then
startJob ( 1 )
elseif isMouseIn ( screenW * 0.4323 , screenH * 0.5269 , screenW * 0.1354 , screenH * 0.0426 ) and showed2 then
startJob ( 2 )
elseif isMouseIn ( screenW * 0.4323 , screenH * 0.5741 , screenW * 0.1354 , screenH * 0.0426 ) and showed2 then
startJob ( 3 )
end
end
end )
function startJob ( lvl )
if lvl == 1 then
if details [ 10 ] ~= true then
if getElementData ( localPlayer , "user:pj" .. details [ 10 ]) and getElementData ( localPlayer , "user:pj" .. details [ 10 ]) ~= 1 then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. " .. details [ 10 ])
return
end
end
if getElementData ( localPlayer , details [ 13 ]) < details [ 7 ] then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz " .. details [ 7 ].. " punkt?w" )
return
end
elseif lvl == 2 then
if details [ 11 ] ~= true then
if getElementData ( localPlayer , "user:pj" .. details [ 11 ]) and getElementData ( localPlayer , "user:pj" .. details [ 11 ]) ~= 1 then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. " .. details [ 11 ])
return
end
end
if getElementData ( localPlayer , details [ 13 ]) < details [ 8 ] then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz " .. details [ 8 ].. " punkt?w" )
return
end
elseif lvl == 3 then
if details [ 12 ] ~= true then
if getElementData ( localPlayer , "user:pj" .. details [ 12 ]) and getElementData ( localPlayer , "user:pj" .. details [ 12 ]) ~= 1 then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz prawo jazdy kat. " .. details [ 12 ])
return
end
end
if getElementData ( localPlayer , details [ 13 ]) < details [ 9 ] then
exports [ "rpg_noti" ]: createNotification ( "error" , "Aby pracowa? na tej pracy potrzebujesz " .. details [ 9 ].. " punkt?w" )
return
end
end
setElementData ( localPlayer , "user:job" , details [ 2 ])
triggerEvent ( "onPlayerStartJob" , localPlayer , details [ 2 ], lvl )
triggerServerEvent ( "onPlayerStartJob" , localPlayer , details [ 2 ], lvl )
removeEventHandler ( "onClientRender" , root , guiLevels )
showed2 = false
showCursor ( false )
end
function acceptJob ()
removeEventHandler ( "onClientRender" , root , guiPrace )
showCursor ( false )
showed = false
if not getElementData ( localPlayer , "user:job" ) or getElementData ( localPlayer , "user:job" ) == 0 then
showCursor ( true )
showed2 = true
addEventHandler ( "onClientRender" , root , guiLevels )
else
exports . rpg_noti : createNotification ( "error" , "Posiadasz ju? inn? prac?, aby si? z niej zwolnij wpisz /zrezygnuj" )
end
end
addEvent ( "acceptJob" , true )
addEventHandler ( "acceptJob" , root , acceptJob )
function endJob ()
triggerServerEvent ( "playerResign" , localPlayer , localPlayer , true )
end
addEvent ( "jobResign" , true )
addEventHandler ( "jobResign" , root , endJob )
Wysłany: 2018-02-06, 12:23
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
Jakie? b??dy w debugscript 3?
Wysłany: 2018-02-06, 23:26
Husky123
Wiek: 20 Na forum: 3320 dni Posty: 45
Nick w MP: fabeN
Piwa : 750
"Ciastuu?" napisał/a :Jakie? b??dy w debugscript 3?
Przepraszam za d?ug? odpowiedz ale sprawy prywatne oto debugscript 3
Wysłany: 2018-02-07, 01:05
psychol.
Wiek: 23 Na forum: 3502 dni Posty: 225
Nick w MP: psychol.
Piwa : 2998
Fajnie ?e Payro podpisa? si? pod moj? prac?, pierwszy raz widz? ?e to zrobi?, jak wida? niewychowane to. Co do skryptu, z tego co mi si? wydaj? nie masz nadanej element-daty, wi?c jest na "false" i wyskakuje error, wydaje mi si? ?e w skrypcie z prac? jest wpisana z?a zmienna.
Wysłany: 2018-02-07, 10:31
Husky123
Wiek: 20 Na forum: 3320 dni Posty: 45
Nick w MP: fabeN
Piwa : 750
"Asper" napisał/a :Fajnie ?e Payro podpisa? si? pod moj? prac?, pierwszy raz widz? ?e to zrobi?, jak wida? niewychowane to. Co do skryptu, z tego co mi si? wydaj? nie masz nadanej element-daty, wi?c jest na "false" i wyskakuje error, wydaje mi si? ?e w skrypcie z prac? jest wpisana z?a zmienna.
A Asper m?g? by? poda? jak powninen by? wpisany skrypt bym by? wdzi?czny !
Tagi: prace :: ownworld
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: