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

Wysłany: 2020-11-29, 18:11


TheHeniu







Wiek: 22
Na forum: 3443 dni
Posty: 25
Nick w MP: Arbuziik

Piwa: 607

Respekt: 60

Witam, mam pytanie czy da si? zrobi? usuwanie organizacji ?

Mia?em pomys? przerobi? tworzenie organizacji kod:

s_lua

--[[
    System tworzenia organizacji
    @author Malentas
    @dla gtao.pl
    Zakaz usuwania autora!
    Uzupe?nij swoje x,y,z
]]

local markerek createMarker(1386.291408.4810.91-1"cylinder"1.0509020075)
setElementDimension(markerek1)

local text=createElement("text")
setElementData(text,"name","Zak?adanie organizacji\nKoszt 850 000\nWymagania: 1500 Reputacji")
setElementPosition(text,1386.291408.4810.91)
setElementDimension(text,1)

addEvent("zalozs"true)
addEventHandler("zalozs"root, function(nazwa)
if tonumber(getElementData(source"player:srp")) < 1500 then
exports['noti']:showBox(source,"warning","Nie posiadasz 1500 RP.")
return
end
if getElementData(source"player:organization"then
exports['noti']:showBox(source,"warning","Posiadasz organizacje.")
return
end
if tonumber(getPlayerMoney(source)) < 850000 then
exports['noti']:showBox(source,"warning","Nie sta? si? na organizacje.")
return
end
takePlayerMoney(source,850000)
setElementData(source"player:organization"nazwa)
exports["pystories-db"]:dbSet("INSERT INTO ms_organizacje SET uid=?, code=?, rank=?, login=?"getElementData(source"player:sid"), nazwa"4"getPlayerName(source))
exports['noti']:showBox(source,"error","Pomy?lnie za?o?y?e? organizacje o nazwie "..nazwa.."")
end)


c_lua

local screenWscreenH guiGetScreenSize()
local sxsy guiGetScreenSize()
local pxpy = (sx/1920), (sy/1080)
function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*screenW,cy*screenH
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

podanaNazwa guiCreateEdit(0.420.470.130.04"Podaj nazwe organizacji",false)    
local font1 dxCreateFont(":pseudol-nametagi/f/droid-sans.ttf"12)
local font11 dxCreateFont(":pseudol-nametagi/f/droid-sans.ttf"10)
local font12 dxCreateFont(":pseudol-nametagi/f/droid-sans.ttf"10)
guiSetVisible(podanaNazwafalse)  
name getPlayerName(localPlayer)

function isMouseIn xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    if ( cx >= and cx <= width ) and ( cy >= and cy <= height then
        return true
    else
        return false
    end
end


local animsbuiltins = {}, {"Linear""InQuad""OutQuad""InOutQuad""OutInQuad""InElastic""OutElastic""InOutElastic""OutInElastic""InBack""OutBack""InOutBack""OutInBack""InBounce""OutBounce""InOutBounce""OutInBounce""SineCurve""CosineCurve"}

function table.find(tv)
    for ka in ipairs(t) do
        if == v then
            return k
        end
    end
    return false
end

function animate(fteasingdurationonChangeonEnd)
    assert(type(f) == "number""Bad argument @ 'animate' [expected number at argument 1, got "..type(f).."]")
    assert(type(t) == "number""Bad argument @ 'animate' [expected number at argument 2, got "..type(t).."]")
    assert(type(easing) == "string" or (type(easing) == "number" and (easing >= or easing <= #builtins)), "Bad argument @ 'animate' [Invalid easing at argument 3]")
    assert(type(duration) == "number""Bad argument @ 'animate' [expected function at argument 4, got "..type(duration).."]")
    assert(type(onChange) == "function""Bad argument @ 'animate' [expected function at argument 5, got "..type(onChange).."]")
    table.insert(anims, {from fto teasing table.find(builtinseasing) and easing or builtins[easing], duration durationstart getTickCount( ), onChange onChangeonEnd onEnd})
    return #anims
end

function destroyAnimation(a)
    if anims[athen
        table.remove(animsa)
    end
end

addEventHandler("onClientRender"root, function( )
    local now getTickCount( )
    for k,v in ipairs(anims) do
        v.onChange(interpolateBetween(v.from00v.to00, (now v.start) / v.durationv.easing))
        if now >= v.start+v.duration then
            if type(v.onEnd) == "function" then
                v.onEnd( )
            end
            table.remove(animsk)
        end
    end
end)




function gui()
    dxDrawRectangle(686*px327*py507*px394*pytocolor(202020220), false)
    dxDrawRectangle(screenW 0.3568screenH 0.3028screenW 0.2646screenH 0.0306tocolor(0183138), false)

    dxDrawText("Usuwanie organizacji"screenW 0.4396+1screenH 0.3065+1screenW 0.5427+1screenH 0.3296+1tocolor(0,0,0a), 1.00font1"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Usuwanie organizacji"screenW 0.4396screenH 0.3065screenW 0.5427screenH 0.3296tocolor(255255255a), 1.00font1"center""center"falsefalsefalsefalsefalse)

    dxDrawText("Witaj "..name.."!\nTutaj za?o?ysz swoj? organizacje.\nKoszt to 850.000 $\nAby za?o?y? organizacje musisz posiada? 1500 RP!"screenW 0.3677+1screenH 0.3407+1screenW 0.6135+1screenH 0.4907+1tocolor(0,0,0a), 1.00font11"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Witaj "..name.."!\nTutaj za?o?ysz swoj? organizacje.\nKoszt to 850.000 $\nAby za?o?y? organizacje musisz posiada? 1500 RP!"screenW 0.3677screenH 0.3407screenW 0.6135screenH 0.4907tocolor(222,222,222a), 1.00font11"center""center"falsefalsefalsefalsefalse)

        if isMouseIn(screenW 0.3854screenH 0.5935screenW 0.2120screenH 0.0454then
            --dxDrawImage(screenW 0.3854screenH 0.5935screenW 0.2120screenH 0.0454":im-zakladanieorg/anuluj.png"000tocolor(0183138), false)
            dxDrawText("Anuluj"screenW 0.4385screenH 0.6065screenW 0.5417screenH 0.6296tocolor(0183138), 1.00font12"center""center"falsefalsefalsefalsefalse)   
            else 
                --dxDrawImage(screenW 0.3854screenH 0.5935screenW 0.2120screenH 0.0454":im-zakladanieorg/anuluj.png"000tocolor(255255255255), false)
                dxDrawText("Anuluj"screenW 0.4385screenH 0.6065screenW 0.5417screenH 0.6296tocolor(255255255255), 1.00font12"center""center"falsefalsefalsefalsefalse)  
            end 
            if isMouseIn(screenW 0.3854screenH 0.5352screenW 0.2120screenH 0.0454then 
                --dxDrawImage(screenW 0.3854screenH 0.5352screenW 0.2120screenH 0.0454":im-zakladanieorg/stworz.png"000tocolor(0183138), false)
                dxDrawText("Usu?"screenW 0.4385screenH 0.5481screenW 0.5417screenH 0.5713tocolor(0183138), 1.00font12"center""center"falsefalsefalsefalsefalse)
            else 
                --dxDrawImage(screenW 0.3854screenH 0.5352screenW 0.2120screenH 0.0454":im-zakladanieorg/stworz.png"000tocolor(255255255255), false)
                dxDrawText("Usu?"screenW 0.4385screenH 0.5481screenW 0.5417screenH 0.5713tocolor(255255255255), 1.00font12"center""center"falsefalsefalsefalsefalse)
            end
end

addEventHandler("onClientMarkerHit"resourceRoot, function(el)
if el ~= localPlayer then return end
if isCursorShowing el then return end
addEventHandler("onClientRender"getRootElement(), gui)
showCursor(true)
guiSetVisible(podanaNazwatrue)
animate(0239"Linear"800, function(valuevalue end)

end)

addEventHandler("onClientMarkerLeave"resourceRoot, function(el)
if el ~= localPlayer then return end
removeEventHandler("onClientRender"getRootElement(), gui)
showCursor(false)
guiSetVisible(podanaNazwafalse)
end)

addEventHandler("onClientClick"root, function(btnstate)
if btn == "left" and state == "down" then
if isMouseIn(screenW 0.3854screenH 0.5352screenW 0.2120screenH 0.0454) and guiGetVisible(podanaNazwathen
local nazwa guiGetText(podanaNazwa)
if nazwa:len() < 2 then
exports['noti']:showBox("info","Zbyt ma?o znak?w.")
return
end
if nazwa:len() > 15 then
exports['noti']:showBox("info","Zbyt du?o znak?w.")
return
end
triggerServerEvent("zalozs"localPlayernazwa)
end
end
end)

addEventHandler("onClientClick"root, function(btnstate)
if btn == "left" and state == "down" then
if isMouseIn(screenW 0.3854screenH 0.5935screenW 0.2120screenH 0.0454) and guiGetVisible(podanaNazwathen
removeEventHandler("onClientRender"getRootElement(), gui)
showCursor(false)
guiSetVisible(podanaNazwafalse)
showCursor(false)
end
end
end)


Tylko chodzi mi jak wykona? export do bazy aby usuwa?o tak?e sprawdzenie czy j? w og?le ma.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-11-29, 18:30


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-11-29, 18:47


TheHeniu







Wiek: 22
Na forum: 3443 dni
Posty: 25
Nick w MP: Arbuziik

Piwa: 607

Respekt: 60

Wilq, mo?esz poda? jaki? przyk?ad ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-11-29, 19:15


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

DELETE FROM customers WHERE country "France"


Postaw piwo autorowi tego posta
 

 
Tagi: organizacja
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Organizacja Odpowiedz do tematu

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