Witam mam problem mam na serwerze paczke spaceMTA i jest nie zapisuje hajsu , srp pomoże ktoś w konsoli nie ma błędów żadnych ani w debugscript 3 auta zapisuje pomoże ktoś ?
/duty też działa
Cze??,
Pr?buj? si? dalej uczy? lua, ale oczywi?cie jeszcze nie pojmuje jakie funkcje bra? i gdzie, no chyba ?e kojarze jakie? rzeczy, daltego narazie postanowi?em tworzy? jakie? ma?e skrypty z pomoc? linijek z innych skrypt?w, ale zrobi? tak aby to dzia?a?o i ?adnie wygl?da?o.
Borykam si? z problemem, ?e gdy rozpoczniemy prac?, daje nam randomowy marker, i po wej?ciu w ten marker powinna by? animacja "?cinania czego?" oraz po zako?czeniu animacji dostawania kasy, lecz po wej?ciu w marker nic si? nie dzieje, dlaczego?
[lua]
--[[
Skrypt: Praca zbieracza Marihuany.
Autor Skryptu: Rynberto
Nie masz prawa u?ycia kodu skryptu bez mojej zgody.
Skrypt utworzony 09.11.2019
]]
createBlip(1102.35, -1189.51, 18.32, 46,2,0,0,0,0,0,275) -- Blip Pracy
local markerPraca = createMarker(1102.35, -1189.51, 17.32, "cylinder", 2.0, 133, 133, 133, 50) -- Marker rozpocz?cia pracy
function MarkerHit ( hitPlayer, matchingDimension )
setElementData(localPlayer, "praca:hodowca", true)
showCursor(true)
setElementFrozen ( localPlayer, true)
vehicle = getPedOccupiedVehicle ( hitPlayer ) -- Je?li gracz b?dzie chcia? wej?? w marker i pracowa? w aucie, to nie b?dzie m?g? tego zrobi?
if hitPlayer ~= localPlayer then return end
if source == markerPraca then
HandleTheRendering() -- poka...
function OtworzSMSA ()
if isPlayerinFaction then
moveObject ( bramaSMSA, 2500, -2091.1001, 1341.6, 2.8 )
setTimer ( function ()
outputChatBox ( "Brama automatycznie zamknie si? za 10 sekund!", player)
end, 10000, 1)
end
moveObject (bramaSMSA, 2500, -2091.1001, 1341.6, 6.2 )
end
addEventHandler ("onMarkerHit", marker, OtworzSMSA)
function isPlayerInFaction(plr)
local sid=getElementData(plr,'player:sid')
if not sid then return end
local result=exports['pystories-db']:dbGet('SELECT 1 FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;', "SMSA", sid)
if result[1] then
return true
else
return false
end
end
Gdy wchodze w marker nic sie nie dzieje, jestem w frakcji, nie ma ?adnych b??d?w w db3
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
Witam. Mam taki problem. Zrobi?em komend? na wyrzucanie gracza. Po wpisaniu /kick pojawia si? okno gdzie mamy wpisac id gracza. Po wpisaniu id i naci?ni?ciu enter nic si? nie dzieje.
Kod:
Mam problem poniewa? po kliknienciu rozpocznij prace nic sie nie dziej
Client
[lua]addEventHandler("onClientGUIClick", root, function(btn,state)
if source == PracaBusLs.submit then
showCursor(false)
guiSetVisible(PracaBusLs.window, false)
guiSetVisible(PracaBusLs.submit, false)
guiSetVisible(PracaBusLs.close, false)
guiSetVisible(PracaBusLs.text, false)
removeEventHandler("onClientRender",root,pracabusls)
triggerServerEvent("PracaStartBusLs", root,localPlayer)
end
if source == PracaBusLs.close then
if guiGetVisible(PracaBusLs.window) == true then
showCursor(false)
guiSetVisible(PracaBusLs.window, false)
guiSetVisible(PracaBusLs.submit, false)
guiSetVisible(PracaBusLs.close, false)
guiSetVisible(PracaBusLs.text, false)
removeEventHandler("onClientRender",root,pracabusls)
end
end
end)[/lua]
Server
[lua]addEvent("PracaStartBusLs", true)
addEventHandler("PracaStartBusLs", resourceRoot, function(el, md)
if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("Parking zajety",el) return end
if getElementData(el,"player:license:pjC") ~= 1 then
outputChatBox("Nie posiadasz Prawojazdy kategori C", source)
return
end
if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
addEventHandler('onPlayerJoin', root, function(playerNick, playerIP, playerUsername, playerSerial) local result=exports['pystories-db']:dbGet('SELECT * FROM pystories_ban WHERE active=1 AND serial=? AND time>NOW() LIMIT 1;', playerSerial)
if #result > 0 then outputConsole("***********************",source) outputConsole(string.format("Zostales zbanowany na serwerze! "),source) outputConsole(string.format("Je?li uwa?asz ,?e ban jeste nies?uszny napisz na naszym forum:(w pracy)! "),source) outputConsole(string.format("Posiadasz Bana do "..result["time"]),source) outputConsole(string.format("Posiadasz Bana za: "..result["reason"]),source) outputConsole("***********************",source) kickPlayer(source,string.format("Kliknij f8 aby zobaczyc wiecej informacji!"))
else exports["pystories-db"]:dbSet("DELETE FROM pystories_ban WHERE type=? AND active=1 AND serial=?", "ban", playerSerial) end
end)
Witam mam drzwi pod scrolla scroluje i nic si? nie dzieje
[lua]bm5 = createMarker(2329.49731, 2486.36792, 1028.81982, "cylinder", 1.0, 0, 0, 0, 0) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d5 = createObject (2930, 2330, 2488.400390625, 1030.5, 0, 0, 0) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function isPlayerInPoliceFaction(plr)
local uid=getElementData(plr,'player:uid')
if not uid then return end
local result=exports['pystories-db']:dbGet('SELECT 1 FROM ogrpg_factions WHERE code=? AND uid=? LIMIT 1;', "SAPD", uid)
if result[1] then
return true
else
return false
end
end
function od6 ( thePlayer)
if isElementWithinMarker(thePlayer, bm5) then
if isPlayerInPoliceFaction(thePlayer) then --Tutaj zmieniasz tylko "Policja"
moveObject ( d5, 2500, 2330, 2490.12, 1030.5) -- Koordy otwartych drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
setPedAnimation(thePlayer,kategoria_animacji,animacja,true,false,false)
end
end
end
function zd6 ( thePlayer)
if isElementWithinMarker(thePlayer, bm5) then
if isPlayerInPoliceFaction(thePlayer) then --Tutaj zmieniasz tylko "Policja"
moveObject ( d5, 2500, 2330, 2488.400390625, 1030.5) -- koordy zamknietch drzwi
setTimer(setPedAnimation, 1066.66, 1, thePlayer)
...
Witajcie nie dziala mi tuner po wejsciu w marker nic sie nie pokazuje brak db3
[code]--[[
Resource: OURGame v2
Developers: Split <[email protected]>
You have no right to use this code without my permission.
(c) 2015 <[email protected]>. All rights reserved.
]]
local jobs={
["tuner-sf"]={
code="tuner-sf",
desc="Praca Tunera",
desc2="",
positionMarker={-2270.89,-149.22,35},
text="* Nie jeste? zatrudniony(a) jako tuner w tym warsztacie.",
cuboid={-2297.40,-158.27,34.5, 44, 55.75, 6.5},
maxEmployees=2,
},
}
for i,v in pairs(jobs) do
local marker=createMarker(v.positionMarker[1], v.positionMarker[2], v.positionMarker[3]-0.90, "cylinder", 1.2, 78, 255, 0, 155)
setElementDimension(marker, v.positionMarker[5] or 0)
setElementInterior(marker, v.positionMarker[4] or 0)
setElementData(marker,"m:duty",v.code or 0)
local cs= createColCuboid(v.cuboid[1],v.cuboid[2],v.cuboid[3],v.cuboid[4],v.cuboid[5],v.cuboid[6])
setElementData(cs,"m:duty",v.code)
addEventHandler ( "onColShapeLeave", cs, function(el,md)
if getElementData(el,"player:duty") == getElementData(source,"m:duty") then
setElementData(el,"player:duty",false)
outputChatBox("Wyszed?e? poza teren Tunera.", el)
local skin=getElementData(el,"player:skin")
setElement...
Siemaneczko, mo?e kto? wie ? i pomo?e przerobi? t? przechowalnie:
PrzechoZforumGtao
pod SystemPojazdowPanaPrezesa
Zmieni?em go tak
[lua]local polaczenie = dbConnect ( "sqlite", "db.db" )
dbExec ( polaczenie, "CREATE TABLE IF NOT EXISTS Zapis ( ID INTEGER, Paliwo INTEGER, Przebieg INTEGER, Tuning VARCHAR, Model INTEGER, Owner VARCHAR )" )
local marker=createMarker(-273.65625, 1177.74316, 18.59375,"cylinder",5,255,0,255,100)--- Marker chowania pojazdu
local odb=createMarker(-265.20197, 1185.64063, 18.74219,"cylinder",3,255,0,0,100)--- Marker odbioru pojazdu
addEventHandler("onMarkerHit",root,function(e)
if source==marker then
if getElementType(e)=="vehicle" then
local id=getElementData(e,"car_id")
if id then
local paliwo=getElementData(e,"pojazd_paliwo") or 0
tabela = {}
for _,v in ipairs ( getVehicleUpgrades ( e ) ) do
table.insert ( tabela, v )
end
local tuning = table.concat ( tabela, "," )
local owner=getElementData(e,"pojazd_przebieg") or 0
local model=getElementModel(e)
dbExec(polaczenie,"INSERT INTO `Zapis` (ID, Paliwo, Przebieg,Tuning,Owner,Model) VALUES (?,?,?,?,?,?)",id,paliwo,przebieg,tuning,owner,model)
destroyElement(e)
end
end
elseif source==odb then
if getElementType(e)=="player" then
local q=dbQuery(polacz...
Witam, jak mog? naprawi? ten problem, ?e na niekt?re obiekty nie dzia?a ten skrypt, s? dla niego tak jakby nie widzialne (Oczywi?cie obiekty s? stworzone createObject). A na nie kt?re dzia?a.
function onPlayerItemClick(mb,bs,el)
if not el then outputChatBox("sdf") return end if mb == "left" then if bs == "down" then if getElementType(el) == "object" then
destroyElement(el) outputChatBox("test") end
end
end
end
addEventHandler("onPlayerClick",root,onPlayerItemClick)
Witam Mam taki kod:
[code]
switch(dialogid)
{
case DIALOG_LOG:
{
switch(response)
{
case 0:
{
new string[128];
Kick(playerid);
format(string, 128, "Gracz %s(%d) zosta? wyrzucony z serwera, pow?d: pr?ba zespawnowania si? bez zalogowania", PlayerName(playerid), playerid);
SendClientMessageToAll(CZ, string);
}
case 1:
{
new konto[128];