Wysłany: 2018-02-26, 16:51
Kuks*
Wiek: 15 Na forum: 3030 dni Posty: 246
Nick w MP: Kuks*
Piwa : 2208
Siema, robi? system g?odu, ale nie wiem, co zrobi?, ?eby co 10 sekund spada? on o 10.
Kod:
glodek = setElementData ( localPlayer , "gold" , 100 )
getGlod = getElementData ( localPlayer , "gold" )
setTimer (function()
setElementData ( localPlayer , "glod" , getGlod - 10 )
end , 10 * 1000 , 0 )
Wysłany: 2018-02-26, 16:59
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
setTimer ( setElementData , 10 * 1000 , 0 , localPlayer , "glod" , getElementData ( localPlayer , "glod" ) - 10 ) Lecz takich rzeczy nie robi si? na timerach, lepiej robi? to na tickach.
Ostatnio zmieniony przez marcin778 2018-02-26, 16:59, w całości zmieniany 1 raz
Wysłany: 2018-02-26, 16:59
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4048 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
Kuks* ,
ja system robi?em za pomoc?
gdy gracz si? rusza to odejmuje elementdat?
Masz kod bo tak go nie u?ywam
hunger = getTickCount ()
addEventHandler ( "onClientRender" , root ,function()
if getTickCount () - hunger >= 100 * 30 then
if getElementData ( localPlayer , "gracz_hunger" ) then
hungertable ()
hunger = getTickCount ()
end
end
end )
controlTable = { "sprint" , "jump" , "walk" , "crouch" }
function hungertable ()
for _ , v in ipairs ( controlTable ) do
if ( getControlState ( v ) ) then
if getElementData ( localPlayer , "gracz_hunger" ) then
setElementData ( localPlayer , "gracz_hunger" , getElementData ( localPlayer , "gracz_hunger" )- 2 )
end
end
end
end
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Więcej szczegółów
Wystawiono 1 piw(a):Kuks*
Wysłany: 2018-02-26, 17:11
Kuks*
Wiek: 15 Na forum: 3030 dni Posty: 246
Nick w MP: Kuks*
Piwa : 2208
marcin778 , To nie dzia?a
[ Dodano : 2018-02-26, 17:12 ]
Barcioo , Dzi?ki, ale robi? co? takiego, ?e co 10s zabiera mu glod, ale masz piwo za ch?ci ;d
Wysłany: 2018-02-26, 17:18
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4048 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
hunger = getTickCount ()
addEventHandler ( "onClientRender" , root ,function()
if getTickCount () - hunger >= 10 * 1000 then
if getElementData ( localPlayer , "gracz_hunger" ) then
setElementData ( localPlayer , "gracz_hunger" , getElementData ( localPlayer , "gracz_hunger" )- 10 )
hunger = getTickCount ()
end
end
end )
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Wysłany: 2018-02-26, 17:19
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
setTimer (function ()
local glod = tonumber ( getElementData ( localPlayer , "glod" )) or 0
setElementData ( localPlayer , "glod" , glod - 10 )
end , 10000 , 0 )
Do zmiany element-data.
Wysłany: 2018-02-26, 17:27
Kuks*
Wiek: 15 Na forum: 3030 dni Posty: 246
Nick w MP: Kuks*
Piwa : 2208
Kalizman , To te? nie dzia?a, bo testowa?em te? tak wcze?niej.
Nie mam ju? pomys?u
Daje Wam ca?y kod, mo?e tutaj jest co? niepoprawnie =.
local markerZarcie = createMarker (- 2382.43164 , - 584.20868 , 132.11719 - 1 , "cylinder" , 1 , 32 , 102 , 23 )
blip = createBlipAttachedTo ( markerZarcie , 10 )
setBlipVisibleDistance ( blip , 500 )
local sx , sy = guiGetScreenSize ()
local px , py = ( sx / 1366 ),( sy / 768 )
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
setTimer (function ()
local glod = tonumber ( getElementData ( localPlayer , "glod" )) or 0
setElementData ( localPlayer , "glod" , glod - 10 )
end , 10000 , 0 )
setTimer (function()
wlaczone = true
end , 5000 , 0 )
addEventHandler ( "onClientRender" , root , function()
if not wlaczone then return end
if not isElementWithinMarker ( localPlayer , markerZarcie ) then showCursor ( false ) return end
dxDrawLine ( 422 - 1 * px , 177 - 1 * py , 422 - 1 * px , 576 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawLine ( 927 * px , 177 - 1 * py , 422 - 1 * px , 177 - 1 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawLine ( 422 - 1 * px , 576 * py , 927 * px , 576 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawLine ( 927 * px , 576 * py , 927 * px , 177 - 1 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawRectangle ( 422 * px , 177 * py , 505 * px , 399 * py , tocolor ( 102 , 102 , 102 , 255 ), false )
dxDrawText ( "Sklep z jedzeniem" , 560 * px , 187 * py , 789 * px , 223 * py , tocolor ( 255 , 255 , 255 , 255 ), 2.30 * px , "default" , "left" , "top" , false , false , false , false , false )
dxDrawRectangle ( 451 * px , 229 * py , 450 * px , 43 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawRectangle ( 451 * px , 282 * py , 450 * px , 43 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawRectangle ( 451 * px , 335 * py , 450 * px , 43 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawRectangle ( 549 * px , 495 * py , 237 * px , 71 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawText ( "Anuluj" , 628 * px , 511 * py , 719 * px , 548 * py , tocolor ( 255 , 255 , 255 , 255 ), 2.50 * px , "default" , "left" , "top" , false , false , false , false , false )
showCursor ( true )
if isMouseIn ( 549 , 495 , 237 , 71 ) and getKeyState ( "mouse1" ) then
wlaczone = nil
showCursor ( false )
end
end )
addEventHandler ( "onClientRender" , root , function()
local getGlod = getElementData ( localPlayer , "gold" )
dxDrawRectangle ( 0 * px , 716 * py , 312 * px , 52 * py , tocolor ( 83 , 170 , 83 , 200 ), false )
dxDrawText ( "Najedzenie: " .. getGlod , 41 * px , 723 * py , 264 * px , 758 * py , tocolor ( 0 , 0 , 0 ), 2.5 * px , "default" , "left" , "top" , false , false , false , false , false )
end )
Wysłany: 2018-02-26, 17:31
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Jakie? b??dy w debugscript 3?
[ Dodano : 2018-02-26, 17:33 ]
Mo?e dlatego nie dzia?a, poniewa? ty masz inn? element-dat? w onClientRender?
Wysłany: 2018-02-26, 17:34
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4048 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
Kuks* , a nadajesz wgl elementdate ?eby mia?o do odejmowania co?
local getGlod = getElementData ( localPlayer , "gold" ) or 0
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Wysłany: 2018-02-26, 17:37
Kuks*
Wiek: 15 Na forum: 3030 dni Posty: 246
Nick w MP: Kuks*
Piwa : 2208
Kalizman , brak, czk, sprawdze odp nizej
[ Dodano : 2018-02-26, 17:41 ]
Czekajcie, zrobi?em co?, glod by? ustawiony na -730, a po reconnect znik? mi text
kod:
local markerZarcie = createMarker (- 2382.43164 , - 584.20868 , 132.11719 - 1 , "cylinder" , 1 , 32 , 102 , 23 )
blip = createBlipAttachedTo ( markerZarcie , 10 )
setBlipVisibleDistance ( blip , 500 )
local sx , sy = guiGetScreenSize ()
local px , py = ( sx / 1366 ),( sy / 768 )
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
glodek = setElementData ( localPlayer , "gold" , 100 )
getGlod = getElementData ( localPlayer , "glod" )
setTimer (function()
setElementData ( localPlayer , "glod" , getGlod - 10 )
end , 10 * 1000 , 0 )
setTimer (function()
wlaczone = true
end , 5000 , 0 )
addEventHandler ( "onClientRender" , root , function()
if not wlaczone then return end
if not isElementWithinMarker ( localPlayer , markerZarcie ) then showCursor ( false ) return end
dxDrawLine ( 422 - 1 * px , 177 - 1 * py , 422 - 1 * px , 576 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawLine ( 927 * px , 177 - 1 * py , 422 - 1 * px , 177 - 1 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawLine ( 422 - 1 * px , 576 * py , 927 * px , 576 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawLine ( 927 * px , 576 * py , 927 * px , 177 - 1 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawRectangle ( 422 * px , 177 * py , 505 * px , 399 * py , tocolor ( 102 , 102 , 102 , 255 ), false )
dxDrawText ( "Sklep z jedzeniem" , 560 * px , 187 * py , 789 * px , 223 * py , tocolor ( 255 , 255 , 255 , 255 ), 2.30 * px , "default" , "left" , "top" , false , false , false , false , false )
dxDrawRectangle ( 451 * px , 229 * py , 450 * px , 43 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawRectangle ( 451 * px , 282 * py , 450 * px , 43 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawRectangle ( 451 * px , 335 * py , 450 * px , 43 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawRectangle ( 549 * px , 495 * py , 237 * px , 71 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawText ( "Anuluj" , 628 * px , 511 * py , 719 * px , 548 * py , tocolor ( 255 , 255 , 255 , 255 ), 2.50 * px , "default" , "left" , "top" , false , false , false , false , false )
showCursor ( true )
if isMouseIn ( 549 , 495 , 237 , 71 ) and getKeyState ( "mouse1" ) then
wlaczone = nil
showCursor ( false )
end
end )
addEventHandler ( "onClientRender" , root , function()
dxDrawRectangle ( 0 * px , 716 * py , 312 * px , 52 * py , tocolor ( 83 , 170 , 83 , 200 ), false )
dxDrawText ( "Najedzenie: " .. getGlod , 41 * px , 723 * py , 264 * px , 758 * py , tocolor ( 0 , 0 , 0 ), 2.5 * px , "default" , "left" , "top" , false , false , false , false , false )
end )
[ Dodano : 2018-02-26, 17:45 ]
Aha, mia?em liter?wk?, ale kod dalej nie dzia?a
local markerZarcie = createMarker (- 2382.43164 , - 584.20868 , 132.11719 - 1 , "cylinder" , 1 , 32 , 102 , 23 )
blip = createBlipAttachedTo ( markerZarcie , 10 )
setBlipVisibleDistance ( blip , 500 )
local sx , sy = guiGetScreenSize ()
local px , py = ( sx / 1366 ),( sy / 768 )
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
glodek = setElementData ( localPlayer , "glod" , 100 )
getGlod = getElementData ( localPlayer , "glod" )
setTimer (function()
setElementData ( localPlayer , "glod" , getGlod - 10 )
end , 10 * 1000 , 0 )
setTimer (function()
wlaczone = true
end , 5000 , 0 )
addEventHandler ( "onClientRender" , root , function()
if not wlaczone then return end
if not isElementWithinMarker ( localPlayer , markerZarcie ) then showCursor ( false ) return end
dxDrawLine ( 422 - 1 * px , 177 - 1 * py , 422 - 1 * px , 576 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawLine ( 927 * px , 177 - 1 * py , 422 - 1 * px , 177 - 1 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawLine ( 422 - 1 * px , 576 * py , 927 * px , 576 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawLine ( 927 * px , 576 * py , 927 * px , 177 - 1 * py , tocolor ( 16 , 237 , 141 , 255 ), 1 , false )
dxDrawRectangle ( 422 * px , 177 * py , 505 * px , 399 * py , tocolor ( 102 , 102 , 102 , 255 ), false )
dxDrawText ( "Sklep z jedzeniem" , 560 * px , 187 * py , 789 * px , 223 * py , tocolor ( 255 , 255 , 255 , 255 ), 2.30 * px , "default" , "left" , "top" , false , false , false , false , false )
dxDrawRectangle ( 451 * px , 229 * py , 450 * px , 43 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawRectangle ( 451 * px , 282 * py , 450 * px , 43 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawRectangle ( 451 * px , 335 * py , 450 * px , 43 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawRectangle ( 549 * px , 495 * py , 237 * px , 71 * py , tocolor ( 36 , 167 , 73 , 255 ), false )
dxDrawText ( "Anuluj" , 628 * px , 511 * py , 719 * px , 548 * py , tocolor ( 255 , 255 , 255 , 255 ), 2.50 * px , "default" , "left" , "top" , false , false , false , false , false )
showCursor ( true )
if isMouseIn ( 549 , 495 , 237 , 71 ) and getKeyState ( "mouse1" ) then
wlaczone = nil
showCursor ( false )
end
end )
addEventHandler ( "onClientRender" , root , function()
dxDrawRectangle ( 0 * px , 716 * py , 312 * px , 52 * py , tocolor ( 83 , 170 , 83 , 200 ), false )
dxDrawText ( "Najedzenie: " .. getGlod , 41 * px , 723 * py , 264 * px , 758 * py , tocolor ( 0 , 0 , 0 ), 2.5 * px , "default" , "left" , "top" , false , false , false , false , false )
end )
Wysłany: 2018-02-26, 17:45
Dexnes_
Tiger
Wiek: 26 Na forum: 4401 dni Posty: 620
Nick w MP: Dexnes
Piwa : 1394
Zastan?w si?, czy chcesz u?ywa? element daty "gold" czy "glod" - liter?wki
Wysłany: 2018-02-26, 17:47
Kuks*
Wiek: 15 Na forum: 3030 dni Posty: 246
Nick w MP: Kuks*
Piwa : 2208
Dexnes_ , No to pisa?em dopiero wy?ej xD Kod dalej nie chce mi dzia?a?.
Wysłany: 2018-02-26, 17:50
Dexnes_
Tiger
Wiek: 26 Na forum: 4401 dni Posty: 620
Nick w MP: Dexnes
Piwa : 1394
Kuks* , ustaw lepszy spos?b nadawania element daty, je?li masz panel logowania to dopisz do niego:
setElementData ( localPlayer , "gold" , 100 )
Wysłany: 2018-02-26, 19:06
Kuks*
Wiek: 15 Na forum: 3030 dni Posty: 246
Nick w MP: Kuks*
Piwa : 2208
Dexnes_ , Nie mam panelu logowania, chcia?bym to zrobi? w jednym skrypcie.
Więcej szczegółów
Wystawiono 1 piw(a):MistrzMta
Wysłany: 2018-02-26, 19:22
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
"Kuks*" napisał/a :Dexnes_ , Nie mam panelu logowania, chcia?bym to zrobi? w jednym skrypcie.
Po do??czeniu na serwer/zalogowaniu si? musisz gdzie za?adowa? ten system g?odu. Dexnes_ da? Ci tylko przyk?ad jak ma to wygl?da?
Tagi: system :: głodu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: