Czejsc A Wiecod pocz?tku. Chce wgrac pewnom remize nna prywatny serwer MTA lecz Nie moge z inimi obiektamy np: Szpital Lub Baza SAPD dzia?a lecz z remiz? nie.
W kazdej remize jest cos takiego :
mapEditorScriptingExtension_s
mapEditorScriptingExtension_c
Pls pom?zcie !
Wi?c mam skrypt SA_Customs i jest co? z?ego w nim i? jak chce zmieni? kolor ?wiate? to nie pokazuje mi sie paleta do wybrania koloru... kt?ra powinna wygl?da? tak: https://imgur.com/a/V7TrWlU
Kodzik : [lua]availableTuningMarkers = {
--X, Y, Z, Vehicle Rotation (Use /markerpos to get perfect position and rotation (The command in sourceC.lua last row))
{-2282.83,-124.69,34.84}, -- LV Airport
{-2275.28,-124.99,34.84}, -- LV Airport
}
Witam,
mam problem mianowicie
skopiowa?em kod skryptu z sapd na pysie bo robie inna frakcje na tym gm
i gdy pr?buje wystawic mandat mam taki b??d
s:36 attempt to index local 'plr' (a userdata value)
[code]function mandat(plr, cmd, target, cash, ...)
if getElementData(plr,"player:faction") and getElementData(plr,"player:faction") == "SAPD" then
if not (target) or not (cash) or not (...) then
plr:outputChat('* U?yj: /mandat <nick/ID> <kwota> <pow?d>')
else
if getElementData(plr,"player:rank") < 2 then outputChatBox("* Nie posiadasz uprawnie? !",plr) return end
cash=tonumber(cash)
if cash <= 0 then
plr:outputChat('* Warto?? kwoty mandatu nie mo?e by? ujemna.')
return
elseif cash > 35000 then
plr:outputChat('* Kwota mandatu jest zbyt du?a (max. 35.000 PLN).')
return
end
local targetElement=exports['pystories-core']:findPlayer(plr, target)
if targetElement then
local x, y, z = getElementPosition(plr)
local tx, ty, tz = getElementPosition(targetElement)
local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
if (distance<=10) then
local reason=table.concat({...}, ' ')
local money=getPlayerMoney(targetElement)
local takeFromCash = money-cash
if money >= cash then
plr:outputChat(('* Wystawiono mandat dla %s, na kwot? %d PLN. Pow?d: %s'):format(targetElement:getName():g...
[lua]addEventHandler("onClientRender", root, function()
local nick = getPlayerName(localPlayer)
local premium = getElementData(localPlayer, "player:premium")
local zegar_h, zegar_m = getRealTime().hour, getRealTime().minute
local pln = getPlayerMoney(localPlayer)
local uid = getElementData(localPlayer,"player:uid")
local status = nil
if premium then
status = "(Premium)"
else
status = ""
end
Witam mam problem z przerobieniem pobierania zasob?w z new place ot?? to jak pobior? sie zasoby skrypt nie znika oto kod ( za pomoc daje piwko ):
[lua]
--[[
Autor: Sralentas xD
]]
local sx, sy = guiGetScreenSize()
local font = dxCreateFont("cz.ttf", 13)
local kropki = 0
addEventHandler("onClientResourceStart", resourceRoot, function()
if getElementData(localPlayer, "dbid") then return end
if isEventHandlerAdded("onClientRender", gui) then return end
addEventHandler("onClientRender", root, gui)
showChat(false)
showPlayerHudComponent("all", false)
muza = playSound("muzyka.mp3")
end)
Wgra?em paczke fort carson i pisze mi w konsoli to
No i nwm co zrobi? bo ju? pr?bowa?em wszystko ale na sw?j spos?b mo?e wie kto? jak to naprawi??
[18-11-12 16:47:07] ERROR: Unable to start resource maps; Failed to start resource item fortcarson.map which is required
[18-11-12 16:47:07] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value)
[18-11-12 16:47:07] ERROR: money/server.lua:4: call: failed to call 'mysql:query' [string "?"]
[18-11-12 16:47:08] ERROR: Couldn't find resource pwnage. Check it exists.
[18-11-12 16:47:08] ERROR: Couldn't find resource cinema. Check it exists.
[18-11-12 16:47:08] Creating new DB table vending_machines
[18-11-12 16:47:08] ERROR: Couldn't find resource changename-system. Check it exists.
[18-11-12 16:47:08] Querying MTA master server... success! (Auto detected IP:193.70.126.129)
[18-11-12 16:47:08] Authorized serial account protection is enabled for the ACL group(s): `Admin` See http://mtasa.com/authserial
[18-11-12 16:47:08] WARNING: owner_email_address> not set
[18-11-12 16:47:08] Server started and is ready to accept connections!
[18-11-12 16:47:08] To stop the server, type 'shutdown' or press Ctrl-C
[18-11-12 16:47:08] Type 'help' for a list of commands.
[18-11-12 16:47:08] Stopping global
[18-11-12 16:47:08] Starting global
[18-11-12 16:47:08] ERROR: mysql/connection.lua:62: attempt to call global 'mysql_ping' (a nil value)
[18-11-12 16:47:08] ERROR: global/money_globals.lu...
local function isMouseInPosition(x, y, width, height)
if not isCursorShowing() then return false end
local cursor = {getCursorPosition()}
local cx, cy = (cursor[1]*screenSize.x), (cursor[2]*screenSize.y)
if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then return true else return false end
end
function isEventHandlerAdded(sEventName, pElementAttachedTo, func)
if type(sEventName) == 'string' and isElement(pElementAttachedTo) and type(func) == 'function' then
local aAttachedFunctions = getEventHandlers(sEventName, pElementAttachedTo)
if type(aAttachedFunctions) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs(aAttachedFunctions) do if v == func then return true end end end
end return false
end
local function scaleElement(sx, sy)
return (screenSize.x - sx)/2, (screenSize.y - sy)/2
end
local icon_x, icon_y = scaleElement(128, 128)
local function drawGUI()
local up = interpolateBetween(100, 0, 0, 0, 0, 0, (getTickCount()-ticks.animTick)/2000, "OutBack")
if anim == "fadein" then
progress = (getTickCount()-ticks.alphaTick)/1000
alpha = interpolateBetween(alpha, 0, 0, 255, 0, 0, progress, "Linear...
function stworz(v)
if not v.login then v.zajety="n" end
v.xyz=split(v.xyz,",")
biz=createPickup ( v.xyz[1], v.xyz[2], v.xyz[3], 3, 1274, 0 )
local biz2 = biz
local tw=createElement("text")
local x2342=v.cost/240
local x234 = math.floor(x2342)
local ***** = math.floor(v.cost/4)
if v.zajety == "n" then v.login = "Brak";v.data="Brak w?asciciela" end
local profir1 = math.floor(x234*24*7)
outputDebugString(v.id)
local format1=("Biznes: %s (ID: %s )nW?a?ciciel: %s nKoszt na 7 dni: %s PLNnPieni?dze co godzine: %s PLNnPieni?dze za sprzeda?: %s PLNnOplacony do: %s nZarobek tygodniowy: %s PLN"):format(v.nazwa,v.id,v.login,v.cost,x234,*****,v.data,profir1)
setElementData(tw, "name", format1)
setElementPosition(tw, v.xyz[1], v.xyz[2], v.xyz[3]+0.8)
setElementData(biz2, "cost", v.cost)
setElementData(biz2, "z", v.zajety)
setElementData(biz2, "name", v.nazwa)
setElementData(biz2, "id", v.id)
setElementData(biz2, "payday",x234)
setElementData(biz2, "saldo",v.saldo)
setElementData(biz2,"data",v.data)
setElementData(biz2, "owner", v.owner)
end
--[[
function bramabiznes(plr)
if isElementWithinColShape(plr, getElementColShape(pickup[plr])) then
local biz2 = pickup[plr]
if getElementData(biz2, "z") == &q...
Witam . Bo mam taki problem . Po zarejestrowaniu i pierwszym zalogowaniu jak si? zarobi troche pieni?dzy i zrobi reconnect to znikaj? a potem jest ju? wszystko dobrze . Podkre?l? ze to tylko pieni?dze znikaj? , nic wi?cej , skrypty podpi?te do bazy , brak b??d?w db3 . Za pomoc piwko . Jak b?d? potrzebne jakie? kody ze skrypt?w prosz? pisa? . Bo sam patrzy?em po skryptach i wed?ug mnie jest wszystko dobrze .
Witam, mam problem z przechowywalnia mianowicie gdy oddaje pojazd do przecho wszystko dzia?a lecz jak chce go odebra? to w panelu nic si? nie pokazuje.
Prosz? pom?c tu macie Clinet:
[lua]local sw,sh = guiGetScreenSize()
local elements = {}
-------------------------------------------
function isEventHandlerAdded(sEventName,pElementAttachedTo,func)
if type(sEventName)=='string' and isElement(pElementAttachedTo) and type(func)=='function' then local aAttachedFunctions = getEventHandlers(sEventName,pElementAttachedTo)
if type(aAttachedFunctions)=='table' and #aAttachedFunctions > 0 then for i,v in ipairs(aAttachedFunctions) do if v==func then return true end end end
end return false
end
-------------------------------------------
function checkButtons(pcl)
if (pcl==localPlayer) then
for _,v in ipairs(elements) do
if isElement(v) then
destroyElement(v)
end
end
showCursor(false)
if isEventHandlerAdded("onClientRender",root,onRender) then
removeEventHandler("onClientRender",root,onRender)
end
end
end
function showButtons(pcl)
if (pcl==localPlayer) then
checkButtons(pcl)
showCursor(true)
addEventHandler("onClientRender",root,onRender)
elements[1]=guiCreateButton(sw/2-(190/2),sh/2+80,190,50,"rozpocznij prace[1]",false)
elements[2]=guiCreateButton(sw/2+300-25,sh/2+150-20,25,20,"zamknij[1]",false)
for _,v in ipairs(elements) do if isElement(v) then guiSetAlpha(v,0) end end
end
end
function isMouseIn ( 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
addEventHandler("onClientMarkerHit", pracagornik, function(h)
if h ~= localPlayer then return end
setElementData(localPlayer, "gui:gornik", true)
showCursor(true)
end)
addEventHandler("onClientRender", root, function()
if not getElementData(localPlayer, "gui:gornik") then return end
dxDrawImage(312*px, 184*py, 400*px, 400*py, "job.png")
end)
function markergornik()
rnd = math.random(1, #drzewa)
markerRandom = createMarker...
Witam mam problem ot?? polega on na tym ?e tworze marker oddawania paczki lecz gdy w niego wejd? nic si? nie dzieje. Brak b??d?w w DB3. Zaznaczam funkcje gdzie tworze marker tym --<<<<.
Client:
bindKey("H", "down", function()
if isElementWithinMarker(localPlayer, markerZABIERANIA) then else return end if getElementData(localPlayer, "praca:magazyn") == true then
losuj = math.random ( 1, #markery ) markery = createMarker(markery[losuj][1],markery[losuj][2],markery[losuj][3])--<<<<. blip = createBlipAttachedTo(markery, 41) setElementData(localPlayer,"mamskrzynke",true) box = createObject(1271, 0, 0, 0) attachElements( box, localPlayer, 0, 0.8, 0.5) triggerServerEvent("klawisze", localPlayer)
else outputChatBox("Nie pracujesz jako Magazynier.") end
end)
function zabierzidaj()
if localPlayer == markery then
setElementData(localPlayer,"wezpaczke", false) setElementData(localPlayer,"mamskrzynke", false) destroyElement(markery) destroyElement(blip) destroyElement(box) triggerServerEvent("klawZabierz", localPlayer) triggerServerEvent("hajs:paczka", localPlayer) end
end
if source == wm.submit then
local selectedRow=guiGridListGetSelectedItem(wm.gridlist) or -1 if selectedRow < 0 then return end
local vehicles=getElementsWithinColShape(przechowalnie[ID_PRZECHO_DO_JAKIEJ_WLAZLES][1],"vehicle")
if #vehicles > 0 then outputChatBox("Miejsce odbioru pojazd?w jest zaj?te!", 255,0,0)
return end
if source == wm.submit then
local selectedRow=guiGridListGetSelectedItem(wm.gridlist) or -1 if selectedRow < 0 then return end
local vehicles=getElementsWithinColShape(przechowalnie[ID_PRZECHO_DO_JAKIEJ_WLAZLES][1],"vehicle")
if #vehicles > 0 then outputChatBox("Miejsce odbioru pojazd?w jest zaj?te!", 255,0,0)
return end
A wi?c tam jak kogo? banuje to wyrzuca go z serwera ale za to mo?e wej?? na serwer i w konsoli mu pisze kto go zbanowa? na ile i pow?d,powodem pewnie jest panel logowania ale nie wiem jak to zrobi? ?eby dzia?a?o
Prosz? o szybk? pomoc
Dodaje skrypt na panel logowania: https://www79.zippyshare.com/v/gp2weyNb/file.html
Witam mam problem z serwerami mta, wbijam pogram z 2 min i blad cd09 ciagle internet dobry mam, reinstalacja gta sa, mta sa, ccleaner, zapory sieciowe, nie pomagaj?, nie mam cheat?w/mod?w/podmianek.
-- Functions function dbSet(...)
if not {...} then return end
local query=dbExec(DBHandler, ...)
return query
end
function dbGet(...)
if not {...} then return end
local query=dbQuery(DBHandler, ...) local result=dbPoll(query, -1)
return result
end
addEventHandler("onResourceStart", resourceRoot, function() DBHandler=dbConnect("mysql", "dbname="..DBName..";host="..DBHost.."", DBUser, DBPass, "share=1")
if DBHandler then
outputDebugString("* Connect to server MYSQL...")
else outputDebugString("* No Connecting to server MYSQL..") end
end)
Oczywiscie luki dbPass itp sa dobrze wypisane tylko tutaj tak zrobilem bo nie chce podawac danych
blad w db3: fire-db/s_db.lua:18: dbPoll failed; You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' fire-admin WHERE serial="mojserial" at line 1
function displayNextCP(el,md)
if el~=localPlayer or not md then return end if not getPedOccupiedVehicle(el) then 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", localPlayer, zarobek, 0)
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", localPlayer, zarobek, 0) end
end
[lua]local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
local w, h=(sx/1680), (sy/1050)
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
local tabulator = false
local czcionka = dxCreateFont("f.ttf", 11*w)
local czcionka2 = dxCreateFont("f.ttf", 17*w)
local k = 1
local n = 13
local m = 13
if not czcionka then
czcionka = "default"
end
local zakladki = {
id = "ID",
name = "Nazwa",
reputation = "RP",
organization = "Organizacja",
uid = "UID",
ping = "Ping",
faction = "Frakcja",
forum = "mta-storiesrpg.pl"
}
local ss = 1
local tabulator=false
local ping = {}
function sort(op1, op2)
if isElement(op1) and isElement(op2) then
return getElementData(op1, "id") < getElementData(op2, "id")
end
end
function gui()
local players = {}
for i,v in ipairs(getElementsByType("player")) do
table.insert(players, v)
end
table.sort(players, sort)
Siema mam taki problem ?e jak kto? wychodzi z serwera nie usuwa si? blips
[lua]function onResourceStart ( resource )
for id, player in ipairs( getElementsByType ( "player" ) ) do
if ( players[player] ) then
createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] )
else
createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] )
end
end
end
function onPlayerSpawn ( spawnpoint )
if ( players[source] ) then
createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] )
else
createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] )
end
end
function onPlayerQuit ()
destroyBlipsAttachedTo ( source )
end
function onPlayerWasted ( totalammo, killer, killerweapon )
destroyBlipsAttachedTo ( source )
end
function setBlipsColor ( source, commandName, r, g, b )
if ( tonumber ( b ) ) then
color = { tonumber ( r ), tonumber ( g ), tonumber ( b ) }
for id, player in ipairs( getElementsByType ( "player" ) ) do
destroyBlipsAttachedTo ( player )
if ( players[player] ) then
createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] )
else
createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] )
end
end
end
end
function setBlipColor ( source, commandName, r, g, b )
if ( tonumber ( b ) ) then
destroyBlipsAttachedTo ( source )
play...
Jak namierzam suszarka lub jak?? broni? to nie wida? celownika a ja zrestartuje skrypt gui to sie pojawia,lecz jak zrobie reconnecta to juz go nie ma,nie wiem jak to naprawi?
Witam, pisze dashboard ale nie dziala, po kliknieciu w dane miejsce nie pokazuje img menu postaci
kod:
[lua]--[[
Info Author: flyBoi_
For resource: InvisibleGame
All rights reserved by InvisibleGame and flyBoi_
----------------------------------------------------
Info Autor: flyBoi_
Dla zasob?w: InvisibleGame
Wszystkie prawa zastrze?one przez InvisibleGame i flyBoi_
]]--
local amercian10 = dxCreateFont("font/american.ttf", 10)
local sx, sy = guiGetScreenSize()
wlaczone = false
aktualnie = glowna
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
addEventHandler("onClientClick", root, function(btn,state)
if btn=="left" and state=="down" then
if wlaczone == true then
if isMouseIn(20/1780*sx, 250/1780*sy, 180/1780*sx, 60/860*sy) then
aktualnie = postac
end
end
end
end)
addEventHandler("onClientRender", root, function(plr)
if wlaczone == true then
if aktualnie == glowna then
dxDrawImage(0/1780*sx, 0/860*sy, 1780/1780*sx, 860/860*sy, "img/db_glowna.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--dxDrawRectangle(20/1780*sx, 250/1780*sy, 180/1780*sx, 60/860*sy, tocolor(255, 0, 0, 180)) -- to bylo pomoc...
Siema chcia?em zmieni? kordy ?eby jak nie zdam prawka ?eby tam tepa?o na podane kordy
addEventHandler("onPlayerQuit", root, function() local veh=getPedOccupiedVehicle(source)
if not veh then return end if getVehicleController(veh) ~= source then return end if not getElementData(veh,"vehicle:lic") then return end
destroyElement(veh) destroyElement(elka) end)
addEventHandler("onVehicleDamage", resourceRoot, function(loss)
if getElementData(source,"player:license:pjL") then return end
local kierowca=getVehicleController(source)
if not kierowca then return end if not getElementData(source,"vehicle:lic") then return end
destroyElement(source) destroyElement(elka) outputChatBox("* Uszkodzi?e?(a?) pojazd, nie zdajesz egzaminu!", kierowca, 255, 0, 0) triggerClientEvent(kierowca, "license:finish", resourceRoot, true) setElementDimension(kierowca, 0) fadeCamera(kierowca,false,1) setTimer(fadeCamera,1000,1,kierowca,true,1) setTimer(setElementPosition,1001,1,kierowca,399.87,2532.34,16.54) end)
Siema zmieniam id innego pojazdu i nie nalicza ?mieci o co chodzi
Kod:
for i,v in ipairs(ustawioneAuta) do local veh = createVehicle(423, v[1], v[2], v[3]) setElementData(veh,"vehicle:desc","Sprz?tanie ulic San AndreasnSweepery imienia kononowicza") toggleVehicleRespawn(veh, true) setElementFrozen(veh,true) setVehicleColor (veh, 0, 204, 153) setVehicleHandling(veh,"maxVelocity",130) end
addEventHandler("onVehicleEnter", resourceRoot, function(plr, seat)
if seat == 0 then
outputChatBox("Rozpocz??e? prac? zbierania ?mieci.",plr,255,255,255) outputChatBox("Aby je zbiera? je?dzij po mapie.",plr,255,255,255) local v = getPedOccupiedVehicle(plr) triggerClientEvent(plr, "PokazKGokno", resourceRoot) setElementFrozen(v,false) setElementData(v,"viewki",0) setElementData(plr,"pracaView",true) toggleControl (plr, "brake_reverse", false ) setPlayerHudComponentVisible (plr, "area_name", false) end
end) addEventHandler("onVehicleExit", resourceRoot, function(plr, seat)
if seat == 0 then
toggleControl (plr, "brake_reverse", true ) triggerClientEvent(plr, "UsunKGokno", resourceRoot) end
end)