SenpaiDarciok
Wiek: 27 Na forum: 2321 dni Posty: 10
Nick w MP: Devon/Darecki
Przy odebraniu wyplaty kasa idzie do eq (99mln tego) a chce zeby sz?a do banku ;/
S:
local factions = {
[ "SAPD" ] = 800000 ,
[ "SAFD" ] = 800000 ,
[ "SAMD" ] = 800000 ,
[ "SARA" ] = 800000 ,
}
function getwyplata ( el , md )
local uid = getElementData ( el , "player:sid" )
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_factions WHERE sid=?" , uid )
if #result > 0 then
if factions [ result [ 1 ]. code ] then
if getElementData ( el , "player:workinjob" ) and getElementData ( el , "player:workinjob" ) >= 60 then
local money = ( factions [ result [ 1 ]. code ] * getElementData ( el , "player:workinjob" ))
local czas = getElementData ( el , "player:workinjob" )
setElementData ( el , "player:workinjob" , 0 )
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_users SET worker=? WHERE id=?" , "0" , getElementData ( el , "player:sid" ))
outputChatBox ( "Trwa przetwarzanie twoich danych..." , el )
setTimer ( function()
setElementData ( el , "player:workinjob" , 0 )
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_users SET worker=? WHERE id=?" , "0" , getElementData ( el , "player:sid" ))
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_factions SET wyplat=wyplat+?, ostatnia_wyplata=now() WHERE sid=?" , money , getElementData ( el , "player:sid" ))
outputChatBox ( "Otrzymujesz " .. money .. " PLN za przepracowane na s?u?bie " .. czas .. " minut!" , el )
givePlayerMoney ( el , money )
setElementData ( el , "player:workinjob" , 0 )
end , 5000 , 1 )
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_users SET worker=? WHERE id=?" , "0" , getElementData ( el , "player:sid" ))
setElementData ( el , "player:workinjob" , 0 )
else
outputChatBox ( "Nie masz przepracowane minimum godziny na s?u?bie!" , el )
end
else
outputChatBox ( "W twojej frakcji nie ma skonfigurowanego otrzymywania wyp?at" , el )
end
end
end
addEvent ( "getwyplata" , true )
addEventHandler ( "getwyplata" , resourceRoot , getwyplata )
C:
ww , hh = 1920 , 1080
www , hhh = guiGetScreenSize ()
w , h = ( www / ww ), ( hhh / hh )
local wyplatafont1 = dxCreateFont ( ":pseudol-nametagi/f/droid-sans.ttf" , 13 )
local wyplatafont2 = dxCreateFont ( ":pseudol-nametagi/f/droid-sans.ttf" , 17 )
local wyplatafont3 = dxCreateFont ( ":pseudol-nametagi/f/droid-sans.ttf" , 22 )
function nankymouse ( x , y , w , h )
if ( not isCursorShowing ()) then
return false
end
local mx , my = getCursorPosition ()
local fullx , fully = guiGetScreenSize ()
cursorx , cursory = mx * fullx , my * fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end
function nankyrectangle ( x , y , w , h , color )
dxDrawRectangle ( x , y , w , h , color , false )
dxDrawRectangle ( x + 2 , y - 1 , w - 4 , 1 , color , false )
dxDrawRectangle ( x + 2 , y + h , w - 4 , 1 , color , false )
dxDrawRectangle ( x - 1 , y + 2 , 1 , h - 4 , color , false )
dxDrawRectangle ( x + w , y + 2 , 1 , h - 4 , color , false )
end
local markery = {
{ 940.37 , - 1443.57 , 13.58 , 1.2 , "Odebranie wyp?aty ze s?u?by" },
}
for i , v in pairs ( markery ) do
local marker = createMarker ( v [ 1 ], v [ 2 ], v [ 3 ]- 1 , "cylinder" , v [ 4 ], 0 , 102 , 255 )
local text = createElement ( "text" )
setElementData ( text , "name" , v [ 5 ])
setElementDimension ( text , 1 )
setElementDimension ( marker , 1 )
setElementPosition ( text , v [ 1 ], v [ 2 ], v [ 3 ])
panel = false
function wyplatagui ()
nankyrectangle ( 658 * w , 292 * h , 604 * w , 497 * h , tocolor ( 0 , 0 , 0 , 162 ), false )
nankyrectangle ( 658 * w , 269 * h , 604 * w , 27 * h , tocolor ( 0 , 0 , 255 , 255 ), false )
dxDrawText ( "Panel odbierania wyp?at frakcyjnych" , 659 * w , 270 * h , 1262 * w , 296 * h , tocolor ( 255 , 255 , 255 , 255 ), 1 * w , wyplatafont1 , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Tutaj mo?esz odebra? wyp?at? frakcyjn?.\n\nAby dokona? wyp?aty wci?nij przycisk wyp?a?.\nAby zamkn?? panel wyp?at wci?nij przycisk zamknij panel." , 669 * w , 480 * h , 1252 * w , 461 * h , tocolor ( 255 , 255 , 255 , 255 ), 1 * w , wyplatafont2 , "center" , "center" , false , false , false , false , false )
if nankymouse ( 679 * w , 655 * h , 215 * w , 110 * h ) then nankyrectangle ( 679 * w , 655 * h , 215 * w , 110 * h , tocolor ( 0 , 0 , 255 , 150 ), false ) else nankyrectangle ( 679 * w , 655 * h , 215 * w , 110 * h , tocolor ( 0 , 0 , 255 , 255 ), false ) end
if nankymouse ( 1027 * w , 655 * h , 215 * w , 110 * h ) then nankyrectangle ( 1027 * w , 655 * h , 215 * w , 110 * h , tocolor ( 0 , 0 , 255 , 150 ), false ) else nankyrectangle ( 1027 * w , 655 * h , 215 * w , 110 * h , tocolor ( 0 , 0 , 255 , 255 ), false ) end
dxDrawText ( "Wyp?a?" , 679 * w , 655 * h , 894 * w , 765 * h , tocolor ( 255 , 255 , 255 , 255 ), 1 * w , wyplatafont3 , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Zamknij\npanel" , 1027 * w , 655 * h , 1242 * w , 765 * h , tocolor ( 255 , 255 , 255 , 255 ), 1 * w , wyplatafont3 , "center" , "center" , false , false , false , false , false )
end
function uruchom ( el , md )
if el ~= localPlayer then return end
if panel == false then
addEventHandler ( "onClientRender" , root , wyplatagui )
czas = getTickCount ()
panel = true
showCursor ( true )
end
end
addEventHandler ( 'onClientMarkerHit' , marker , uruchom )
function closepanel ( button , state )
if panel and button == "left" and state == "down" then
if nankymouse ( 1027 * w , 655 * h , 215 * w , 110 * h ) then
removeEventHandler ( "onClientRender" , root , wyplatagui )
panel = false
showCursor ( false )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), closepanel )
function getwyplata ( button , state )
if panel and button == "left" and state == "down" then
if nankymouse ( 679 * w , 655 * h , 215 * w , 110 * h ) then
triggerServerEvent ( "getwyplata" , root , localPlayer )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), getwyplata )
end