Jump to content

DjMPL

Members
  • Posts

    7
  • Joined

  • Last visited

DjMPL's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. A dokładniej w jakim miejscu bo nie wiem nie ogarniam jeszcze tego do końca a i mógłbyś opdać mi link bezpośredni do tego IDE
  2. Usunołem to i kod wygląda teraz tak ale nadal nie działa co tutaj powinienem dodać? Aby działał prawidłowo oraz zapisywał kase i score a by po restarcie serwera nadal gracz to miał? function onPlayerLogin () local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then if not isGuestAccount ( playeraccount ) then local playerpkt = getAccountData ( playeraccount, "points" ) local playermoney = getAccountData ( playeraccount, "s.handmoney" ) if ( playerpkt ) or (playermoney) then setElementData(source, "Pkt", tonumber(playerpkt)) setElementData(source, "Kasa", tonumber(playermoney)) setPlayerMoney( getRootElement(), playermoney ) end end end end function onPlayerQuit () local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then if not isGuestAccount ( playeraccount ) then local playerpkt = getElementData ( source, "Pkt" ) local playermoney = getElementData ( source, "Kasa" ) if ( playerpkt ) or (playermoney) then setAccountData ( playeraccount, "points", playerpkt ) setAccountData ( playeraccount, "s.handmoney", playermoney ) end end end end addEventHandler ( "onPlayerLogin", getRootElement (), onPlayerLogin ) addEventHandler ( "onPlayerQuit", getRootElement (), onPlayerQuit )
  3. Są to moje początki z lua, dzięki za pomoc.
  4. Witam mam skrypt na zapis kasy i score lecz jest jeden problem w tabelce nie wyświetla kasy a ni jej nie zapisuje po wyjściu z serwera o to kod: function onPlayerLogin () local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then if not isGuestAccount ( playeraccount ) then local playerpkt = getAccountData ( playeraccount, "points" ) --local playermoney = getAccountData ( playeraccount, "s.HandMoney" ) if ( playerpkt ) then setElementData(source, "Pkt", tonumber(playerpkt)) --setElementData(source, "Kasa", tonumber(playermoney)) --setPlayerMoney( getRootElement(), playermoney ) end end end end function onPlayerQuit () local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then if not isGuestAccount ( playeraccount ) then local playerpkt = getElementData ( source, "Pkt" ) --local playermoney = getElementData ( source, "Kasa" ) if ( playerpkt ) then setAccountData ( playeraccount, "points", playerpkt ) --setAccountData ( playeraccount, "s.HandMoney", playermoney ) end end end end addEventHandler ( "onPlayerLogin", getRootElement (), onPlayerLogin ) addEventHandler ( "onPlayerQuit", getRootElement (), onPlayerQuit )
  5. Witam otóż zająłem się edycją skryptu truck, dodałem jeden towar i nie mogę go załadować możecie mi pomóc? Proszę o szybką pomoc. Sam nie doszedłem dlaczego tak jest o to kod: -- Miejsce skupu materialow local from = { { -1726.8140869141, -120.37453460693, 2.1521277427673 }, { -1240.9187011719, 47.490695953369, 12.733346939087 }, { -2167.6303710938, -212.92886352539, 33.838642120361 }, {-1853, 1401, 7}, {-2283, 2278, 4,5}, {-367, 1548, 75,1}, {346, 2534, 16,2}, {1641, 2414, 10}, {-2887, 503, 4}, {-1516, 729, 6}, {-684, 966, 12}, {948, 2279, 11}, {1489, 2146, 10}, {1908, 2157, 10}, {2242, 1977, 9}, {-658, 2317, 138}, {-2054, -2566, 30}, {-1416, -1469, 101}, {-605, -484, 25}, {-55, -329, 5}, {1077, -309, 75}, {-2644, 1334, 7}, {2481, 2796, 10}, {-857, -1945, 15}, {-87, -1574, 2}, {-2264, -1688, 480}, { -2029.1010742188, 172.45364379883, 27.35425567627 } } -- Miejsca sprzedarzy materialow local to = { { -1705.9104003906, 395.6416015625, 6.6980085372925 }, { -2521.9482421875, -615.18835449219, 132.08641052246 }, { -1915.8461914063, -1718.0207519531, 21.268323898315 }, {-462, -1905, 7}, {-80, 1164, 1}, {-2335, -1582, 483}, {-2082, 1405, 7}, {-2233, 2299, 5}, --{-2618, 1510, 75}, {400, 2484, 16}, {1604, 2415, 10}, {-2976, 477, 4}, {-708, 953, 12}, {941, 2279, 10}, {1485, 2111, 10}, {1912, 2118, 10}, {2302, 1964, 9}, {-772, 2423, 157}, {-2619, 1376, 7}, { -2196.3051757813, -2263.3464355469, 30.151552200317 } } local pmoney = getPlayerMoney(source) -- Definicje modelow ciezarowek local vehicle_ids = {[414] = true, [456] = true, [455] = true, [429] = true, [515] = true} -- Nagroda w $ local paid = 5000 -- Ponizej nic nie zmieniac local markers = {} local destmarker local destblip local retmoney function onHit(element) if element == getLocalPlayer() then local v = getPedOccupiedVehicle(element) if getElementType(v) == "vehicle" then --if vehicle_ids[getElementModel(v)] then Window10:Visible(true) showCursor(true) --end end end end function exitWindow() Window10:Visible(false) showCursor(false) end function recieveDestMarker() givePlayerMoney(retmoney) outputChatBox("* Dostaleś $" .. tostring(retmoney), 255, 255, 0) setElementData(getPedOccupiedVehicle(getLocalPlayer()), "retmoney", false) setElementData(getLocalPlayer(), "Pkt", getElementData(getLocalPlayer(), "Pkt") + 1) destroyElement(destmarker) destroyElement(destblip) end function passThru(ret) addPercent(ret) end function addPercent(ret) local cur = Progress10:Progress() if cur >= 100 then Progress10:Progress(0) dest = to[math.random(1, #to)] destroyElement(destmarker) destroyElement(destblip) destmarker = createMarker(dest[1], dest[2], dest[3], "cylinder", 3, 255, 255, 0, 255) destblip = createBlip( dest[1], dest[2], dest[3], 41, 2, 255, 255, 0, 0, 100) retmoney = ret Event:Use("onClientMarkerHit"):Handle(recieveDestMarker, destmarker) Window10:Visible(false) showCursor(false) else Progress10:Progress(cur + 5) if Progress10:Progress() == 100 then passThru(ret) end end end function buyItem() points = getElementData(getLocalPlayer(), "Pkt") if RadioButton10:Selected() then if points >= -50 then setTimer(addPercent, math.random(60, 90), 21, math.random(30, 50)) else outputChatBox("Nie masz wystarczajaca ilosc punktow", 255, 0, 0) end end end function onStart() local x,y = guiGetScreenSize() Window10 = Window:Create(200, 50, 400, 500, "System paczek v1.0 by DjMPL") RadioButton10 = Window10:AddRadioButton(40, 20, 60, 20, "Smieci") RadioButton20 = Window10:AddRadioButton(40, 40, 60, 20, "Test") Button10 = Window10:AddButton(330, 20, 65, 20, "Zakup!") Button20 = Window10:AddButton(330, 40, 65, 20, "Zamknij!") info1 = Window10:AddButton(330, 60, 65, 20, "Autor") info2 = Window10:AddButton(20, 23, 15, 15, "?") info3 = Window10:AddButton(20, 23, 15, 15, "?") Progress10 = Window10:AddProgressBar(10, 460, 380, 20) Button10:AddOnClick(buyItem) Button20:AddOnClick(exitWindow) Window10:Visible(false) --[[ GridList1 = Window10:AddGridList(30, 230, 370, 300) GridList1:AddColumn("Towar", 0.6) GridList1:AddColumn("Pkt", 0.6) GridList1:AddColumn("Cena", 0.6) GridList1:AddRow( "piasek", "0", "10" ) --]] for k,v in ipairs(from) do local marker = createMarker( v[1], v[2], v[3], "cylinder", 3, 0, 0, 255, 255) table.insert( markers, marker ) Event:Use("onClientMarkerHit"):Handle(onHit, marker) createBlip( v[1], v[2], v[3], 51, 2, 255, 255, 0, 0, 400, 400) end end Event:Use("onClientResourceStart"):Handle(onStart, ResourceRoot) function Autor () outputChatBox("System paczek v1.0 by DjMPL", 255, 0, 0) end addEventHandler ( "onClientGUIClick", info1, Autor )
×
×
  • Create New...