GTA Közösség - A magyar GTA fórum
Multi Theft Auto (MTA) => MTA: Szerverfejlesztés => Segítségkérés => A témát indította: Killerke23 - 2019. május 20. - 17:43:17
-
Bejelentkezés infobox
Sziasztok van egy script, ha érdeklődnétek, NEM AZ ENYÉM!, és azt szeretném, ha ki kickelek valakit akkor felül írja ki hogy Player has been kick Admin (reason), vagy ha ez nem lehetséges akkor amiko beírom hogy /cv Admiral, akkor Sikeresen létrehoztál egy járművet: Admiral!, mit kell kicserélni benne hogy ez működjön?
[INFOBOX]: client
local screen = {}
screen.x, screen.y = guiGetScreenSize()
local anims, builtins = {}, {\"Linear\", \"InQuad\", \"OutQuad\", \"InOutQuad\", \"OutInQuad\", \"InElastic\", \"OutElastic\", \"InOutElastic\", \"OutInElastic\", \"InBack\", \"OutBack\", \"InOutBack\", \"OutInBack\", \"InBounce\", \"OutBounce\", \"InOutBounce\", \"OutInBounce\", \"SineCurve\", \"CosineCurve\"}
local itypes = {
alert = \"alert.png\",
info = \"info.png\",
success = \"success.png\",
warning = \"warning.png\",
}
local itypes2 = {\"alert\",\"info\",\"success\",\"warning\"}
local font = dxCreateFont(\"helveticaneue.otf\",10)
local messages = {}
local infobox = {}
infobox.w = 200
infobox.h = 33
infobox.y = 10
infobox.x = screen.x/2 - infobox.w/2
function createInfoBox(message,itype)
local id = #messages+1
table.insert(messages,id,{
id = id,
message = message,
itype = itype,
x = infobox.x,
y = infobox.y,
w = infobox.h,
h = infobox.h,
dWidth = infobox.h + dxGetTextWidth(message,1,font) + 10,
opacity = 0, -- 0-1 eső érték
animState = false,
})
createAnimation(0,1,4,300,function(animation) messages[id].opacity = animation end,function()
createAnimation(infobox.h,messages[id].dWidth,4,300,function(animation) messages[id].w = animation end,function()
setTimer(function()
createAnimation(messages[id].dWidth,infobox.h,4,300,function(animation) messages[id].w = animation end,function()
createAnimation(1,0,4,300,function(animation) messages[id].opacity = animation end,function()
messages[id] = nil
end)
end)
end,2000,1)
end)
end)
end
function renderInfoBox()
local i = 0
for _,v in pairs(messages) do
v.x = screen.x/2 - v.w/2
-- Szöveg háttere
dxDrawRectangle(v.x,v.y + i*v.h + i*10,v.w,v.h,tocolor(0,0,0,170*v.opacity))
-- Ikon háttere
dxDrawRectangle(v.x,v.y + i*v.h + i*10,v.h,v.h,tocolor(0,0,0,170*v.opacity))
--
dxDrawImage(v.x + v.h/2 - (v.h-10)/2,v.y + i*v.h + i*10 + v.h/2 - (v.h-10)/2,v.h - 10,v.h - 10,itypes[v.itype],0,0,0,tocolor(255,255,255,255*v.opacity))
-- Szöveg
dxDrawText(v.message,
v.x + v.h + 5,
v.y + i*v.h + i*10 + v.h/2 - dxGetFontHeight(1,font)/2,
v.x+v.w,
v.y + i*v.h + i*10 +v.h,
tocolor(255,255,255,255*v.opacity),1,font,\"left\",\"top\",true)
i = i + 1
end
end
addEventHandler(\"onClientRender\",root,renderInfoBox)
function table.find(t, v)
for k, a in ipairs(t) do
if a == v then
return k
end
end
return false
end
function createAnimation(f, t, easing, duration, onChange, onEnd)
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 >= 1 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 = f, to = t, easing = table.find(builtins, easing) and easing or builtins[easing], duration = duration, start = getTickCount( ), onChange = onChange, onEnd = onEnd})
return #anims
end
function destroyAnimation(a)
if anims[a] then
table.remove(anims, a)
end
end
addEventHandler(\"onClientRender\", root, function( )
local now = getTickCount( )
for k,v in ipairs(anims) do
v.onChange(interpolateBetween(v.from, 0, 0, v.to, 0, 0, (now - v.start) / v.duration, v.easing))
if now >= v.start+v.duration then
if type(v.onEnd) == \"function\" then
v.onEnd( )
end
table.remove(anims, k)
end
end
end)
createInfoBox(\"Ez egy teszt üzenet\"..itypes2[math.random(1,#itypes2)])
--createInfoBox(\"Teszt üzenet\",\"alert\")
[/quote]
Nekem Hard, tippek? :/
-
Bejelentkezés infobox
Sziasztok van egy script, ha érdeklődnétek, NEM AZ ENYÉM!, és azt szeretném, ha ki kickelek valakit akkor felül írja ki hogy Player has been kick Admin (reason), vagy ha ez nem lehetséges akkor amiko beírom hogy /cv Admiral, akkor Sikeresen létrehoztál egy járművet: Admiral!, mit kell kicserélni benne hogy ez működjön?
Nekem Hard, tippek? :/
Amikor, mondjuk az admin rendszerben outputChatBox helyett infoboxot írtál, azt a sort másold már be kérlek.
-
outputChatBox, az admin, csak ez a \"messages\" xml-van...
<group action=\"kick\" r=\"255\" g=\"0\" b=\"0\">
<all>[Kick]: $player has been kick $by_admin_4all.</all>
<log>ADMIN: $admin ki kickelte $player $data</log>
-
Vagy, ha leakarom hívni a járművet, hogy /cv Admiral pl.. akkor hova kell bemásolnom azt, hogy \"\"\" Sikeresen lehívtál egy járművet (Admiral)! \"\"\"\"
-
VALAKI VALAMIT TUD SEGÍTENI A /cv-be?