Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: punkty
1. Punkty SRP nie aktualizuja sie w db
witam
Problem wyglada tak ?e w pracach normalnie zdobywa sie srp i gdzies to sie zapisuje i widac przybywajace srp na scoreboardzie ale po reconnecie caly progres znika chyba ze uzyje komendy /dodajsrp wtedy db ?apie to i nadpisuje sobie i dziala normalnie.
2. losowe punkty
zrobi?em losowe punkty na stronie clienta i inny gracz ich nie widz?c a przypadkiem wje?dzaj?c w nie zalicza mi je i wie kto? jak to zabezpieczy??
[code] punktyXD = {
{1992.35, -1465.86, 13.39},
{1954.50, -1460.01, 13.38},
{1932.05, -1467.79, 13.38},
}

function XD ()
outputChatBox(" rozpoczynasz ")
local rand = math.random(1, #punktyXD)
jobMarker = createMarker(punktyXD[rand][1],punktyXD[rand][2], punktyXD[rand][3]-.9, "cylinder", 3.2, 255, 0, 0, 80)
jobBlip = createBlipAttachedTo(jobMarker, 12)
addEventHandler("onClientMarkerHit", jobMarker, XD2)
end
onClientMarkerHit
function XD2 ()
outputChatBox(" 1/3 ")
destroyElement(jobMarker)
destroyElement(jobBlip)
local rand = math.random(1, #punktyXD)
jobMarker2 = createMarker(punktyXD[rand][1],punktyXD[rand][2], punktyXD[rand][3]-.9, "cylinder", 3.2, 255, 0, 0, 80)
jobBlip2 = createBlipAttachedTo(jobMarker2, 12)
addEventHandler("onClientMarkerHit", jobMarker2, XD3)
end

function XD3 ()
outputChatBox(" 2/3 ")
destroyElement(jobMarker2)
destroyElement(jobBlip2)
local rand = math.random(1, #punktyXD)
jobMarker3 = createMarker(punktyXD[rand][1],punktyXD[rand][2], punktyXD[rand][3]-.9, "cylinder", 3.2, 255, 0, 0, 80)
jobBlip3 = createBlipAttachedTo(jobMarker3, 12)
addEventHandler("onClientMarkerHit", jobMarker3, WRACAMdoBA...
3. Randomowe punkty w Dx
Witam, ot?? totalnie nie mam pomys?u, jak zrobi? randomowe punkty w dxDrawImage.
Tutaj tabela punkt?w
local mousePoints = {
{
screenW 0.3932screenH 0.4787screenW 0.0323screenH 0.0509},
{
screenW 0.4516screenH 0.5213screenW 0.0323screenH 0.0509},
{
screenW 0.5495screenH 0.5528screenW 0.0323screenH 0.0509},
{
screenW 0.5969screenH 0.5065screenW 0.0198screenH 0.0296},
}
target=0

Tutaj kod na punkty. Chcia?bym go nieco przerobi?, by punkty by?y losowane z tabeli wy?ej
            addEventHandler("onClientRender"root, function()
                if 
getElementData(localPlayer"kopalnia:zakonczono"then return end                
                dxDrawImage
(mousePoints[target][1], mousePoints[target][2], mousePoints[target][3], mousePoints[target][4],"kolo.png")
            
end)

Za pomoc zimne :piwo: :piwo: :piwo:
4. Jak przerobic skrypt by naliczał punkty na wodzie
Witam mam prace sweepery i chcialbym ja przerobic by naliczala punkty na wodzie jako zlowione ryby za kazdym razem jak wszystko ustawiam to nie nalicza w wodzie ale na drodze juz tak... wie ktos moze jak to naprawic? bardzo bym byl wdzieczny pozdrawiam

Kod od strony serwera

[lua]local money = math.random(10000,11000) -- ile dostajesz za 1 kg
createBlip(1102.49, -1219.21, 17.80, 46,2,0,0,0,0,0,275)

local code="Sweepers" -- kod pracy
local jobOnline=true -- czy praca w??czona
local jobVehicles = { -- pozycj? pojazd?w
{574, 1086.12, -1220.24, 17.7, 180.0, 180.0, 180.0},
{574, 1090.29, -1220.18, 17.7, 180.0, 180.0, 180.0},
{574, 1094.04, -1220.20, 17.7, 180.0, 180.0, 180.0},
{574, 1098.57, -1219.85, 17.7, 180.0, 180.0, 180.0},
{574, 1103.57, -1220.07, 17.7, 180.0, 180.0, 180.0},
{574, 1108.86, -1219.98, 17.7, 180.0, 180.0, 180.0},
}

local text = createElement("text")
setElementData(text,"name", "Punkt rozladowania")
setElementPosition(text,800.52, -2097.87, 1.77)
for i,v in ipairs(jobVehicles) do
local veh=createVehicle(v[1], v[2], v[3], v[4], v[5], v[6], v[7])
setVehicleRespawnPosition(veh, v[2], v[3], v[4], v[5], v[6], v[7])
setElementData(veh,"vehicle:desc","?owienie Ryb")
setElementData(veh,"vehicle:mileage", math.random(1000,50000))
setElementData(veh,"vehicle:fuel",false)
setElementData(veh,"vehicle:praca",true)
setElementData(veh,"vehi...
5. Punkty, na listonoszu
Witam ot?? chcia?bym by kto? pom?g?, chcia?bym co? w tym stylu, jak rozpoczn? prac?, to wje?d?am do punktu, po czym teleportuje mnie na miejsce, ja bym chcia?, by np trzeba by?o do 10 punkt?w wjecha? i dopiero teleportacja na baz?.

kod
c.lua
[lua]--PRACA DORYWCZA BY ADIKOO1302--
--Autorem skryptu jest Adikoo1302--
--Pomagali mi nanKy, NeQ.--
--Zakazuj? udost?pniania oraz zmiany autora--
--Zakazuj? edycji kodu do 5 linijki--

--SKALOWANIE GUI--
local screenW, screenH = guiGetScreenSize()
local w, h = (screenW/1280), (screenH/1024)
--------------------------------------------
local job_marker = createMarker(-2520.834960937, -623.51525878906, 131.75, "cylinder", 1, 252, 69, 45)
--------------------------------------------
local guion = false
job_activate = false
--------------------------------------------
local target_possition = {
{-2106.9226074219, -757.84686279297, 31.75},
{-2286.3168945313, -13.998096466064, 34.75},
{-2098.3623046875, 855.49481201172, 68.75}
}

function isMouseInPosition ( x, y, width, height )
if ( not isCursorShowing( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end

function job_gui()
dxDrawImage(450*w, 300*h, 453*w, 420*h, "images/backgr...
6. Nie pokazują się punkty
Siema tak jak w temacie postawie piwo

function displayNextCP(el,md)
    if 
el~=localPlayer or not md then return end
    
if not getPedOccupiedVehicle(elthen return end
    
if jobTarget #jobPoints then
        
jobTarget=1
        showMarker
()
        
jobTarget=jobTarget+1
        showMarker
()
        
jobTarget=1
        showMarker
()
        if 
getElementData(localPlayer,"player:premiumpp"then -- z premk?
        
zarobek math.random(2500000,3000000) -- hajs ustal sam
        exports
.noti:showBox("error","Za piel?gnacje ro?lin otrzymujesz "..zarobek.." PLN")
        
triggerServerEvent("givePlayerMoney"localPlayerzarobek0)  
        else
        
zarobek math.random(2000000,2500000) -- bez premki hajs ustal sam
        exports
.noti:showBox("error","Za piel?gnacje ro?lin otrzymujesz "..zarobek.." PLN")
        
triggerServerEvent("givePlayerMoney"localPlayerzarobek0)
    
end
end
7. Wypłata z pracy i punkty GP
Witam ot?? mam taki problem ze za jedno paczk? powinno mi dawa? 15 euro + 1 GP
i pieni?dze si? powinny odbiera? w urz?dzie a GP powinno dawa? odrazu a nie daje.
[b]Kawa?ek kodu(c)[/b]
[lua]
destroyElement(blip)
setElementFrozen(el, true)
setTimer(function()
setElementFrozen(el, false)
outputChatBox("[ Informacja ] Skrzynia dostarczona, swoje pieni?dze mo?esz odebra? w urzedzie.( +15 euro oraz 1 GP )")
destroyElement(skrzynia)
destroyElement(cel)
setPedAnimation(localPlayer, false)
toggleControl("sprint", true)
setElementData(el, "gracz_praca", false)
local pkt = getElementData(el, "szacunek")
local wyplata = getElementData(el,"gracz_wyplata")
setElementData(el,"gracz_wyplata", wyplata + 15)
setElementData(el, "szacunek", pkt + 1)
end, 9000, 1)
end)
else
outputChatBox(" Posiadasz aktywn? prac?.")
end
end)
[/lua]
[b]Kod na wyp?aty w urz?dzie(s)[/b]
[lua]
local wyplaty = createMarker(-169.84,-6694.25,14.24, "cylinder", 2.0, 255, 0, 0, 0)
setElementDimension(wyplaty, 0)
setElementInterior(wyplaty, 0)

function Wyplatyxd(source)
if getElementType(source) ~= "player" then return end
local pieniadze = getElementData(sourc...
8. Punkty doświadczenia
[lua]local marker = createMarker( 2483.181640625,-1667.2297363281,12.34375,"cylinder", 1.2, 0,0,0,200 )

local marker2 = createMarker(2472.7873535156,-1666.2014160156,12.311030387878, "cylinder", 4.5, 0,0,0,200)

local paczka = {}

local poziom = nil

addEventHandler("onResourceStart", root, function()

for k,v in pairs(getElementsByType("player")) do

bindKey(v, "h", "down", paczka1, v)
bindKey(v, "h", "down", usuwanie, v)

end
end)

function paczka1 ( thePlayer )

if isElementWithinMarker( thePlayer, marker ) then

local x,y,z = getElementPosition( thePlayer )
paczka[thePlayer] = createObject(1220, x,y,z)
attachElements( paczka[thePlayer], thePlayer, 0,0.6,0.6)
setPedAnimation(thePlayer, "CARRY", "liftup")
setTimer(function()
setPedAnimation( thePlayer, "CARRY", "crry_prtial", 1, true)
end,800,1)
setElementCollisionsEnabled(paczka[thePlayer], false)
toggleControl(thePlayer, "enter_exit", false)
toggleControl(thePlayer, "sprint", false)
toggleControl(thePlayer, "crouch", false)
setElementData(thePlayer, "praca:paczki", true)


end

end

function usuwanie (thePlayer)

if isElementWithinMarker( thePlayer, marker2 ) then
if paczka[thePlayer] and isElement(paczka[thePlayer]) then
...
9. Punkty
Witam. Jak zrobi? np. poziomy pracy? Punkty do?wiadczenia itd.
10. Mechanik punkty brania kół
Witam pobra?em i skonfigurowa?em skrypt mechanika.
Mechanik znajduje sie w sf DOHERTY.
Rozpoczecie pracy dziala, naprawa pojazdow dzialaja poprawnie lecz gdy wchodz? w marker do brania k?? nic si? nie dzieje...
Prosz? o pomoc!

Kod:
[code]--[[
@author Lukasz Biegaj <[email protected]>
@author Karer <[email protected]>
@author RacheT <[email protected]>
@copyright 2011-2013 Lukasz Biegaj <[email protected]>
@license Dual GPLv2/MIT
@package MTA-XyzzyRP
@link https://github.com/lpiob/MTA-XyzzyRP GitHub
]]--



-- uniwersalny kod wspoldzielony pomiedzy warsztatami

createBlip(-2035.08, 174.56, 28.84, 27, 2, 255, 0, 0, 255, 0, 400)

local strefyNapraw={

--Doherty
warsztatIdlewoodStanowsko11={
cuboid={-2056.70, 176.37, 28.00, 9.80, 5.50, 5.20 },-- cuboid w ktorym musi znalezc sie pojazd
mpos={-2050.63, 175.93, 28.00-0.3}, -- pozycja markera w ktorym gracz bedzie stal aby naprawiac
faction_id=3, -- id frakcji ktora ma do tego dostep
},
--Doherty
warsztatIdlewoodStanowsko12={
cuboid={-2056.72, 168.30, 28.00, 9.80, 5.50, 5.20 },-- cuboid w ktorym musi znalezc sie pojazd
mpos={-2050.12, 167.96, 28.00-0.3}, -- pozycja markera w ktorym gracz bedzie stal aby naprawiac
faction_id=3, -- id frakcji ktora ma do tego dostep
},
}

for i,v in pairs(strefyNapraw) do
v.cs=createColCuboid(unpack(v.cuboid))
css=createColCuboid( -2304.94, -124.98, 35.32, 10.0 )
v.marker=createMar...
11. Punkty
Dzie?dobry lub Dzie?dobry wiecz?r zale?y w jakiej godzinie to czytasz. Pisz? tutaj bo mam problem w pewnym skrypci? a nie pami?tam jak to si? robi?o i prosz? o pomoc chodzi o to ?e mam tutaj skrypt na w?a?nie tak zwan? reputacje i wszystko dzia?a tylko nie zapisuj? tej reputacji po np wyj?ciu z gry i wej?cie ponowne i zalogowanie si? masz 0 wiem czemu tak si? dziej? bo tam pisze ?e je?li gra? wejdzi? to daje mu rp 0 ale nie mam pomys?u jak to naprawi? i dlatego prosz? o pomoc i wklejam tu kod. Dzienkuj? za wsztstki? odpowiedzi i pozdrawiam!!!


[lua]function onPlayerLogin ()
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
if not isGuestAccount ( playeraccount ) then
local playerpkt = getAccountData ( playeraccount, "points" )
if ( playerpkt ) then
setElementData(source, "Pkt", tonumber(playerpkt))

end
end
end
end

function onPlayerQuit ()
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
if not isGuestAccount ( playeraccount ) then
local playerpkt = getElementData ( source, "Pkt" )
if ( playerpkt ) then
setAccountData ( playeraccount, "points", playerpkt )
end
...
12. Punkty
Witam, mia?em przerw? od LUA ~1rok i ca?kowicie nie wiem jak si? za to zabra?:
chcia?bym zrobic punkty kt?re przyjdzielaj? si? do 15minut oraz wyswietlaja sie na hud, punkty s?u?y?yby do wsiadania do pojazd?w. Pomo?ecie? :D
13. Punkty za prace
Witam mo?e kto? mi pom?c z tymi punktami chodzi mi o to ?eby je dostawa? za prace.
Praca:
[lua]local districtsBus = {
{-2267.09, 513.41, 35.21},
{-2361.05, 508.25, 29.70},
{-2334.35, 446.11, 33.93},
{-2251.87, 324.60, 35.32},
{-2252.09, 137.86, 35.32},
{-2255.90, -53.92, 35.32},
{-2179.74, -70.35, 35.32},
{-2157.58, 29.73, 35.32},
{-2008.12, 32.28, 32.92},
{-2006.04, 152.42, 27.70},
{-2003.16, 327.24, 35.20},
{-2000.66, 582.50, 35.20},
{-1866.77, 602.79, 35.20},
{-1711.04, 640.27, 24.82},
{-1658.49, 728.29, 17.35},
{-1542.51, 753.95, 7.20},
{-1554.45, 849.46, 7.20},
{-1737.17, 849.34, 24.89},
{-1941.91, 849.34, 40.29},
{-1906.05, 920.55, 35.20},
{-1671.73, 920.66, 24.82},
{-1568.30, 1005.91, 7.20},
{-1619.79, 1233.35, 7.20},
{-1880.92, 1348.59, 7.20},
{-2094.87, 1274.71, 15.28},
{-2265.25, 1182.31, 55.78},
{-2265.34, 928.57, 66.66},
{-2265.42, 724.64, 49.49},
{-2265.30, 548.17, 35.22},
}

local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus

function finishJob()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end

if jobTarget and isElement(jobTarget) then
destroyElement(jobTarget)
jobTarget = nil
jobTarget = 0

end

triggerServerEvent("destroyVeh",resourceRoot,jobVe...
14. Punkty w kolumnie scoreboard
Witam, posiadam taki oto skrypt na game pointsy:

[spoiler][lua]function resetPoints()
for k, v in ipairs(getElementsByType("player")) do
local acc = getPlayerAccount(v)
local pkts = getAccountData(acc, "g_points")
if type(pkts) ~= "number" or type(pkts) == "number" and pkts < 1 then
setAccountData(acc, "g_points", 0)
end
end
end
addEventHandler("onResourceStart", getRootElement(), resetPoints)

function givePoints()
local account = getPlayerAccount(client)
if isGuestAccount(account) then return end
setAccountData(account, "g_points", getAccountData(account, "g_points") + 1)
outputChatBox("Posiadasz: "..getPlayerPoints(client).." game points", client)
end
addEvent("giveGPoint", true)
addEventHandler("giveGPoint", resourceRoot, givePoints)


function getPlayerPoints(player)
local acc = getPlayerAccount(player)
if isGuestAccount(acc) then return end
pkt = getAccountData(acc, "g_points")
return pkt
end

addCommandHandler("showpkt", function(plr, cmd)
outputChatBox("Posiadasz: "..getPlayerPoints(plr).." game points", plr)
end)[/lua][/spoiler]

I chc? go podczepi? pod scoreboard, wykmini?em taki kod:

[spoiler][lua]call(getResourceFromName("scoreboard"), "scoreboardAddColumn", "Punkty", 100, "Punkty:", 3)
...
15. [INNE] Jak zrobić funkcje zliczającą punkty ?
Witam mam takie pytanie jak zabra? si? do zrobienia funkcji kt?ra b?dzie zlicza?a punkty. Np rzucamy 10 razy i za ka?dym rzutem wylosuje nam x punkt?w a po 10 rzucie zlicza wszystkie punkty i podaje wynik.
16. [DM] Tereny oraz punkty
Chcia?bym zrobi? dany teren na mapie, w kt?rym gracze b?d? wbija? punkty lub cokolwiek i b?dzie pokazywa? 3 najlepszych graczy. Kto? ma jaki? pomys? jak co? takiego wykona? ?
17. [INNE] Punkty
Witam.

Jak doda? co? takiego ?e co 10/15min. b?d? punkty nabijane dla gracza , i zapisywane w jakim? pliku ? chodzi mi oczywi?cie o punkty w textdraw , a nie na TAB :P