Wysłany: 2014-10-04, 15:45
Quin
Wiek: 25 Na forum: 4537 dni Posty: 79
Piwa : 3
Prosz? przerobi? skrypt tak aby po godzinie usun??o blipa.
Lua:
function paczka ( thePlayer )
accountname = getAccountName ( getPlayerAccount ( thePlayer ))
if isObjectInACLGroup ( "user." .. accountname , aclGetGroup ( "Admin" )) then
do
local x , y , z = getElementPosition ( thePlayer )
tent = createObject ( 3565 , x + 5 , y , z + 0.1 )
blip = createBlip ( x , y , z )
setObjectScale ( tent , 1 )
tentCol = createColSphere ( x + 5 , y , z , 4 )
attachElements ( tentCol , tent , 0 , 0 , 0 )
setElementData ( tentCol , "parent" , tent )
setElementData ( tent , "parent" , tentCol )
setElementData ( tentCol , "tent" , true )
setElementData ( tentCol , "vehicle" , true )
setElementData ( tentCol , "MAX_Slots" , 10000 )
setElementData ( tentCol , "M4" , 2 )
setElementData ( tentCol , "M4 Mag" , 5 )
setElementData ( tentCol , "M4 CCO SD" , 2 )
setElementData ( tentCol , "5.56?45mm STANAG SD Mag" , 5 )
setElementData ( tentCol , "AK-47" , 4 )
setElementData ( tentCol , "7,62?39 mm wz. 43 Mag" , 10 )
setElementData ( tentCol , "M107 (Barrett)" , 1 )
setElementData ( tentCol , "M107 (Barrett) Mag" , 2 )
setElementData ( tentCol , "SWD" , 2 )
setElementData ( tentCol , "7,62?54 mm R Mag" , 4 )
setElementData ( tentCol , "Mosin" , 2 )
setElementData ( tentCol , "7,62?54 mm R Mag" , 4 )
setElementData ( tentCol , "M110" , 3 )
setElementData ( tentCol , "7,62 mm NATO Mag" , 6 )
setElementData ( tentCol , "PDW" , 15 )
setElementData ( tentCol , "9 mm Parabellum Mag" , 10 )
setElementData ( tentCol , "Makarov SD" , 15 )
setElementData ( tentCol , "9?18 mm Makarov SD Mag" , 10 )
setElementData ( tentCol , "Lee Enfield" , 15 )
setElementData ( tentCol , "7,7?56 mm R Mag" , 10 )
setElementData ( tentCol , "SPAZ-12 Combat Shotgun" , 15 )
setElementData ( tentCol , "SPAZ-12 Pellet" , 10 )
setElementData ( tentCol , "Desert Eagle" , 15 )
setElementData ( tentCol , ".357 Magnum Mag" , 10 )
setElementData ( tentCol , "MP5A5" , 15 )
setElementData ( tentCol , "9?19 mm Parabellum Mag" , 10 )
setElementData ( tentCol , "Grenade" , 15 )
setElementData ( tentCol , "Binoculars" , 15 )
setElementData ( tentCol , "Water Bottle" , 50 )
setElementData ( tentCol , "Pasta Can" , 50 )
setElementData ( tentCol , "Rice" , 50 )
setElementData ( tentCol , "Rice'" , 50 )
setElementData ( tentCol , "Cuffs" , 10 )
setElementData ( tentCol , "Bear Trap" , 10 )
setElementData ( tentCol , "Bandage" , 10 )
setElementData ( tentCol , "Full Gas Canisterister" , 10 )
setElementData ( tentCol , "Medic Kit" , 10 )
setElementData ( tentCol , "Painkiller" , 10 )
setElementData ( tentCol , "Morphine" , 10 )
setElementData ( tentCol , "Blood Bag" , 10 )
setElementData ( tentCol , "Wire Fence" , 10 )
setElementData ( tentCol , "Tire" , 10 )
setElementData ( tentCol , "Engine" , 10 )
setElementData ( tentCol , "Tank Parts" , 10 )
setElementData ( tentCol , "Tent" , 10 )
setElementData ( tentCol , "Ghillie Suit" , 10 )
setElementData ( tentCol , "Camouflage Clothing" , 10 )
setElementData ( tentCol , "Hunter Clothing" , 10 )
setElementData ( tentCol , "Digital Clothing" , 2 )
setElementData ( tentCol , "Resist Clothing" , 2 )
setElementData ( tentCol , "Blask Clothing" , 2 )
setElementData ( tentCol , "Pirate Clothing" , 10 )
setElementData ( tentCol , "Sniper Clothing" , 10 )
setElementData ( tentCol , "Coyote Backpack" , 25 )
setElementData ( tentCol , "Military Backpack" , 12 )
setElementData ( tentCol , "Ghillie Backpack" , 10 )
setElementData ( tentCol , "CMAR Backpack" , 5 )
setElementData ( tentCol , "Nova Backpack" , 2 )
setElementData ( tentCol , "Mountain Backpack" , 2 )
setElementData ( tentCol , "Hatchet" , 10 )
setElementData ( tentCol , "Night Vision Goggles" , 10 )
setElementData ( tentCol , "Infrared Goggles" , 10 )
setElementData ( tentCol , "Map" , 10 )
setElementData ( tentCol , "Box of Matches" , 10 )
setElementData ( tentCol , "Watch" , 10 )
setElementData ( tentCol , "GPS" , 10 )
setElementData ( tentCol , "ToolBox" , 10 )
setElementData ( tentCol , "Radio Device" , 10 )
end
else
end
end
addCommandHandler ( "komenda" , paczka )
Ostatnio zmieniony przez Quin 2014-10-04, 17:42, w całości zmieniany 1 raz
Wysłany: 2014-10-04, 16:50
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Zrobi?em ten kod nie na zapis aut, a na zaparkowanie pojazdu..
Wysłany: 2014-10-05, 12:56
Rudy.
Webmaster/LUA
Wiek: 27 Na forum: 4304 dni Posty: 43
Nick w MP: Rudy
Piwa : 1739
Wysłany: 2014-10-10, 22:55
VistoR
Wiek: 27 Na forum: 4811 dni Posty: 11
Nick w MP: VistoR
Piwa : 1
Przerobicie kod aby teleportowa? bez samochodu ? Wielkie dzi?ki. Daje piwo.
Kod: function teleport()
Teleport1 = createMarker ( 390, 173.7001953125, 1006.700012207, "cylinder", 3, 0, 0, 255, 255, getRootElement() )
createBlipAttachedTo ( Teleport1, 19 )
function MarkerHit( hitElement, matchingDimension, interior )
setElementPosition ( hitElement, -823.1201171875, 500.8603515625, 1359.0452880859 )
outputChatBox ( "#00FF00**Witam w urzedzie**", getRootElement(), 255, 255, 255, true )
setElementDimension ( hitElement, 0 )
setElementInterior ( hitElement, 1 )
setElementRotation(hitElement, 0, 0, 276.53833007813)
end
addEventHandler( "onMarkerHit", Teleport1, MarkerHit )
end
addEventHandler ( "onResourceStart", getRootElement (), teleport )
function teleport()
Teleport2 = createMarker ( -832.7333984375, 510.478515625, 1357.2349853516, "cylinder", 3, 0, 255, 255, 255, getRootElement() )
setElementDimension ( Teleport2, 0 )
setElementInterior ( Teleport2, 1 )
function MarkerHit( hitElement, matchingDimension )
setElementPosition ( hitElement, 1685.6005859375, -2329.443359375, 13.546875 )
outputChatBox ( "#00FF00**Witamy w San Fierro**.", getRootElement(), 255, 255, 255, true )
setElementDimension ( hitElement, 0 )
setElementInterior ( hitElement, 0 )
setElementRotation(hitElement, 0, 0, 6.5342407226563)
end
addEventHandler( "onMarkerHit", Teleport2, MarkerHit )
end
addEventHandler ( "onResourceStart", getRootElement (), teleport )
Wysłany: 2014-10-11, 11:50
dudeks
Wiek: 31 Na forum: 6576 dni Posty: 171
Piwa : 89
Sprawdzaj czy hitElement to gracz, je?eli tak - to przeno?.
Wysłany: 2014-10-12, 10:36
TruskawkaPL
Początkujący LUA
Wiek: 26 Na forum: 4266 dni Posty: 30
Nick w MP: BOLEQ
Prosz? o przerobienie tego kodu, by na li?cie by? tylko gracz, kt?ry jest w pobli?u.
Ewentualnie prosz? o poprawienie b??d?w.
Z g?ry zakazuje kopiowania kodu bez mojej zgody .
-----------------------------------
-- Panel pogotowia by Truskawka ! --
-----------------------------------
-------------- Okna ---------------
-----------------------------------
StworzPanel = {}
StworzGuzikULECZ = {}
TekstPanelu = {}
WybierzGracza = {}
StworzPanel = guiCreateWindow ( 582 , 316 , 214 , 274 , "Panel Pogotowia" , false )
guiWindowSetMovable ( StworzPanel , false )
guiWindowSetSizable ( StworzPanel , false )
guiSetAlpha ( StworzPanel , 1.00 )
StworzGuzikULECZ = guiCreateButton ( 9 , 242 , 195 , 22 , "ULECZ" , false , StworzPanel )
TekstPanelu = guiCreateLabel ( 9 , 26 , 195 , 28 , "PROSZ? WYBRA? GRACZA" , false , StworzPanel )
guiSetFont ( TekstPanelu , "default-bold-small" )
guiLabelSetHorizontalAlign ( TekstPanelu , "center" , false )
guiLabelSetVerticalAlign ( TekstPanelu , "center" )
WybierzGracza = guiCreateGridList ( 9 , 56 , 195 , 176 , false , StworzPanel )
guiSetVisible ( StworzPanel , false )
-------------------------------------
-------------- Funkcje --------------
-------------------------------------
local Druzyna = getTeamFromName ( "Pogotowie" )
local Kolumna = guiGridListAddColumn ( WybierzGracza , "Wybierz gracza" , 0.9 )
function Pokaz ()
if guiGetVisible ( StworzPanel ) == false then
if getPlayerTeam ( getLocalPlayer ()) == Druzyna then
guiSetVisible ( StworzPanel , true )
showCursor ( true )
guiGridListClear ( WybierzGracza )
for id , playeritem in ipairs ( getElementsByType ( "player" )) do
local Row = guiGridListAddRow ( WybierzGracza )
guiGridListSetItemText ( WybierzGracza , Row , Kolumna , getPlayerName ( playeritem ), false , false )
end
end
else
guiSetVisible ( StworzPanel , false )
showCursor ( false )
end
end
bindKey ( "m" , "down" , Pokaz )
function lecz ()
local player = guiGridListGetItemText ( WybierzGracza , guiGridListGetSelectedItem ( WybierzGracza ), 1 )
triggerServerEvent ( "lecz" , getRootElement (), player , getLocalPlayer ())
end
addEventHandler ( "onClientGUIClick" , StworzGuzikULECZ , lecz )
Wysłany: 2014-10-16, 21:31
iWanted
Wiek: 30 Na forum: 4268 dni Posty: 26
Nick w MP: .QUENNY
Piwa : 366
Podpis
Wszystko ma swój początek i koniec
Wysłany: 2014-11-16, 17:28
Quin
Wiek: 25 Na forum: 4537 dni Posty: 79
Piwa : 3
Prosz? o przerobienie tak aby po??czy? te dwa skrypty. ?eby has?o do bazy by?o losowe i zmienia?o si? co tydzie? i po zmianie has?a brama si? otwiera?a a w markerze pisa?o to losowe has?o.
1 skrypt:
cmdname = "Has?o"
model = 10828
czas = 1000
ox , oy , oz = X , Y , Z
zx , zy , zz = X , Y , Z
rotx , roty , rotz = RotX , RotY , RotZ
brama_state = 0
brama_obiekt = createObject ( model , zx , zy , zz , rotx , roty , rotz )
addCommandHandler ( cmdname , function ( p , c )
if brama_state == 0 then
moveObject ( brama_obiekt , czas , ox , oy , oz , 0 , 0 , 0 )
brama_state = 1
else
moveObject ( brama_obiekt , czas , zx , zy , zz , 0 , 0 , 0 )
brama_state = 0
end
end )
2 skrypt:
marker1 = createMarker ( 1485.0999755859 , - 3510 , 0.80000001192093 , "cylinder" , 1 , 0 , 255 , 255 , 255 )
function has ? o ( hitPlayer , matchingDimension )
outputChatBox ( "Has?o" , hitPlayer )
end
addEventHandler ( "onMarkerHit" , marker1 , has ? o )
Wysłany: 2014-11-24, 17:30
LordKamis
Wiek: 26 Na forum: 4340 dni Posty: 107
Piwa : 190
Wysłany: 2014-12-02, 18:29
Zgredek666
LUA
Wiek: 27 Na forum: 4722 dni Posty: 251
Nick w MP: Zgredek
Piwa : 442
Wysłany: 2014-12-03, 13:40
sebatorun
Wiek: 28 Na forum: 4554 dni Posty: 6
Nick w MP: sebatorun
Piwa : 6
Siemka gracze. Mam ma?y problem. Nie dawno wr?ci?em do gry w mta:sa i pr?buj? zrobi? panel wyjazdowy dla Panstwowej Stra?y Po?arnej polegaj?cy na tym, ?e stra?ak otwiera panel pod przyciskiem "M" i pojawia si? gui panel. Po naci?ni?ciu odpowiedniego buttona pojawia si? tre?? na czacie. Chodzi mi oto, ?eby tylko te wiadomo?ci widzieli gracze zalogowaniu do teamu. Podaj? wam fragment kodu od strony clienta. Czekam na wasze propozycje od strony servera. Dzi?ki za pomoc. Pozdrawiam sebatorun.
Kod client.lua
GUIEditor = {
checkbox = {},
window = {},
button = {},
label = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(305, 124, 472, 397, "Panstwowa Straz Pozarna", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFEB0000")
GUIEditor.checkbox[1] = guiCreateCheckBox(10, 47, 70, 15, "WYJAZD", false, false, GUIEditor.window[1])
guiSetFont(GUIEditor.checkbox[1], "default-bold-small")
guiSetProperty(GUIEditor.checkbox[1], "NormalTextColour", "FFEB0000")
GUIEditor.checkbox[2] = guiCreateCheckBox(99, 47, 70, 15, "POWR?T", false, false, GUIEditor.window[1])
guiSetFont(GUIEditor.checkbox[2], "default-bold-small")
guiSetProperty(GUIEditor.checkbox[2], "NormalTextColour", "FFEB0000")
GUIEditor.checkbox[3] = guiCreateCheckBox(188, 47, 71, 15, "RODZAJ", false, false, GUIEditor.window[1])
guiSetFont(GUIEditor.checkbox[3], "default-bold-small")
guiSetProperty(GUIEditor.checkbox[3], "NormalTextColour", "FFEB0000")
GUIEditor.label[1] = guiCreateLabel(24, 28, 159, 19, " P O J A Z D", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[1], "default-bold-small")
guiLabelSetColor(GUIEditor.label[1], 235, 0, 0)
GUIEditor.checkbox[4] = guiCreateCheckBox(269, 47, 80, 16, "WSPARCIE", false, false, GUIEditor.window[1])
guiSetFont(GUIEditor.checkbox[4], "default-bold-small")
guiSetProperty(GUIEditor.checkbox[4], "NormalTextColour", "FFEB0000")
GUIEditor.checkbox[5] = guiCreateCheckBox(368, 47, 70, 15, "INNE", false, false, GUIEditor.window[1])
guiSetFont(GUIEditor.checkbox[5], "default-bold-small")
guiSetProperty(GUIEditor.checkbox[5], "NormalTextColour", "FFEB0000")
GUIEditor.button[1] = guiCreateButton(14, 72, 64, 25, "Slop[SF]1", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[1], "default-bold-small")
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF2323")
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")
guiSetProperty(GUIEditor.button[40], "NormalTextColour", "FFFDFB00")
GUIEditor.button[41] = guiCreateButton(384, 357, 75, 26, "Zamknij", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[41], "default-bold-small")
addEventHandler ( 'onClientGUIClick', resourceRoot, function ()
if source == GUI.button[40] then
guiSetVisible ( GUIEditor.window[1], false)
showCursor ( false )
elseif source == GUI.button[1] then
--outptuChatBox ('Slop[SF]1 dla 998 WYJAZD Z KOSZAR')
triggerServerEvent ( 'ogloszenieSeba', root, 'Slop[SF]1 dla 998 WYJAZD Z KOSZAR')
elseif source == GUI.button[2] then
--outptuChatBox ('GBA[SF]3 dla 998 WYJAZD Z KOSZAR')
triggerServerEvent ( 'ogloszenieSeba', root, 'GBA[SF]3 dla 998 WYJAZD Z KOSZAR')
Wysłany: 2014-12-03, 14:21
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Wysłany: 2014-12-03, 14:57
Zgredek666
LUA
Wiek: 27 Na forum: 4722 dni Posty: 251
Nick w MP: Zgredek
Piwa : 442
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 )
Wysłany: 2014-12-04, 14:50
sebatorun
Wiek: 28 Na forum: 4554 dni Posty: 6
Nick w MP: sebatorun
Piwa : 6
Elo. Dzi?ki za wasze pomys?y. Zgredek666 powiedz mi jeszcze czy zawarto?? twojego kodu poda? jako server czy client. I do ko?ca nie wiem czy o to mi chodzi?o. Zale?a?o mi na tym, ?e po naci?ni?ci GUI.button[1] pojawia si? tre?? na czacie i tak dalej GUI.button[2], GUI.button[3] itd... Ale dzi?ki za pomoc b?de kmini? dalej.
Wysłany: 2014-12-04, 17:04
Zgredek666
LUA
Wiek: 27 Na forum: 4722 dni Posty: 251
Nick w MP: Zgredek
Piwa : 442
To jest Oczywi?cie c -side, wszystko co z gui to c -side. Ta funkcja dzia?a tak ?e opala panel po wci?ni?ciu p je?eli jeste? w policji, co oczywi?cie daje te? dost?p do button?w. Teraz wystarczy ?e zrobisz sobie funkcje z wykorzystaniem eventu
Tagi: prośby :: przerobienie :: skryptu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: