Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-06-11, 21:57


Aerons95







Wiek: 30
Na forum: 4048 dni
Posty: 16

Piwa: 5

Respekt: 45,3

Za ka?d? pomoc leci :piwo: :piwo: :piwo:

Tu mam jaki? kod... B?dzie to dzia?a??

Kod:



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

-- funkcja pomocna ByShuffle -- skalowanie gui / tekstow
mojeW,mojeH = 640, 480
sW,sH = guiGetScreenSize()
width, height = (sW/mojeW), (sH/mojeH)



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 pokazSpeed(speed,id,paliwo,ostatni,akcja_name)
dxDrawRectangle(199*width, (168-35)*height, 246*width, 44*height, tocolor(0, 0, 0, 155), true)
if speed then
dxDrawText(speed, 210*width, (168-33)*height, 431*width, 191*height, tocolor(255, 255, 255, 255), 2*width, "default", "left", "top", false,false,true,false,false,0,0,0)
end
if id then
dxDrawText(id, 0*width, (168-34)*height, 440*width, 191*height, tocolor(255, 255, 255, 255), 0.7*width, "default", "right", "top", false,false,true,false,false,0,0,0)
end
if paliwo then
dxDrawText(paliwo, 0*width, (168-23)*height, 440*width, 191*height, tocolor(255, 255, 255, 255), 0.7*width, "default", "right", "top", false,false,true,false,false,0,0,0)
end
if ostatni then
dxDrawText(ostatni, 0*width, (168-12)*height, 440*width, 191*height, tocolor(255, 255, 255, 255), 0.7*width, "default", "right", "top", false,false,true,false,false,0,0,0)
end
if akcja_name then
dxDrawText("AKCJA: " ..tostring(akcja_name), 210*width, (168-4)*height, 431*width, 191*height, tocolor(255, 0, 0, 255), 0.7*width, "default", "left", "top", false,false,true,false,false,0,0,0)
end
end

akcja = 1

local options = {
["odblokuj"]="Odblokuj pojazd",
["odeslij"]="Ode?lij pojazd do przechowalni",
["tp"]="Teleportuj pojazd",
["reczny"]="reczny",
}

function onClientRender()
if getPedWeapon( localPlayer ) == 22 and isPedAiming(localPlayer) and getPedTarget(localPlayer) then
if getElementType(getPedTarget(localPlayer)) == "vehicle" or isElementToBarierka(getPedTarget(localPlayer)) then
local el = getPedTarget(localPlayer)
if isElementToBarierka(getPedTarget(localPlayer)) then
pokazSpeed("Obiekt: " ..getElementModel(el),nil,"W?a?ciciel: "..getElementData(el,"wlasciciel"),nil,"Usu? obiekt")
else
local sx, sy, sz = getElementVelocity ( el )
local speed = math.ceil( ( ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) ) *0.7*180*1.310 )
local speed = tostring(speed) .. " km/h"
local id = getElementData(el, "dbid") or getElementData(el, "fID") or "BRAK"
local id = "ID: "..tostring(id)
local paliwo,bak = getElementData(el, "paliwo") or 0, getElementData(el, "bak") or 0
local paliwko = "Paliwo: " .. string.format("%02.1f",paliwo) .. " / " .. tostring(bak)
local ostatni = getElementData(el, "ostatni")
local ostatni = "Ostatni: " .. tostring(ostatni)
local action = actions[akcja]
local action = options[action]
if action == "reczny" then if isElementFrozen(el) then action = "Spu?? r?czny" else action = "Zaci?gnij r?czny" end end
pokazSpeed(speed,id,paliwko,ostatni,action)
end
else
--removeEventHandler("onClientRender",root,onClientRender)
--unbindKey ( "mouse_wheel_up", "down", up)
--unbindKey ( "mouse_wheel_down", "down", down)
--unbindKey ( "mouse1", "down", click )
end
else
--removeEventHandler("onClientRender",root,onClientRender)
--unbindKey ( "mouse_wheel_up", "down", up)
--unbindKey ( "mouse_wheel_down", "down", down)
--unbindKey ( "mouse1", "down", click )
end
end

local FrakcjeACL = {
["SAPD"]={"reczny","odblokuj"},
["SAMP"]={"reczny"},
}


local ACL = {
["Support"]={"odblokuj","odeslij","tp"},
["Administrator"]={"odblokuj","odeslij","tp","reczny"},
["Admin"]={"odblokuj","odeslij","tp","reczny"},
}




function click()
if getPedWeapon( localPlayer ) == 22 and isPedAiming(localPlayer) and getPedTarget(localPlayer) then
if getElementType(getPedTarget(localPlayer)) == "vehicle" or isElementToBarierka(getPedTarget(localPlayer)) then
local el = getPedTarget(localPlayer)
local action = actions[akcja]
if isElementToBarierka(el) then
triggerServerEvent ( "destroy", localPlayer, el )
elseif action == "reczny" then
if getElementData(el, "reczny") or getElementData(el, "dbid") then
triggerServerEvent ( "reczny", localPlayer, el )
end
elseif action == "tp" then
triggerServerEvent( "tp", localPlayer, el )
elseif action == "odblokuj" then
setVehicleLocked(el, false)
triggerServerEvent( "odblokuj", localPlayer, el )
elseif action == "odeslij" then
triggerServerEvent ( "vehDP", localPlayer, el )
end
end
end
end


function up()
if not actions then return end
if akcja == #actions then
akcja = 1
else
akcja = akcja + 1
end
end

function down()
if not actions then return end
if akcja == 1 then
akcja = #actions
else
akcja = akcja - 1
end
end





-- podmianka
addEventHandler("onClientResourceStart", resourceRoot, function ()
txd = engineLoadTXD ( "colt45.txd" )
engineImportTXD ( txd, 346 )
dff = engineLoadDFF ( "colt45.dff", 346 )
engineReplaceModel ( dff, 346 )
end)

function isElementToBarierka(element)
if getElementType(element) == "object" then
if getElementModel(element) == 1228 or getElementModel(element) == 1238 or getElementModel(element) == 3526 or getElementModel(element) == 3264 or getElementModel(element) == 3265 or getElementModel(element) == 2899 then
if getElementData(localPlayer, "ACL") == "Admin" and getElementData(element, "wlasciciel") then
return true
end
end
end
return false
end

function is(table,value)
for i,v in ipairs(table) do
if value == v then return true end
end
return false
end

addEventHandler("onClientPlayerTarget",root, function(element)
local weapon = getPedWeapon ( localPlayer )
if not isEventHandlerAdded("onClientRender",root,onClientRender) then
if weapon == 22 and isPedAiming(localPlayer) and element then
if getElementType(element) == "vehicle" or isElementToBarierka(element) then
addEventHandler("onClientRender",root,onClientRender)
bindKey ( "mouse_wheel_up", "down", up)
bindKey ( "mouse_wheel_down", "down", down)
bindKey ( "mouse1", "down", click )
actions = {}
if getElementData(localPlayer,"ACL") then
for i,v in ipairs(ACL[getElementData(localPlayer,"ACL")]) do
table.insert(actions,v)
end
end
if getPlayerTeam(localPlayer) and getTeamName(getPlayerTeam(localPlayer)) and FrakcjeACL[getTeamName(getPlayerTeam(localPlayer))] then
for i,v in ipairs(FrakcjeACL[getTeamName(getPlayerTeam(localPlayer))]) do
if not is(actions,v) then table.insert(actions,v) end
end
end
end
end
else
actions = nil
removeEventHandler("onClientRender",root,onClientRender)
unbindKey ( "mouse_wheel_up", "down", up)
unbindKey ( "mouse_wheel_down", "down", down)
unbindKey ( "mouse1", "down", click )
end
end)





I tu jakis skrypt

http://www.speedyshare.co...zarkaAdmina.zip

PROSZE O POMOC :(

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 3 piw(a):
Zuzka2001, VirtualYt, eo120eo
Wysłany: 2015-06-11, 22:01


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

Sprawdz?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-11, 22:10


Aerons95







Wiek: 30
Na forum: 4048 dni
Posty: 16

Piwa: 5

Respekt: 45,3

Co mam sprawdzic??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-11, 22:12


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

No czy ten kod dziala

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-11, 23:06


Aerons95







Wiek: 30
Na forum: 4048 dni
Posty: 16

Piwa: 5

Respekt: 45,3

No nie dzia?a, wi?c was prosze o sprawdzenie go;-;

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-11, 23:11


Paul_Powelll







Wiek: 26
Na forum: 4425 dni
Posty: 41

Piwa: 3313

Respekt: 90

A masz ustawion? przechowalnie, gdzie ma odsy?a?? Do??cz to do skryptu :) licze na :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-11, 23:13


Aerons95







Wiek: 30
Na forum: 4048 dni
Posty: 16

Piwa: 5

Respekt: 45,3

Kod:

local cs_zostawianie=createColCuboid(-97.93,1119.96,18.70,10,18,4)
local cs_automat=createColSphere(-95.07,1124.97,18.70,1)

local w1={}
w1.win = guiCreateWindow(0.7412,0.34,0.2313,0.4133,"Przechowalnia pojazd?w",true)
w1.btn_zostaw = guiCreateButton(0.0541,0.1371,0.8919,0.379,"Zostaw pojazd",true,w1.win)
w1.btn_odbierz = guiCreateButton(0.0541,0.5565,0.8919,0.379,"Odbierz pojazd",true,w1.win)
guiSetVisible(w1.win,false)

local wz={}
wz.win = guiCreateWindow(0.7531,0.3479,0.2109,0.3792,"Rejestracja pojazd?w",true)
wz.lbl = guiCreateLabel(0.037,0.1009,0.9185,0.3552,"Pojazdy mog? pozostawi? tylko ich w?a?ciciele lub s?u?by miejskie/policja. Odbi?r pojazdu kosztuje $1000. Odbioru pojazdu mo?e dokona? tylko w?a?ciciel, posiadaj?cy przy sobie klucz.", true, wz.win)
wz.cmb=guiCreateComboBox(0.037, 0.50,0.9185, 0.6352, "Pojazd", true, wz.win)
wz.btn=guiCreateButton(0.037, 0.65, 0.9185, 0.3, "Pozostaw pojazd", true, wz.win)
guiLabelSetHorizontalAlign(wz.lbl,"center",true)
guiSetFont(wz.lbl,"default-small")

guiSetVisible(wz.win, false)

local wo={}
wo.win= guiCreateWindow(0.7531,0.3479,0.2109,0.3792,"Odbi?r auta",true)
wo.lbl = guiCreateLabel(0.037,0.1209,0.9185,0.1352,"Wska? klucz do pojazdu, kt?ry chcesz odebra?", true, wo.win)
wo.cmb=guiCreateComboBox(0.037, 0.3, 0.9185, 0.6352, "Klucz", true, wo.win)
wo.btn=guiCreateButton(0.037, 0.6, 0.9185, 0.3, "Odbierz", true, wo.win)

guiLabelSetHorizontalAlign(wo.lbl,"center",true)
guiSetFont(wo.lbl,"default-small")

guiSetVisible(wo.win, false)

addEventHandler("onClientColShapeHit", cs_automat, function(he,md)
if not md then return end
if he~=localPlayer then return end
guiSetVisible(w1.win, true)
guiSetVisible(wz.win, false)
guiSetVisible(wo.win, false)
end)

addEventHandler("onClientColShapeLeave", cs_automat, function(he,md)
if he~=localPlayer then return end
guiSetVisible(w1.win, false)
guiSetVisible(wz.win, false)
guiSetVisible(wo.win, false)
end)

local function pojazdyWStrefieZostawiania()
local pojazdy=getElementsWithinColShape(cs_zostawianie, "vehicle")
local pojazdy2={}
for i,v in ipairs(pojazdy) do
if (getElementData(v,"dbid") and not getVehicleController(v)) then
table.insert(pojazdy2, v)
end
end
return pojazdy2
end

-- ODBIERANIE
addEventHandler("onClientGUIClick", w1.btn_odbierz, function()
-- if (getPlayerName(localPlayer)~="Bob_Euler") then
-- outputChatBox("* Na wy?wietlaczu automatu pojawia si? migocz?cy napis 'ERROR'.")
-- guiSetVisible(w1.win, false)
-- return
-- end
guiSetVisible(w1.win, false)
guiSetVisible(wz.win, false)
guiSetVisible(wo.win, true)
guiComboBoxClear(wo.cmb)
local EQ=exports["lss-gui"]:eq_get()
for i,v in ipairs(EQ) do
if (v.itemid and tonumber(v.itemid)==6 and v.subtype and tonumber(v.subtype)) then
guiComboBoxAddItem(wo.cmb,tostring(v.subtype))
end
end
end,false)

addEventHandler("onClientGUIClick", wo.btn, function()
local i=guiComboBoxGetSelected(wo.cmb)
if not i then return end
local kid = tonumber(guiComboBoxGetItemText(wo.cmb, i))
if (getPlayerMoney()<500) then
outputChatBox("(( Nie sta? Ci? na odbi?r pojazdu ))")
return
end
triggerServerEvent("doOdbiorPojazdu", resourceRoot, localPlayer, kid)

end)


-- ZOSTAWIANIE -------------------------------------

addEventHandler("onClientGUIClick", w1.btn_zostaw, function()
-- if (getPlayerName(localPlayer)~="Bob_Euler") then
-- outputChatBox("* Na wy?wietlaczu automatu pojawia si? migocz?cy napis 'ERROR'.")
-- guiSetVisible(w1.win, false)
-- return
-- end
local pojazdy=pojazdyWStrefieZostawiania()
if (#pojazdy<1) then
outputChatBox("* Na wy?wietlaczu automatu pojawia si? instrukcja:")
outputChatBox(" Zaparkuj pojazd przed bram? parkingu.")
guiSetVisible(w1.win, false)
return
end

guiSetVisible(w1.win, false)
guiSetVisible(wz.win, true)

guiComboBoxClear(wz.cmb)
for i,v in ipairs(pojazdy) do
local dbid=getElementData(v,"dbid")
local model=getElementModel(v)
local nazwa=getVehicleNameFromModel(model) or " "
guiComboBoxAddItem(wz.cmb,tostring(dbid)) -- string.format("%d - %s", dbid, nazwa))
end

end, false)

addEventHandler("onClientGUIClick", wz.btn, function()
-- if (getPlayerName(localPlayer)~="Bob_Euler") then
-- outputChatBox("* Na wy?wietlaczu automatu pojawia si? migocz?cy napis 'ERROR'.")
-- guiSetVisible(w1.win, false)
-- guiSetVisible(wz.win, false)
local i=guiComboBoxGetSelected(wz.cmb)
if not i then
outputChatBox("* Na wy?wietlaczu automatu pojawia si? migocz?cy napis 'ERROR'.")
return
end
local kid = tonumber(guiComboBoxGetItemText(wz.cmb, i))
if not kid then
outputChatBox("* Na wy?wietlaczu automatu pojawia si? migocz?cy napis 'ERROR'.")
end
triggerServerEvent("doZostawieniePojazdu", resourceRoot, localPlayer, kid)
return
-- end
end, false)


--
-- triggerClientEvent(plr, "doHideWindows", resourceRoot)
addEvent("doHideWindows",true)
addEventHandler("doHideWindows", resourceRoot, function()
guiSetVisible(w1.win, false)
guiSetVisible(wz.win, false)
guiSetVisible(wo.win, false)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-12, 10:26


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Ty masz podpi?? suszark?, aby wysy?a?a pojazd do przecho, a ?e masz akurat LSS-RP czyli XYZZY RP, to musisz si? pobawi? z mySQL aby to wygl?da?o na co? takiego :

if opcja_wyboru == przecho then
exports[lss-core]:dbSet(i tutaj wciskasz pojazd przez mysql do przecho)

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-12, 14:40


PanPrezes







Wiek: 32
Na forum: 4555 dni
Posty: 63
Nick w MP: PanPrezes

Piwa: 979

Respekt: 111,2
Respekt: 111,2

Ten kod mi ?mierdzi XyzzyRP o ile si? nie myl?.

Podpis
Reaktywacja zapomnianego serwera YL-Games!


Prace nad serwerem 54/100%

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-12, 14:44


Aerons95







Wiek: 30
Na forum: 4048 dni
Posty: 16

Piwa: 5

Respekt: 45,3

Nie smierdzi... Dostalem go od kolegii, ale nie wytlumaczyl co i jak. Jezeli mozesz to wytlumacz mi wszyskto.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-12, 15:53


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

1: To jest xyzzyrp
2: Wyka? ziomeczku cho? odrobin? intencji do napisania tego samemu, to nie jest forum : daj kod, poczekaj a? kto? zrobi reszt?, tylko POMOC.

Da?em Ci wystarczaj?c? podpowied? co masz zrobi?... Szukasz w suszarce opcj? "Oddaj do przechowalni" czy tam na parking, i tam wciskasz

dbExec(connection, "tabela pojazdow, WHERE id=? and parking(przecho)=?", getElementData(vehicle, "dbid"), 1) cos takiego...

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-12, 19:16


Aerons95







Wiek: 30
Na forum: 4048 dni
Posty: 16

Piwa: 5

Respekt: 45,3

Nie mam dlatego was o to prosze ;(

Postaw piwo autorowi tego posta
 

 
Tagi: suszarka :: administratora
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Suszarka Administratora Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku