Wysłany: 2014-12-04, 21:46
sebatorun
Wiek: 28 Na forum: 4554 dni Posty: 6
Nick w MP: sebatorun
Piwa : 6
Zgedek a poprawisz mi kod na naci?ni?cie buttona i napis na czacie.
function TEKST ()
outputChatBox("Slop[SF]1 dla 998 wyjazd z koszar")
addEventHandler ( "onClientGUIClick", TEKST, false )
end
Wysłany: 2014-12-06, 13:36
michal982010
Wiek: 29 Na forum: 4445 dni Posty: 69
Piwa : 1
Witam
czy przerobi? by mi kto? ten skrypt tak aby logo pojawia?o si? wtedy gdy nacisne TAB, a gdy puszcze TAB to logo zniknie.
Z g?ry dzi?kuje za pomoc
Kod: gRoot = getRootElement()
gResRoot = getResourceRootElement( getThisResource() )
addEventHandler("onClientResourceStart", gResRoot,
function ()
serverlogo = guiCreateStaticImage ( 0.7250, 0.8203, 0.2750, 0.1797, "logo.png", true )
end
)
addEventHandler("onClientResourceStart", gResRoot,
function ()
bindKey("F5","down","logovisible")
end
)
function changeVisibility ( )
if guiGetVisible ( serverlogo ) then
guiSetVisible ( serverlogo, false )
else
guiSetVisible ( serverlogo, true )
end
end
addCommandHandler("logovisible", changeVisibility)
Wysłany: 2014-12-06, 18:21
sebatorun
Wiek: 28 Na forum: 4554 dni Posty: 6
Nick w MP: sebatorun
Piwa : 6
ELo. Czy jest kto? mo?e kto zna funkcje na:
D?wi?k 3d po naci?ni?ciu gui buttona ( local sound 3D nie dzia?a )
Tworzenie obiektu o podanym id pod graczem po naci?ni?ciu buttona
Za odpowiedzi stawiam browce. Pozdrowionka
[ Dodano : 2014-12-06, 20:51 ]
Elo programi?ci. Mam do was spraw?. Czy mieliby?cie troszecz? czasu i pomogli by?cie mi z funkcj? do gui panelu? Chodzi mi o to, bo pisa?em na forum o pomoc z jedn? funkcj? tre?? na czacie po naci?ni?ciu gui Buttona. To ten kod:
Kod: function pokaz ()
if (getPlayerTeam(getLocalPlayer()) == getTeamFromName("Pa?stwowa Stra? Po?arna")) then
guiSetVisible ( GUIEditor.window[1], false)
outputChatBox("Tekst ")
else
outputChatBox("Nie jeste? Stra?akiem ")
end
end
bindKey("m", "down",pokaz)
Teraz podam wam m?j kod i napisz? o co mi chodzi:
Kod: GUIEditor.button[2] = guiCreateButton(14, 102, 64, 26, "GBA[SF]3", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[2], "default-bold-small")
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFEB0000")
function WYJAZD2()
outputChatBox("GBA[SF]3 dla 998 wyjazd z koszar", 255, 49, 49)
end
addEventHandler ( "onClientGUIClick", GUIEditor.button[2], WYJAZD2, false )
Teraz tak. Po naci?ni?ciu buttona[2] pojawia si? tre?? na czacie, ale tylko widzi j? ten co nacisn?? button. Jak zrobi?, ?eby t? wiadomo?? widzia?a ca?a frakcja ?
Jeszcze jak kto? ma troszk? wi?cej czasu:
- Jak sworzy? obiekt pod graczem po naci?ni?ciu buttona
- I jak stworzy? muzyk? 3D po naci?ni?ciu buttona ( funkcja local sound 3D mi nie dzia?a )
Za pomoc stawiam zimne browarki.
Wysłany: 2014-12-18, 17:11
ShaonicPL
Wiek: 29 Na forum: 4207 dni Posty: 25
Nick w MP: ShaonicPL
Wysłany: 2014-12-26, 10:09
Mateusz512
Wiek: 27 Na forum: 4511 dni Posty: 44
Witam, dlaczego gdy postawi? fajerwerka to inni go nie widz? po za mn??
Da si? to jako? przerobi??
client:
function greetings ()
outputChatBox ( "#F20A40 G&T Mapping wishes you happy holidays and all the best in 2015!" , 255 , 255 , 255 , true )
end
addEventHandler ( "onClientResourceStart" , resourceRoot , greetings )
function firework ( command , bt )
local bt = tonumber ( bt )
if bt and bt >= 1 and bt <= 6 then
outputChatBox ( "You chose firework type: " .. bt , 50 , 200 , 100 , true )
if bt == 1 then
createBox ( bt , 33 )
elseif bt == 2 then
createBox ( bt , 25 , 935 )
elseif bt == 3 then
outputChatBox ( "This type is currently a work in progress, please restart the resource if any problem occurs" , 200 , 0 , 0 , true )
createBox ( bt , 1 , 3014 , 1 ,- 0.2 )
elseif bt == 4 then
createBox ( bt , 100 , 3013 , 1 , 0.1 , 0 )
end
else
outputChatBox ( "ERROR: Syntax is /firework [1-4] e.g.: /firework 1" , 200 , 0 , 0 , true )
end
end
addCommandHandler ( "firework" , firework , false , false )
-- Credits to denny199 from the MTA forums for this little function
function getPositionInfrontOfElement ( element , meters )
if not element or not isElement ( element ) then
return false
end
if not meters then
meters = 0.7
end
local posX , posY , posZ = getElementPosition ( element )
local _ , _ , rotation = getElementRotation ( element )
posX = posX - math . sin ( math . rad ( rotation ) ) * meters
posY = posY + math . cos ( math . rad ( rotation ) ) * meters
return posX , posY , posZ , rotation
end
function createBox ( bt , shots , id , scale , zOffset , rotx )
if not shots then shots = 20 end
if not id then id = 1217 end
if not scale then scale = 0.4 end
if not zOffset then zOffset = 0.26 end
if not rotx then rotx = 180 end
local x , y , z , rot = getPositionInfrontOfElement ( localPlayer )
local gz = getGroundPosition ( x , y , z )
local zOffset = zOffset + gz
setPedAnimation ( localPlayer , "BOMBER" , "BOM_Plant" , 1500 , false , true , false , false )
setTimer (
function()
local pot = createObject ( id , x , y , zOffset , rotx , 0 , rot )
local px , py , pz = getElementPosition ( pot )
local fuse = createEffect ( "prt_spark" , px , py - 0.5 , pz - 0.6 ,- 22 , 0 , 0 , 300 )
local smoke = createEffect ( "vent" , px , py , pz - 1.8 , 0 , 0 , 0 , 300 )
local fuseTimer = math . random ( 3000 , 5000 )
setTimer ( destroyElement , fuseTimer , 1 , fuse )
setElementCollisionsEnabled ( pot , false )
setObjectScale ( pot , scale )
setTimer (
function()
if bt == 1 then
local randomTimer = math . random ( 200 , 300 )
local destroyTimer = randomTimer * shots + 5000
setTimer ( destroyElement , destroyTimer , 1 , pot )
setTimer ( destroyElement , destroyTimer , 1 , smoke )
type1 ( px , py , pz , shots , randomTimer , destroyTimer )
elseif bt == 2 then
local randomTimer = math . random ( 400 , 600 )
local destroyTimer = randomTimer * shots + 5000
setTimer ( destroyElement , destroyTimer , 1 , pot )
setTimer ( destroyElement , destroyTimer , 1 , smoke )
type2 ( px , py , pz , shots , randomTimer , destroyTimer )
elseif bt == 3 then
local randomTimer = math . random ( 200 , 300 )
local destroyTimer = randomTimer * shots + 5000
setTimer ( destroyElement , destroyTimer , 1 , pot )
setTimer ( destroyElement , destroyTimer , 1 , smoke )
type3 ( px , py , pz , shots , randomTimer , destroyTimer )
elseif bt == 4 then
local randomTimer = math . random ( 200 , 300 )
local destroyTimer = randomTimer * shots + 5000
setTimer ( destroyElement , destroyTimer , 1 , pot )
setTimer ( destroyElement , destroyTimer , 1 , smoke )
type4 ( px , py , pz , shots , randomTimer , destroyTimer )
end
end
, fuseTimer , 1 )
end
, 1250 , 1 )
end
function sound ( st , px , py , pz , looped , destroyTimer )
if not looped then looped = false end
if not destroyTimer then destroyTimer = nil end
destroyTimer = tonumber ( destroyTimer )
if st == 1 then
local shot = playSound3D ( "shot.mp3" , px , py , pz , looped )
setSoundMaxDistance ( shot , 200 )
if looped == true then
setTimer ( destroyElement , destroyTimer , 1 , shot )
end
elseif st == 2 then
local pop = playSound3D ( "pop.mp3" , px , py , pz , looped )
setSoundMaxDistance ( pop , 200 )
if looped == true then
setTimer ( destroyElement , destroyTimer , 1 , pop )
end
elseif st == 3 then
local spray_start = playSound3D ( "spray-start.mp3" , px , py , pz , looped )
setSoundMaxDistance ( spray_start , 200 )
if looped == true then
setTimer ( destroyElement , destroyTimer , 1 , spray_start )
end
elseif st == 4 then
local spray = playSound3D ( "spray.mp3" , px , py , pz , looped )
setSoundMaxDistance ( spray , 200 )
if looped == true then
setTimer ( destroyElement , destroyTimer , 1 , spray )
end
end
end
-- Fireworks --
-- 1 ---------------------------------------------------------
function type1 ( px , py , pz , shots , randomTimer , destroyTimer )
local spark = createEffect ( "prt_spark" , px , py , pz + 0.16 ,- 90 , 0 , 0 , 300 )
local spark_2 = createEffect ( "prt_spark_2" , px , py , pz + 0.16 ,- 90 , 0 , 0 , 300 )
sound ( 2 , px , py , pz )
createEffect ( "camflash" , px , py , pz , 0 , 0 , 0 , 300 )
createEffect ( "shootlight" , px , py , pz ,- 90 , 0 , 0 , 300 )
setTimer ( destroyElement , destroyTimer - 5000 , 1 , spark )
setTimer ( destroyElement , destroyTimer - 5000 , 1 , spark_2 )
setTimer (
function( px , py , pz )
randomTimer2 = math . random ( 50 , 750 )
setTimer ( type1_2 , randomTimer2 , 1 , px , py , pz )
end
, randomTimer , shots , px , py , pz )
end
function type1_2 ( x , y , z )
local random2 = math . random (- 300 , 300 )
local random3 = math . random ( 75 , 500 )
local x , y , z = x + random2 / 100 , y + random2 / 100 , z + random3 / 100
sound ( 2 , x , y , z )
createEffect ( "camflash" , x , y , z , 0 , 0 , 0 , 300 )
createEffect ( "shootlight" , x , y , z ,- 90 , 0 , 0 , 300 )
end
-- 2 ---------------------------------------------------------
function type2 ( px , py , pz , shots , randomTimer , destroyTimer )
setTimer (
function( px , py , pz )
local r1 = math . random ( 50 , 750 )
local r2 = math . random ( 1000 , 2000 )
setTimer ( type2_2 , r1 , 1 , px , py , pz , r2 )
end
, randomTimer , shots , px , py , pz )
end
function type2_2 ( px , py , pz , r2 )
sound ( 1 , px , py , pz )
createEffect ( "gunflash" , px , py , pz , 0 , 0 , 0 , 300 ) -- camflash
ball = createObject ( 3106 , px , py , pz , 0 , 0 , 0 ) -- 3106
setElementAlpha ( ball , 255 )
local r3 = math . random (- 150 , 150 )
local pxs , pys , pzs = r3 / 100 + px , r3 / 100 + py , pz + math . random ( 15 , 21 )
moveObject ( ball , r2 , pxs , pys , pzs , 0 , 0 , 0 , "OutQuad" )
setTimer (
function()
sound ( 2 , px , py , pzs )
createEffect ( "camflash" , pxs , pys , pzs , 0 , 0 , 0 , 300 )
createEffect ( "shootlight" , pxs , pys , pzs , 0 , 0 , 0 , 300 )
-- dxDrawLine3D ( px , py , pz , pxs , pys , pzs , tocolor ( 255 , 255 , 255 , 70 ), 2 )
end
, r2 , 1 , px , py , pz , pxs , pys , pzs )
setTimer ( destroyElement , r2 , 1 , ball )
end
-- 3 --------------------------------------------------------- work in progress
function type3 ( px , py , pz , shots , randomTimer , destroyTimer )
setTimer (
function( px , py , pz )
local r1 = math . random ( 50 , 750 )
local r2 = math . random ( 23000 , 25000 )
setTimer ( type3_2 , r1 , 1 , px , py , pz , r2 )
end
, randomTimer , shots , px , py , pz )
end
function type3_2 ( px , py , pz , r2 )
sound ( 1 , px , py , pz )
createEffect ( "gunflash" , px , py , pz , 0 , 0 , 0 , 300 ) -- camflash
ball = createObject ( 3106 , px , py , pz , 0 , 0 , 0 ) -- 3106
setElementAlpha ( ball , 0 )
local r3 = math . random (- 1500 , 1500 )
local pxs , pys = r3 / 100 + px , r3 / 100 + py
local pzs = pz + math . random ( 50 , 55 )
moveObject ( ball , r2 , pxs , pys , pzs , 0 , 0 , 0 , "OutBack" )
flare = createEffect ( "smoke_flare" , pxs , pys , pzs , 90 , 0 , 90 , 2000 )
addEventHandler ( "onClientRender" , root , type3_3 )
setTimer (
function()
removeEventHandler ( "onClientRender" , root , type3_3 )
end
, r2 , 1 )
setTimer ( destroyElement , r2 , 1 , ball )
end
function type3_3 ()
local x , y , z = getElementPosition ( ball )
setElementPosition ( flare , x , y , z )
end
-- 4 --------------------------------------------------------- work in progress
function type4 ( px , py , pz , shots , randomTimer , destroyTimer )
local spark = createEffect ( "prt_spark" , px , py , pz + 0.16 ,- 90 , 0 , 0 , 300 )
local spark_2 = createEffect ( "prt_spark_2" , px , py , pz + 0.16 ,- 90 , 0 , 0 , 300 )
local spark_3 = createEffect ( "prt_spark_2" , px , py , pz + 0.26 ,- 90 , 0 , 0 , 300 )
_ , _ , _ , rot = getPositionInfrontOfElement ( localPlayer )
local spark_4 = createEffect ( "flame" , px , py , pz + 0.26 ,- 90 , 0 , rot , 300 )
sound ( 3 , px , py , pz )
sound ( 4 , px , py , pz , true , destroyTimer - 5000 )
setTimer ( destroyElement , destroyTimer - 5000 , 1 , spark )
setTimer ( destroyElement , destroyTimer - 5000 , 1 , spark_2 )
setTimer ( destroyElement , destroyTimer - 5000 , 1 , spark_3 )
setTimer ( destroyElement , destroyTimer - 5000 , 1 , spark_4 )
setTimer (
function( px , py , pz )
randomTimer2 = math . random ( 50 , 750 )
-- setTimer ( type1_2 , randomTimer2 , 1 , px , py , pz )
end
, randomTimer , shots , px , py , pz )
end
function type4_2 ( x , y , z )
local random2 = math . random (- 300 , 300 )
local random3 = math . random ( 75 , 500 )
local x , y , z = x + random2 / 100 , y + random2 / 100 , z + random3 / 100
sound ( 2 , x , y , z )
createEffect ( "camflash" , x , y , z , 0 , 0 , 0 , 300 )
createEffect ( "shootlight" , x , y , z ,- 90 , 0 , 0 , 300 )
end
Wysłany: 2014-12-29, 15:19
koxik2001
Wiek: 25 Na forum: 4679 dni Posty: 33
Wysłany: 2015-01-12, 19:18
kamiltp20
J@ serwera PNT
Wiek: 23 Na forum: 4235 dni Posty: 10
Nick w MP: KaMi
Chcia?bym prosi?, o przerobienie skryptu na panel gracza, a mianowicie, ?eby jak gracz wychodzi z pojazdu, to nie usuwa?o mu go, i ka?dego pojazdu stoj?cego na mapie. Dam kod, je?eli kto? wie jak przerobi?, niech mi napisze w odpowiedzi tego postu gotowy kod.
Kod: local player = getLocalPlayer()
GUIEditor = {
gridlist = {},
button = {},
label = {}
}
okno = guiCreateGridList(505, 250, 581, 513, false)
guiSetAlpha(okno, 0.79)
guiSetVisible(okno, false)
GUIEditor.label[1] = guiCreateLabel(210, 40, 378, 117, "Staty:", false, okno)
guiSetFont(GUIEditor.label[1], "sa-header")
local hp = guiCreateButton(209, 97, 144, 62, "MAX HP", false, okno)
local armor = guiCreateButton(210, 174, 143, 62, "MAX ARMOR", false, okno)
GUIEditor.label[2] = guiCreateLabel(204, 240, 155, 57, "Pojazd:", false, okno)
guiSetFont(GUIEditor.label[2], "sa-header")
local bullet = guiCreateButton(69, 316, 125, 60, "Bullet", false, okno)
guiSetFont(bullet, "sans")
local sabre = guiCreateButton(229, 317, 120, 59, "Sabre", false, okno)
guiSetFont(sabre, "sans")
local buffalo = guiCreateButton(382, 317, 127, 59, "Buffalo", false, okno)
guiSetFont(buffalo, "sans")
local infernus = guiCreateButton(68, 395, 126, 62, "Infernus", false, okno)
guiSetFont(infernus, "sans")
local elegy = guiCreateButton(230, 396, 119, 61, "Elegy", false, okno)
guiSetFont(elegy, "sans")
local tahoma = guiCreateButton(384, 396, 125, 61, "Tahoma", false, okno)
guiSetFont(tahoma, "sans")
function xd ()
dxDrawText("Panel Gracza ",580,200,windowWidth,windowHeight,tocolor(255,255,255,255),3.0,"pricedown","left","top",false,false,true)
end
function gui()
if (guiGetVisible (okno) == false) then
guiSetVisible(okno, true)
showCursor(true)
addEventHandler("onClientRender", getRootElement(), xd)
else
guiSetVisible(okno, false)
showCursor(false)
removeEventHandler("onClientRender", getRootElement(), xd)
end
end
bindKey ("F3", "down", gui)
function dajbullet()
outputChatBox("Stworzyles pojazd o nazwie Bullet.", 255, 0, 0, true)
triggerServerEvent("dajbulet", getRootElement(), player)
end
addEventHandler ( "onClientGUIClick", bullet, dajbullet)
function dajsabre()
outputChatBox("Stworzyles pojazd o nazwie Sabre.", 255, 0, 0, true)
triggerServerEvent("dajsabre", getRootElement(), player)
end
addEventHandler ( "onClientGUIClick", sabre, dajsabre)
function dajinfernus()
outputChatBox("Stworzyles pojazd o nazwie Infernus.", 255, 0, 0, true)
triggerServerEvent("dajinfernus", getRootElement(), player)
end
addEventHandler ( "onClientGUIClick", infernus, dajinfernus)
function dajbuffalo()
outputChatBox("Stworzyles pojazd o nazwie Buffalo.", 255, 0, 0, true)
triggerServerEvent("dajbuffalo", getRootElement(), player)
end
addEventHandler ( "onClientGUIClick", buffalo, dajbuffalo)
function zycie()
outputChatBox("Otrzymales Max Zycia.", 255, 0, 0, true)
triggerServerEvent("zycie", getRootElement(), player)
end
addEventHandler ( "onClientGUIClick", hp, zycie)
function dajarmor()
outputChatBox("Otrzymales Max Armora.", 255, 0, 0, true)
triggerServerEvent("dajarmor", getRootElement(), player)
end
addEventHandler ( "onClientGUIClick", armor, dajarmor)
function dajelegy()
outputChatBox("Stworzyles pojazd o nazwie Elegy.", 255, 0, 0, true)
triggerServerEvent("dajelegy", getRootElement(), player)
end
addEventHandler ( "onClientGUIClick", elegy, dajelegy)
function dajtahoma()
outputChatBox("Stworzyles pojazd o nazwie Tahoma.", 255, 0, 0, true)
triggerServerEvent("dajtahoma", getRootElement(), player)
end
addEventHandler ( "onClientGUIClick", tahoma, dajtahoma)
Wysłany: 2015-01-12, 19:34
Gerano
Mleko,Kakao,LUA
Wiek: 38 Na forum: 4266 dni Posty: 187
Nick w MP: Gerano
Piwa : 1460
kamiltp20 , we? poszukaj w skrypty do mta zapisu pojazd?w nie wiem jak chcesz czy na xml czy na bazie danych bo s? oba jak pomog?em daj piwko
Podpis
BUDOWA SERWERA: XXX
Prace: XXX%
Wysłany: 2015-01-13, 16:17
kamiltp20
J@ serwera PNT
Wiek: 23 Na forum: 4235 dni Posty: 10
Nick w MP: KaMi
"Gerano" napisał/a :kamiltp20 , we? poszukaj w skrypty do mta zapisu pojazd?w nie wiem jak chcesz czy na xml czy na bazie danych bo s? oba jak pomog?em daj piwko
Nie chodzi o to, chodzi o to ?e jak wyjd? z jakiegokolwiek pojazdu, usunie on si?, nawet gdy nie jest on zrobiony w tym skrypcie.
Wysłany: 2015-01-13, 16:27
Gerano
Mleko,Kakao,LUA
Wiek: 38 Na forum: 4266 dni Posty: 187
Nick w MP: Gerano
Piwa : 1460
nwm jak to jest panel vipa to zr?b inny bo ten taki troch? kiepski
Podpis
BUDOWA SERWERA: XXX
Prace: XXX%
Wysłany: 2015-01-18, 21:45
Gang
Wiek: 27 Na forum: 4155 dni Posty: 1
Piwa : 2
Czy mo?e kto? przerobi? Skrypt House_System ?eby by? po polsku i usun?? ograniczenie na domy ?
Wysłany: 2015-01-19, 11:10
djtroll
Wiek: 32 Na forum: 4154 dni Posty: 1
Nick w MP: djnietoperz^^
"Gang" napisał/a :Czy mo?e kto? przerobi? Skrypt House_System ?eby by? po polsku i usun?? ograniczenie na domy ?
JP
[ Dodano : 2015-01-19, 11:11 ]
"Gang" napisał/a :Czy mo?e kto? przerobi? Skrypt House_System ?eby by? po polsku i usun?? ograniczenie na domy ?
SERDECZNE JP
Wysłany: 2015-01-19, 16:51
kulka5010
Wiek: 26 Na forum: 4154 dni Posty: 3
Nick w MP: Kincior
Chcia?bym ?eby?cie spolszczyli ten login panel i jak nacisne jaki? klawisz to ?eby mi inne skrypty nie wyskakiwa?y. Np. Jak nacisne b to uruchamia mi si? handlng editor.
Link:
Kod: https://www.dropbox.com/s/kmziwhrlh0h5d1b/loginpanel.rar?dl=0
Za pomoc moge przela? kilka z? lub postawi? piwa na forum.
@Shuffle 10 z?.
Wysłany: 2015-01-19, 22:41
Gerano
Mleko,Kakao,LUA
Wiek: 38 Na forum: 4266 dni Posty: 187
Nick w MP: Gerano
Piwa : 1460
ja ci to spolszcz? za free
Podpis
BUDOWA SERWERA: XXX
Prace: XXX%
Wysłany: 2015-01-24, 12:26
Alien2
C++, Music produce
Wiek: 26 Na forum: 4317 dni Posty: 40
Nick w MP: Teaj
Piwa : 6
Tagi: prośby :: przerobienie :: skryptu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: