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: zabiera
1. Fotoradar zabiera kase dla pasazera
Witam, posiadam skrypt na fotoradar i wszystko dzia?a opr?cz jednej rzeczy a mianowicie gdy przekrocz? pr?dko?? to zabiera pieni?dze kierowcy i pasa?erowi. Chcia?bym ustawi? aby mandat dostawa? tylko kierowca. Prosz? o pomoc. Poni?ej wklejam kod. Dzi?kuje za pomoc.

Po stronie CLIENTA:

[lua]--[[
author: Asthma.
(c) 2020 <-- fvck this year
]]

local sx, sy = guiGetScreenSize();
local zoom = 1
local baseX = 1920
local minZoom = 2

if sx < baseX then
zoom = math.min(minZoom, baseX/sx);
end


function scaleX(type, value)
if type == 'center' then
return math.floor(sx/2 - value/zoom)
elseif type == 'left' then
return math.floor(sx - value/zoom)
elseif type == 'right' then
return math.floor(value/zoom)
end
end

function scaleY(type, value)
if type == 'center' then
return math.floor(sy/2 - value/zoom)
elseif type == 'top' then
return math.floor(value/zoom)
elseif type == 'down' then
return math.floor(sy - value/zoom)
end
end

local txd = engineLoadTXD ("foto.txd");
engineImportTXD (txd, 16101 )
local dff = engineLoadDFF ("foto.dff");
engineReplaceModel (dff, 16101 )

_table = {};

local takenPhoto = nil

--[[
przyklad
{x,y,z,rx,ry,rz,zasiegFotoradary,dopuszczalnaPredkosc}
]]

