Witam, jestem nowym w lua itd... Ale ostatnimi czasami zacz??em tworzy? serwer p?? skrypty z internetu i p?? prawie jakby autorskie z pomoc? innych koleg?w.
Ale nie mog? si? zalogowa?.
Witam Mam Problem gdy? wgralem calego gamemode wraz z baza danych modules oraz po??czylem si? do Mysql nie moge sie zarejestrowac napoczatku myslalem ze to jakis blad hosta czy cos ale chyba jest inny blad wiec gdy zrobilem to na localnej bazie danych oraz serverze wszystko chodzilo tak jak powino nie wiem gdzie jest problem prosze was o pomoc , (nie wiem czy to prawidlowy dzial jesli nie to niech administracja go przeniesie to prawidlowego ps.przepraszam za b?edy )
errory jakie znalazlem w consoli
[2017-02-07 15] ERROR: mysql/connection.lua:342: attempt to call global 'mysql_escape_string' (a nil value)
[2017-02-07 15] ERROR: mysql/connection.lua:342: attempt to call global 'mysql_escape_string' (a nil value)
Cze??, mam pewien skrypt na koszulk? z zmian? skina, koszulka si? pojawia ale skina nie zmienia wszystko dobrze zrobione, dodany jestem do Policji i nwm co si? sta?o.
function przebieralnia( sourcePlayer, command,Model )
if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup ( "Policja" ) ) then
if isElementWithinMarker(sourcePlayer,przebieralniaMarkerpoli1) then
setElementModel(sourcePlayer, 280)
outputChatBox ( "Rozpoczales sluzbe w Policji!", sourcePlayer )
end
end
end
function przebieralnia1( sourcePlayer, command,Model )
if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup ( "Policja" ) ) then
if isElementWithinMarker(sourcePlayer,przebieralniaMarkerpoli2) then
setElementModel(sourcePlayer, 281)
outputChatBox ( "Rozpoczales sluzbe w Policji!", sour...
function isPedAiming ( thePedToCheck )
if isElement(thePedToCheck) then
if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then
if getPedTask(thePedToCheck, "secondary", 0) == "TASK_SIMPLE_USE_GUN" then
return true
end
end
end
return false
end
function isRendering()
if option.actived == true then
if not element then return end
local vx,vy,vz=getElementVelocity(element)
mathSpeed=(vx^2+vy^2+vz^2)^0.5*1.8*100
if mathSpeed < 0 then return end
if value == "vehicle" then
local vid=getElementData(element,"vehicle:id") or "brak"
local driver=getElementData(element,"vehicle:driver") or "brak"
dxDrawText(string.format("%.02f", mathSpeed).." km/h", (809/1024)*w, (451/768)*h, (1000/1024)*w, (482/768)*h, tocolor(255, 255, 255, 255), (2.00/1280)*w, (2.00/720)*h, &q...
Tak jak w temacie mam problem z gui jestem troch? (Bardzo) zielony w lua
bo zacz??em si? bawi? html i css i po zapomina?em podstaw. Problem polega na tym ?e zrobi?em sobie testowe gui w guieditor wzi??em kod i da?em go do pliku lua
i jak wpisa?em w[color=green] function join() [/color] i doda?em [color=green]addEventHandler("onPlayerJoin",getRootElement(),join)[/color] to po w??czeniu skryptu pokaza? mi si? b??d :
[color=red]SCRIPT ERROR: Panels.lua:8: '(expected near 'join' [/color]
i teraz mam pytanie jak uruchomi? gui ?eby mo?na by?o z niego korzysta??
Cze?? , mam pewien problem ot?z to ze premium mi dziala ale teraz mi /zpj nie dziala znaczy /zpj dziala zabiera typowi prawko ale moze do auta wsiasc ktos cos moze? dodalem resource.* do acl itd ale dalej to nie dziala a kodu nie podam bo nie wiem gdzie on sie znajdzuje PS: posiadam paczke gamemode z nlife 2.0
znalazlem ale chyba z?y kod w ogrpg-core >> vehlices_c.lua
[lua]--[[
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.
]]
addCommandHandler("syrenki", function(plr,cmd)
local vehicle=getPedOccupiedVehicle(plr)
if not vehicle then return end
if not getElementData(plr,"player:admin") then return end
removeVehicleSirens(vehicle)
addVehicleSirens(vehicle, 2, 2, true, false, true, false )
setVehicleSirens(vehicle, 1, -0.600, -2.100, 0.400, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.600, -2.100, 0.400, 0, 0, 255, 255, 255 )
end)
-- Get vehicle keys
function getVehicleKey(plr,veh)
if plr and veh then
local uid=getElementData(plr,"player:uid")
if not uid then return end
if getElementData(plr,"player:admin") or uid == getElementData(veh,"vehicle:ownedPlayer") then
return true
else
return false
end
end
end
local categoryL={[592] = true,[553] = true,[577] = true,[488] = true,[511] = tr...
Cze??, mam problem z pewnym skryptem, odpalam i marker si? nie pojawia w og?le nie dzia?a.
Server:
[lua]
local mark = createPickup(1540.06873, -1674.80566, 9838.55469,3, 1275, 1)
setElementInterior(mark, 6)
addEventHandler("onPickupHit",mark,
function(player)
local accName = getAccountName ( getPlayerAccount ( player ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policja" ) ) then
triggerClientEvent(player, "startGGPol", root, player)
end
end
)
addEvent("przebierzPol", true)
addEventHandler("przebierzPol",root,
function(model)
local skin = getElementModel(source)
local gracz = getPlayerName(source)
local nick = getPlayerFromName(gracz)
local acc = getPlayerAccount(nick)
local accName = getAccountName ( getPlayerAccount ( source ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policja" ) ) then
if getAccountData(acc,"PracaPol") == false then
setAccountData(acc,"starySkinPol", skin)
setElementModel(source, model)
setAccountData(acc,"PracaPol", true)
outputChatBox("#FF0036[#919191Policja#FF0036]#919191Rozpoczynasz s?u?be",source,255,255,255,true)
toggleControl(source,"fire",true)
toggleControl(source,"aim_weapon",true)
toggleControl(source,"action", true)
else
outputChatBox("#FF0036[#919191Polic...
Wgra?em j? zgodnie z instrukcja na hosting i wyskakuj? mi takie b??dy :
[code]20170129 092206> [debug] #18 f7418381 in amx_Exec () from plugins/profiler.so
20170129 092206> [debug] #19 f7421f30 in _ZN7amxprof8Profiler8ExecHookEPiiPFiP6tagAMXS1_iE () from plugins/profiler.so
20170129 092206> [debug] #20 f741bfa0 in _ZN8Profiler4ExecEPii () from plugins/profiler.so
20170129 092206> [debug] #21 f741b721 in () from plugins/profiler.so
20170129 092206> [debug] #22 080dfd62 in () from ./samp03svr
20170129 092206> [debug] #23 080950e4 in () from ./samp03svr
20170129 092206> [debug] #24 f744894b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
20170129 092206> [debug] #25 f744b8f8 in () from plugins/crashdetect.so
20170129 092206> [debug] #26 f74220a4 in _ZN7amxprof8Profiler12CallbackHookEiPiS1_PFiP6tagAMXiS1_S1_E () from plugins/profiler.so
20170129 092206> [debug] #27 f741c074 in _ZN8Profiler8CallbackEiPiS0_ () from plugins/profiler.so
20170129 092206> [debug] #28 f741b9a8 in () from plugins/profiler.so
20170129 092206> [debug] #29 f744f916 in amx_Exec () from plugins/crashdetect.so
20170129 092206> [debug] #30 f7447be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
20170129 092206> [debug] #31 f744b659 in () from...
for i,v in ipairs(punktyTankowania) do
zpwp_marker = createMarker(v[1], v[2], v[3]-1.0, "cylinder", 4, 0, 0, 0, 200)
setElementData(zpwp_marker, "stacja_benzynowa", true)
end
Mam gm ogrpg dok?adnie your adventure i mam problem z suszark? admina.
Doda?em sobie admina w bazie jak i acl po wpisaniu /duty suszarka mi sie pojawia ale za nic nie mog? ni? celowa? Og?lnie nie mog? celowa? ?adn? broni?...
Gdy jestem w aucie dzia?a celowanie i strzelanie z pistoletu.
Podczas wysiadania z auta gdy szybko klikne PPM to suszarka mi sie wlaczy ale tylko na chwile az wysiade ca?kowcie a auta
Pomo?e kto??
Jak co? to piszcie jaki plik mam zapoda? tylko dok?adnie bo ja trosz? zielonkawy jestem
Daj? piwerko za pomoc
addEventHandler("onMarkerHit", wejscie, function(el,md)
if getElementType(el) == "player" then if isPedInVehicle(el) then return end
setElementInterior(el, 0) setElementPosition(el, 2899.5, 2891.3999023438, 542.59997558594) end
end)
addEventHandler("onMarkerHit", wyjscie, function(el,md)
if getElementType(el) == "player" then if isPedInVehicle(el) then return end
setElementInterior(el, 0) setElementPosition(el, 2590.20874 2790.89771 10.82031) end
end)
To marker si? mi nie pojawia i niewiem co zrobi? najlepiej to zrobi? screena.
Witam. Jestem pocz?tkuj?cym skrypterem lua.
Tworz? panel gracza z informacjami pod przycisk "F1".
Panel wyswietla si? oraz zamyka sprawdzaj?c czy jest on otwarty lub zamkni?ty.
Doda?em na dole przycisk "Wyjd?".
Problem w tym ?e po klikni?ciu nic si? nie dzieje.
Odrazu dodam ?e przycisk u?ywa tej samej funkcji co klawisz "F1".
Prosz? o pomoc.
Cze??, tworz? skrypt na gokarty, ale nie dzia?a funkcja, kt?ra wytepuje gracza w dane miejsce. za pomoc stawiam !
function komendaGokart(playerSource)
if isElementWithinMarker(playerSource, markerZycia) then
outputChatBox("Zakupi?e?/a? bilet na gokarty!", playerSource) setElementPostion(playerSource, -2130.55908, -84.98100, 35.32031, true)
else outputChatBox("Nie mo?esz tutaj tego u?y?!", playerSource) end
end
addCommandHandler("gokart", komendaGokart)
local function pojazdPusty(veh)
if not veh then return end
local occupants = getVehicleOccupants(veh) local seats = getVehicleMaxPassengers(veh)
if (not seats) then return true end for i=0,seats do local occupant = occupants[seat]
if occupant and (getElementType(occupant)=="player" or getElementType(occupant)=="ped") and getPedOccupiedVehicleSeat(occupant) == i then return false
end
end return true
end
for i,v in ipairs(getElementsByType("vehicle")) do
if (pojazdPusty(v)) then
setVehicleDamageProof(v,true)
else
if getElementData(v,"damageproof") then setVehicleDamageProof(v, true) return end
setVehicleDamageProof(v,false) end
end
addEventHandler ( "onVehicleEnter", root, function()
if source then if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
setVehicleDamageProof(source, false) end
end)
addEventHandler ( "onVehicleExit", root, function()
if source then if (pojazdPusty(source)) then
setVehicleDamageProof(source, true)
else
if getElementData(source,"damageproof") then setVehicleDamageProof(source, true) return end
setVehicleDamageProof(source, false) end
end
end)
Chcia?em, ?eby samochody si? nie pali?y, nie wybucha?y, ale teraz wcale si? nie psuj?.. Za pomoc stawiam .
function chat (hitElement, matchingDimension)
if ( hitElement ) then
if isPlayerInVehicle ( hitElement ) then
outputChatBox ( "Je?eli chcesz naprawi? pojazd wpisz /napraw.nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnNaprawisz wtedy ca?y pojazd. #0066FF(koszt: 130EUR.)", hitElement, 0, 255, 0, true )
else
outputChatBox ( "Musisz by? w poje?dzie!", hitElement, 255, 0, 0, true )
end
end
end
addEventHandler ( "onMarkerHit", mar1, chat )
function naprawa ( playerSource )
if (playerSource) then
if isElementWithinMarker(playerSource, mar1) then
local kasa = getPlayerMoney ( playerSource )
if ( kasa > 129 ) then
takePlayerMoney ( playerSource, 130 )
fixVehicle ( playerSource )
outputChatBox ( "Pojazd zosta? naprawiony!", playerSource )
else
outputChatBox ( "Nie posiadasz pieni?dzy na napraw? pojazdu!" )
end
end
end
end
addCommandHand...
Nie moge w??czy? serwera po wgraniu paczki YAD na poprzedniej wersji Serwerproject i MTA dzia?a?a a teraz tej paczki nie moge odpalic . Serwer ?aduje si? przez chwil? i si? nie w??cza .
function testowySkrypt ( sourcePlayer, commandName, thePlayer, hitElement ) local sprawdz = getPlayerFromNick ( thePlayer )
if ( sprawdz ) then if isPlayerInVehicle ( sprawdz ) then
outputChatBox ( checkedPlayerName .. ", najpierw musisz wysi??? z pojazdu!", sourcePlayer )
else outputChatBox ( "Skrypt w fazie test?w.", sourcePlayer ) end
end
addEventHandler ("onMarkerHit", skrim, testowySkrypt)
Dlaczego nie dzia?a mi ten skrypt?
Prosz? o pomoc, jestem nowy w LUA. Stawiam za pomoc!
Czy istnieje taka mo?liwo??? ElementDaty nie ustawie, bo nie ma jak gracza pobra? do kodu tak samo jak przypisa? kwoty do konta gracza. Wi?c w jaki spos?b mog? to zrobi?? Piwo za pomoc.
i nie wbija mi gdy klikn? 1 opcj? w /zaladuj czyli legalne do tego dialogid.
Wydaje mi si? wszystko dobrze ale pewnie gdzie? jest b??d. Pomo?ecie? Stawiam piwwo i rep
Witam mam taki problem bo jak wchodz? w marker skinow dla frakcji to mi go nie daje a jestem we frakcji umia? by kto? pom?c w tym kodzie? by? bym bardzo wdzi?czny
Witam. Mam sobie taki skrypcik na hud kt?ry musi by? podpi?ty pod onClientPreRender ,poniewa? wymaga zmiany gdy np. gracz skoczy z du?ej wysoko?ci i straci hp. Jednak jest inaczej, ?aduje skrypt ale klatki nowe nie ?aduj? si?, mog? sobie skaka? do ?mierci z du?ej wysoko?ci i hp mam 100 na 100 (dop?ki nie zrobie refresha)
Skrypt:
local krew = math.floor (getElementHealth ( getLocalPlayer() )) local sx, sy = guiGetScreenSize() czcionka= dxCreateFont( "jaapokkisubtract-regular.ttf", 10 )
function dx2() dxDrawText("Krew: "..krew.."/100",sx*(1040/1280),sy*(87/1024),sx*(315/1280),sy*(28/1024), tocolor(255, 255, 255, 255), 1.00, czcionka, "left", "top", false, false, false,false,false) end
addEventHandler("onClientPreRender",getRootElement(),dx2)
Kto? co? ? ,bo wydaje mi si? ?e dobrze kod jest napisany a jak nie b?dzie wyj?cia to mam przygotowany zast?pczy kod ,ale bardziej zale?y mi na tym. Pozdrawiam
Witam, ot?? nie dziala mi, system rejestracji i logowania, bo gdy przy rejestracji ustalimy has?o np, "12345" to do konta b?dzie pasowa?o ka?de inne has?o.
Prosze o pomc
doda?em si? do frakcji mam lidera 99 ale napotka?em kolejny problem gdy? nie mog? zak?ada? skin?w frakcji a pojazdami frakcji normalnie mog? je?dzi? tu podaje link do kodu prosz? o szybk? odpowied? wklej.org/id/3010578
addCommandHandler("mina",function(plr) local x,y,z=getElementPosition(plr) setPedAnimation (plr,"BOMBER","BOM_Plant") setTimer (setPedAnimation,1500,1,plr,false ) local x,y,z = getElementPosition(plr) setTimer(function() ob=createObject(1953,x,y,z-1) mina[plr]=createMarker(x,y,z-1,"cylinder",2,255,255,255,0) setElementData(mina[plr],"mina",getPlayerName(plr)) attachElements(ob,mina[plr]) end,1500,1) outputChatBox("*Rozstawi?e?(a?) min?, uwa?aj na ni?!",plr,255,255,255) end)
addEventHandler("onMarkerHit",root,function(e)
if getElementData(source,"mina") then if getElementType(e)=="player" then if getElementData(source,"mina")==getPlayerName(e) then return end
local x,y,z=getElementPosition(e) createExplosion(x,y,z,3)
if getPlayerFromName(getElementData(source,"mina")) then
outputChatBox("*Gracz "..getPlayerName(e).." wszed? na Twoj? min?!",getPlayerFromName(getElementData(source,"mina")),255,255,255) end for _,v in ipairs(getAttachedElements(source))do destroyElement(v) end
destroyElement(source) end
end
end)
Witam tak jak w temacie mo?e kto? kto si? troche zna na pawn i na mysql by pom?g?, og?lnie chodzi o to ?e mam stocka w ktorym sa zawarte info o tym co ma sie dziac jak gracz wyjdzie z serwa i wyglada to tak
I nic cisza po wyjsciu z serwa w bazie nic sie nie zmienia a raczej dzia?a poniewaz mam jeszcze stocki do logowania i rejestracji i wszystko hula jak na razie