local points = {
{ -2711.51, 312.86, 2.34,0,0,0,7,maxVelocity=50},
{-2598.63379, -490.13394, 73.4849,0,0,0,7,maxVelocity=30...
2. coś nie tak z kodem zabiera 5 żetonów podczas wymiany
Witam mam taki problem ?e jak klikam wymiana i chce wymieni? pkt na premium to mi zabiera 5 ?eton?w i to tak wygl?da jak bym klika? w jeden przycisk 5 razy... pom?g? by kto? to poprawi?? bo walcze z tym juz od 2 dni i nie mog? tego znale??, bardzo bym by? wdzi?czny... pozdrawiam

[lua]elseif mysz(screenW * 0.4008, screenH * 0.6133, screenW * 0.0542, screenH * 0.0352) and okno3 == false and okno4 == true then
elseif mysz(822*px, 585*py, 126*px, 38*py) and gielda == true then
triggerServerEvent("wymien:pp", localPlayer, ile)
if niemozesz == true then return end
local cena = guiGetText(cenapp)
local ilosc = guiGetText(liczbapp)
if not tonumber(ilosc) then return end
if not tonumber(cena) then return end
if cena:len() > 6 then return end
if cena == "Cena" then return end
if ilosc == "Ilosc" then return end
if cena == "" then return end
if ilosc == "" then return end
if tonumber(cena) < 1 then return end
if tonumber(ilosc) < 1 then return end
if string.find(cena, 'E') then return end
if string.find(cena, 'e') then return end
if string.find(cena, 'r') then return end
if tonumber(ilosc) > tonumber(getElementData(localPlayer, "pp")) then exports["smta_base_notifications"]:noti("Nie posiadasz wystarczajacej ilosc DP", "error") return end
triggerServerEvent("wystaw:pp", localPlayer, tonumber(i...
3. Zawsze przy uderzeniu zabiera 2k krwi
[code]checkZombies = function()
for i,ped in ipairs(getElementsByType("ped",root,true)) do
if getElementData(ped, "zombie") then
local x,y,z = getElementPosition ( localPlayer )
local zx,zy,zz = getElementPosition (ped)
local zfrontx, zfronty, zfrontz = getPositionInfrontOfElement(ped, 3)

local vect1X, vect1Y = zx-x, zy-z
local vect2X, vect2Y = zfrontx-zx, zfronty - zy

local scal = vect2X*vect1X+vect2Y*vect1Y

local distance = getDistanceBetweenPoints3D ( x,y,z, zx,zy,zz )
local sound = getElementData(getLocalPlayer(), "volume") / 5
local visibly = getElementData(getLocalPlayer(), "visibly") / 5
local ready = true
if ( distance > sound*1.2 + visibly*1.2 and scal <= 0 ) or ( distance > sound*1.4 + visibly*1.4 ) then -- Расстояние за которую он вас увидит и услышит (средне)
ready = false
end
if ready then
triggerServerEvent ( "chasedStartAttackC", getLocalPlayer(), ped )
end
end
end
end
setTimer(checkZombies, 2000, 0)
setElementData ( localPlayer, "spawnedzombies", 0 )


checkAnimal = function()
for i,ped in ipairs(getElementsByType("ped",root,...
4. Nie zabiera kasy
Nie zabiera kasy gdy kto? kupi jedzenie.

[lua]
--[[
Skrypt na jedzonko
]]

local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
local px, py = screenW/1440, screenH/900

local font = dxCreateFont("cz.ttf", 10)
local font2 = dxCreateFont("cz.ttf", 13)

local okno = false

local rzeczy = {
--- nazwa, tekst, cena, %najedzenia, grafika
{"Hamburger", "Kupuj?c hamburgera dostajesz +20% najedzenia", 20, 20, 1},
{"Hotdog", "Kupuj?c hotdoga dostajesz +15% najedzenia", 10, 15, 2},
{"Kebab", "Kupuj?c kebaba dostajesz +20% najedzenia", 25, 20, 3},
{"Woda", "Kupuj?c wode dostajesz +5% najedzenia", 5, 5, 7},
{"P?czek", "Kupuj?c p?czka dostajesz +10% najedzenia", 10, 10, 5},
}

function gui()
dxDrawImage(510*px, 233*py, 420*px, 435*py, ":BW_ekwipunki/grafiki/tlo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("Zakup fastfood?w", 509*px, 233*py, 930*px, 272*py, tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
dxDrawImage(904*px, 243*py, 16*px, 16*py, ":guieditor/images/cross.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
for i, v in ipairs(rzeczy) do
local dodatekY = (73*py)*(i-1)
local dodatekY2 = (146*py)*(i-1)

dxDrawRectangle(520*px, 281*py+dodatekY, 400*px, 70*p...
5. Pasażer zabiera HP kierowcy
Co zrobi? gdy pasa?er robi?c driveby zabiera hp kierowcy? Chodzi mi o to ?eby wszyscy siedz?cy w jednym aucie nie mogli zabiera? sobie HP
6. Nie zabiera kasy za fixa :P
sn.lua[lua]--[[
@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

local strefyNapraw={

--idlewood
warsztatIdlewoodStanowsko11={
cuboid={1846.96, -1784.89, 14.1, 5, 9, 6 },-- cuboid w ktorym musi znalezc sie pojazd
mpos={1854.92,-1780.84,12.55}, -- pozycja markera w ktorym gracz bedzie stal aby naprawiac
faction_id=3, -- id frakcji ktora ma do tego dostep
},

warsztatIdlewoodStanowsko12={
cuboid={1846.96, -1775.17, 14.1, 5, 9, 6 },-- cuboid w ktorym musi znalezc sie pojazd
mpos={1854.44,-1772.43,12.65}, -- pozycja markera w ktorym gracz bedzie stal aby naprawiac
faction_id=3, -- id frakcji ktora ma do tego dostep
},

warsztatIdlewoodStanowsko2={
cuboid={1892.99, -1784.89, 14.1, 5, 21, 6 },-- cuboid w ktorym musi znalezc sie pojazd
mpos={1900.45,-1779.93,12.55}, -- pozycja markera w ktorym gracz bedzie stal aby naprawiac
faction_id=3, -- id frakcji ktora ma do tego dostep
},


--montgomery
warsztatMontgomeryStanowsko1={
cuboid={1184.08,253.10,19.63, 8, 6, 6 },-- cuboid w ktorym musi znalezc sie pojazd
mpos={1182.39,253.35,18.53}, -- pozycja markera w ktorym gracz be...
7. Podwójnie myje, zabiera pieniądze oraz pokazuje notyfikacje
Witam ot?? mam problem z myjn? wszystko robi podw?jnie

client
[lua]
-- Myjnia pojazd?w.
createBlip(-2279.03, -175.91, 35.32, 55,2,0,0,0,0,0,275) -- TWORZYMY BLIP
local missionText=createElement("text")
setElementData(missionText, "name", "MyjnianKoszt: 50PLN")
setElementPosition(missionText, -2279.03, -175.91, 35.32+0.8)

shader = dxCreateShader( "tekstura.fx" )
local marker = createMarker ( -2279.03, -175.91, 35.32-0.5, "cylinder", 3, 0, 255, 0, 0 )

function myjnia (hitPlayer, matchingDimension)
local veh = getPlayerOccupiedVehicle ( hitPlayer )
if ( veh ) then
setElementData(hitPlayer, "umyjdupe", true)
engineApplyShaderToWorldTexture( shader, "vehiclegrunge256", veh )
engineApplyShaderToWorldTexture( shader, "?emap*", veh )
triggerServerEvent ("onserver", hitPlayer, onserver)
local ef = createEffect ( "waterfall_end", -2277.64, -175.72, 35.32, -0.00, 0.00, 271.51, 100, true )
local ef2 = createEffect ( "waterfall_end", -2281.13, -175.61, 34.73, 0.00, -0.00, 269.25, 100, true )
--
setTimer(function()
destroyElement(ef)
destroyElement(ef2)
end, 3000, 1)
end
end
addEventHandler("onClientMarkerHit", marker, myjnia)
[/lua]

server
[lua]
function onserver ()
takePlayerMoney (source, 50 )
fadeCamera ( source, false, 2.5, 0, 0, 0...
8. NIE ZABIERA PIENIĘDZY
Witam ot??, mam skrypt na myjnie, myje pojazd, lecz nie zabiera pieni?dzy, kodzik ze strony serwera, gdzie niby zabiera

function onserver ( )
            
fadeCamera sourcefalse2.500)
            
setTimer fadeCamera10001sourcetrue2.5)
end
addEvent
("onserver",true)
addEventHandler("onserver"rootonserver)

function 
onserver () 
takePlayerMoney (source1500000 )
fadeCamera sourcefalse2.500
setTimer fadeCamera25001sourcetrue2.5
end 
addEvent
(onserver,true
addEventHandler(onserverrootonserver)

addEventHandler("onClientMarkerHit"Marker3, function(el)
    if 
getPedOccupiedVehicle(elthen return end
    
if el ~= getLocalPlayer() then return end
end
)
addEventHandler("onClientMarkerHit"Marker3, function(el)
    
outputChatBox("Chwilowo nieczynne...")
end)
9. Nie kupuje ani nie zabiera pieniędzy
Witam i? jestem pocz?tkuj?cy w lua nie wiem dlaczego nie kupuje i nie zabiera pieni?dzy gdy pr?buje kupi? fastfooda w budce. Dla jasno?ci jest to skrypt z New Place kt?rego przerobi?em pod sw?j serwer i wszystko ?adnie tylko nie chce sie kupi?. Prosi?bym o pomoc. Daje zimne piwko :D

server
[lua]local lokalizacje = {
{1281.99, -1116.14, 53.50, 310},
{1167.68, -2042.71, 69.01, 310},
{703.3, -1572.80, 14.24, 90},
{2303.99, -1985.36, 13.56, 270},
{1945.29, -1969.46, 13.55, 270},
{790.20, -1345.98, 13.55, 270},
{1214.28, -1813.21, 16.59, 233},
{1748.75, -1861.95, 13.58, 0},
{2289.18, -1757.69, 13.55, 3},
{2262.71, -1271.11, 23.98, 233},
{2833.18, -1579.79, 11.09, 253},
{2519.39, -1271.83, 34.89, 90},
{1970.36, -1223.64, 20.02, 3},
{1300.95, -1157.49, 23.83, 3},
{112.29, -307.44, 1.58, 200},
{1400.16, 728.95, 10.82, 280},
}

for i,v in ipairs(lokalizacje) do
budka = createObject(1340, v[1], v[2], v[3], 0, 0, v[4]+90)
marker = createMarker(v[1], v[2], v[3]-.95, "cylinder", 1.1, 0, 255, 0, 0)
setElementData(marker, "fastfoody", true)
ped = createPed(155, v[1], v[2], v[3], v[4])
setElementData(ped, "name", "Sprzedawca")
attachElements(marker, budka, 1, 0, -.95)
attachElements(ped, budka, -1, 0, 0)
setElementFrozen(budka, true)
end

addEvent("daj:fastfoody", true)
addEventHandler("daj:fastfoody", root, function(nazwa)
exports["BW_db"]:dbGet("INSERT INT...
10. OGRPG Zabiera prawko na stałe
Witam mam taki problem pobra?em skrypty Its'a z 2k17 bo potrzebowa?em dutyadmin ale jest taki problem ?e jak zabieram prawko to bierze je na sta?e i ju? nie da si? odda? tylko trzeba je robi? odnowa wie kto? mo?e jak to naprawi?? bardzo bym by? wdzi?czny stawiam piwo ka?demu kto jako? pomo?e pozdrawiam
11. Zabiera kase bo nacisnieciu recznego
Witam, i? jestem pocz?tkuj?cym w lua, nie wiem w jakim skrypcie jest b??d

ju? wyjasniam o co chodzi

gdy naciskam spacje aby zachamowa? Zabiera pieni?dze graczowi
a je?eli ich nie posiada pisze "nie posiadasz tyle pieni?dzy" wie kto? mo?e w jakim skrpycie jest b??d, siedze na GM Your Adventure "OG-RPG"
12. Tuning nie zabiera pieniedzy.
Witam, tak jak w temacie.

[lua]local isVehicles=nil
local isColored={
-- Nazwa koloru, {r,g,b koloru}, cena
{"?wiat?a Zwyk?e - Bia?e", {255,255,255}, 0},
{"?wiat?a Czerwone", {255,0,0}, 5000},
{"?wiat?a Niebieskie", {0,18,199}, 4000},
{"?wiat?a ?? ?te", {255,255,0}, 4500},
{"?wiat?a Zielone", {0,255,0}, 4300},
{"?wiat?a Zielone Ciemne", {0,64,0}, 4300},
{"?wiat?a Jasno Niebieskie", {48,213,200}, 5500},
{"?wiat?a R??owe", {255,52,225}, 3900},
{"?wiat?a Fioletowe", {192,0,255}, 3900},
{"?wiat?a Pomara?czowe", {255,128,0}, 4000},
{"?wiat?a Aqua", {0,255,255}, 4500},
{"?wiat?a Czerwone Ciemne", {128,0,0}, 5000},
}

local wn={}
wn.window=guiCreateWindow(0.18, 0.19, 0.64, 0.62, "", true)
wn.grid=guiCreateGridList(0.03, 0.07, 0.62, 0.89, true, wn.window)
guiGridListAddColumn(wn.grid, "Kolor", 0.5)
guiGridListAddColumn(wn.grid, "Koszt", 0.5)
wn.btn_submit=guiCreateButton(0.67, 0.08, 0.31, 0.33, "Zamontuj", true, wn.window)
wn.btn_close=guiCreateButton(0.67, 0.63, 0.31, 0.33, "Zamknij", true, wn.window)
guiSetVisible(wn.window, false)

addEventHandler("onClientMarkerHit", resourceRoot, function(el,md)
if not md or el~=localPlayer then return end
local cs=getElementData(source, "marker:cuboid")
if not cs t...
13. Nie zabiera głodu i pragnienia
Siema. Ostatnio pobra?em sobie GM DayZ na serwer MTA i mam pewien problem poniewa? podczas chodzenia nie zabierana ani pragnienia ani g?odu.
Ni?ej podaj? kod na zabieranie owych status?w

GAMEMODE: https://github.com/mtadayz/MTADayZ




KOD:


Kod:

--[[
function setHunger()
for i,player in ipairs(getElementsByType("player")) do
if getElementData(player,"logedin") then
value = gameplayVariables["loseHunger"]
addPlayerStats (player,"food",value)
end
end
end
setTimer(setHunger,60000,0)

function setThirsty()
for i,player in ipairs(getElementsByType("player")) do
if getElementData(player,"logedin") then
value = gameplayVariables["loseThirst"]
addPlayerStats (player,"thirst",value)
end
end
end
setTimer(setThirsty,60000,0)

function checkThirsty()
for i,player in ipairs(getElementsByType("player")) do
if getElementData(player,"logedin") then
value = 0
if getControlState (player,"sprint") then
value = gameplayVariables["sprintthirst"]
end
addPlayerStats (player,"thirst",value)
end
end
end
setTimer(checkThirsty,10000,0)
]]








14. nie zabiera pieniedzy
Ot?? mam pewien problem,gdy tankuje pojazd wszystko jest pi?knie tankuje go pi?knie,ale nie pobiera kasy ;/
Mo?na jak?? porad? jak to zrobi? ?


[lua]sx,sy = guiGetScreenSize()

local punktyTankowania = {
{-2029.52, 156.77, 28.84},
{-2023.89, 156.69, 28.84},
{-2405.73, 975.74, 45.30},
{-2416.30, 974.97, 45.30},
{-2640.45, 1375.09, 7.15},
{-1675.46,413.69,7.21},
{-1328.36,2677.03,50.09},
{612.50,1694.81,7.03},
{2115.18,919.53,10.85},
{1383.09,460.70,20.12},
{1004.86,-939.32,42.22},
}

for i,v in ipairs(punktyTankowania) do
zpwp_marker = createMarker(v[1], v[2], v[3]-1.0, "cylinder", 4, 255, 255, 255, 0)
setElementData(zpwp_marker, "stacja_benzynowa", true)
end

zpwp_okno = guiCreateWindow(199/1280*sx, 191/720*sy, 872/1280*sx, 294/720*sy, "Stacja benzynowa", false)
guiWindowSetSizable(zpwp_okno, false)
guiSetVisible(zpwp_okno, false)

zpwp_warning = guiCreateLabel(17/1280*sx, 18/720*sy, 845/1280*sx, 16/720*sy, "", false, zpwp_okno)
guiLabelSetColor(zpwp_warning, 183, 0, 0)
guiLabelSetHorizontalAlign(zpwp_warning, "center", false)

zpwp_info = guiCreateLabel(211/1280*sx, 81/720*sy, 477/1280*sx, 15/720*sy, "Witaj na stacji,poni?ej jest przedstawiony cennik paliwa, cennik mo?e ulec zmianie !", false, zpwp_okno)
guiSetFont(zpwp_info, "default-bold-small")

zpwp_stan_l = guiCreateLabel(17/1280*sx, 48/720*sy, 111/128...
15. Nie zabiera kasy
strona s-side

addEveaddEvent
("zabierz"true
addEventHandler("zabierz"getRootElement(), function(thePlayer
 
takePlayerMoney (thePlayer3)
end
)

i strona c-side

function marker ()
triggerServerEvent "zabierz" ,root getLocalPlayer())
addEventHandler("onClientMarkerHit",marker_zabierz,marker )
16. [INNE] Oddanie Broni - jedemu zabiera, drugiemu daje
Potrzebna mi pomoc, potrzebuj? kod na komend?, kt?ra je?li gracz A
ma bro? o np. id 24 i wpisze komend? /oddajbron idgracza to automatycznie oddaje mu swoj? bro? wraz z ca?? amunicj?, bez wzgl?du ile jej ma.
Za pomoc :piwo: :piwo: + Rep
17. Dziwnie kase zabiera
1. Witam, mam dziwny problem na serwerze. Po naci?nieciu przycisku na kupno paliwa nie zabiera 75$ tylko czasami dodaje kase, czasami odbiera. Najciekawsze jest to ?e mi NIGDY nie zabra?o ?le kasy, tylko graczom

Kod:

Przedmiotem rozprawy s? stacje benzynowe. Stacje informuj? i?, dop?ata za paliwo wynosi 75$. Mam 30 score, i co? mnie w?a?nie dziwi?o, dlaczego mi tak te tysi?ce znikaj?. Problem jest nast?puj?cy -> Stacja z?era nieraz po 2 000 za paliwo!! Dosta?em na 'dobry start' 10 000. Dobi?em 7000 $, a aktualnie mam 4300 !! W?a?nie przez stacje benzynow?.. Nalegam aby to naprawi? jak najszybciej,a tak?e wnosz? o odszkodowanie w postaci 15 000 $ straconych pieni?dzy. Ten sam prolem poojawia si? tak?e przy bramkach p?atnych, jednak te czasami dodaj? 200 $ , czasami zabieraj? 500 $. :/


Powy?ej wszystko wida?, jak sprawa wygl?da (jest to post u?ytkownika mojego serwera)

2. Jak zrobi? aby blip zosta? usuni?ty tylko jednemu graczowi? Robi?em skrypt na towary i jeszcze jeden problem - blip zostaje zniszczony wszystkim graczom.

Kod:
Client (trigger):
Kod:

triggerServerEvent("UsunBlip", getLocalPlayer(), getRootElement())


Serwer:
Kod:


function blip()
destroyElement(rozladuj)
end

addEvent("UsunBlip", true)
addEventHandler("UsunBlip", getRootElement(), blip)


Dzi?ki za pomoc :)