Wysłany: 2016-10-03, 19:14
Veq..!
Wiek: 28 Na forum: 3825 dni Posty: 6
Nick w MP: Veq..!
--[[
This script was made by Xownage , please do not re - release any part of this script without xownage 's permission
--]]
player = getRootElement()
function clickmenupd (mouseButton, buttonState, clickedElement, worldPosX, worldPosY, worldPosZ, screenPosX, screenPosY)
-- outputChatBox ("1")
if ( buttonState == "down" ) then
-- outputChatBox ("2")
local team = getPlayerTeam(source)
if team then
if getTeamName(team) == "DUPA" and isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(source)), aclGetGroup("RCON")) then
-- outputChatBox ("3")
if ( getElementData ( source, "pdclickopen" ) == false ) then
-- outputChatBox ("4")
if ( getElementData (source, "pdmousebind") == true ) then
-- outputChatBox ("5")
if ( mouseButton == "right" ) then
if ( clickedElement ) then
if ( getElementType (clickedElement) == "vehicle" ) then
thecar = clickedElement
setElementData (source, "pdclickselplayer", thecar )
triggerClientEvent (source,"carmenu", getRootElement() )
triggerEvent("pokazuj_pd", getRootElement(),source)
triggerEvent("pokazuj2", getRootElement())
end
end
elseif ( mouseButton == "left" ) then
end
end
end
end
end
end
end
addEventHandler( "onPlayerClick", getRootElement(), clickmenupd )
function onstartpd()
players = getElementsByType ( "player" ) -- get a table of all the players in the server
for theKey,player in ipairs(players) do
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup("RCON")) then
setElementData (player, "pdclickopen", false)
setElementData (player, "pdmousebind", false)
setElementData (player, "ZbiornikPaliwa", "20")
bindKey (player, "o", "down", showmousepd, player )
end
end
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onstartpd )
function showmousepd (player)
local team = getPlayerTeam(player)
if team then
if getTeamName(team) == "DUPA" and isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup("RCON")) then
if (isCursorShowing(player) == false ) then
setElementData (player, "pdmousebind", true)
showCursor (player, true)
else
setElementData (player, "pdmousebind", false)
showCursor (player, false)
end
end
end
end
function bindmousepd (player)
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(source)), aclGetGroup("RCON")) then
setElementData (source, "pdclickopen", false)
setElementData (source, "pdmousebind", false)
setElementData (source, "ZbiornikPaliwa", "20")
bindKey ( source, "o", "down", showmousepd, player )
end
end
addEventHandler ("onPlayerLogin", getRootElement(), bindmousepd )
function naprawa ()
local pdobject = getElementData ( source, "pdclickselplayer" )
if ( getElementType (pdobject) == "vehicle" ) then
local driver = getVehicleOccupant(pdobject)
if driver then
local zniszczenia = getElementHealth ( pdobject )
local zniszczenia2 = math.abs(math.floor(getElementHealth ( pdobject )) - 1000)
if zniszczenia2 ~= 0 then
fixVehicle(pdobject)
outputChatBox("[Us?uga PD]#C9C9C9Twoje auto zosta?o naprawione", driver, 255, 102, 51, true)
outputChatBox("[Us?uga PD]#C9C9C9Naprawi?e? auto gracza: "..getPlayerName(driver).."", source, 255, 102, 51, true)
outputChatBox("[Us?uga PD]#C9C9C9Zniszczenia samochodu: "..zniszczenia2.."/1000", source, 255, 102, 51, true)
else
outputChatBox("Samoch?d nie posiada zniszcze?", source, 255, 0, 0, true)
end
else
local zniszczenia = getElementHealth ( pdobject )
local zniszczenia2 = math.abs(math.floor(getElementHealth ( pdobject )) - 1000)
if zniszczenia2 ~= 0 then
fixVehicle(pdobject)
outputChatBox("[Us?uga PD]#C9C9C9Naprawi?e? auto", source, 255, 102, 51, true)
outputChatBox("[Us?uga PD]#C9C9C9Zniszczenia samochodu: "..zniszczenia2.."/1000", source, 255, 102, 51, true)
else
outputChatBox("Samoch?d nie posiada zniszcze?", source, 255, 0, 0, true)
end
end
end
end
addEvent("fix", true)
addEventHandler ("fix", getRootElement(), naprawa)
function tank (ile)
local pdobject = getElementData ( source, "pdclickselplayer" )
if ( getElementType (pdobject) == "vehicle" ) then
local wlasciciel = getVehicleOccupant ( pdobject )
local iloscpaliwa = getElementData(pdobject,"fuel")
if iloscpaliwa then
local mozesz = tonumber(100) - math.floor(tonumber(getElementData(pdobject,"fuel")))
local ilepaliwa = getElementData(source,"ZbiornikPaliwa")
if tonumber(iloscpaliwa) >= 100 then
outputChatBox("Nie mo?esz dola? paliwa poniewa? samoch?d ma pe?ny bak.", source, 255, 0, 0, true)
else
if tonumber(ile) > 0 then
if tonumber(mozesz) >= tonumber(ile) then
if tonumber(ilepaliwa) >= tonumber(ile) then
setElementData(pdobject, "fuel",getElementData(pdobject,"fuel")+ile)
outputChatBox("[Us?uga PD]#C9C9C9Dolano "..ile.."l Paliwa.", source, 255, 102, 51, true)
if wlasciciel then
outputChatBox("[Us?uga PD]#C9C9C9Dolano "..ile.."l Paliwa do twojego samochodu.", wlasciciel, 255, 102, 51, true)
end
setElementData(source, "ZbiornikPaliwa",ilepaliwa-ile)
triggerEvent("pokazuj_pd", getRootElement(),source)
triggerEvent("pokazuj2", getRootElement())
else
outputChatBox("Podaj poporawn? liczb?!", source, 255, 0, 0, true)
end
end
else
outputChatBox("Nie ma miejsca na tyle paliwa w baku.", source, 255, 0, 0, true)
end
end
end
end
end
addEvent("tankowanie", true)
addEventHandler ("tankowanie", getRootElement(), tank)
function pokaz_staty(player, cox)
local pdobject = getElementData ( player, "pdclickselplayer" )
local iloscpaliw = tonumber(getElementData(pdobject,"fuel"))
if iloscpaliw then
local cox = tonumber(100) - math.floor(iloscpaliw)
triggerClientEvent (player,"pokazilemozesz", getRootElement(),cox )
else
local cox = "0"
triggerClientEvent (player,"pokazilemozesz", getRootElement(),cox )
end
end
addEvent("pokazuj_pd", true)
addEventHandler ("pokazuj_pd", getRootElement(), pokaz_staty)
function pokaz_s2()
triggerClientEvent (source,"pokazile2", getRootElement())
end
addEvent("pokazuj2", true)
addEventHandler ("pokazuj2", getRootElement(), pokaz_s2)
Niech ktos powie do czego on sluzy i jak go odpalic
[ Komentarz dodany przez: AteX : 2016-10-03, 19:34 ]
Stosuj znaczniki [lua][/lua]
Ostatnio zmieniony przez AteX 2016-10-03, 19:34, w całości zmieniany 1 raz
Wysłany: 2016-10-03, 19:19
Filipovsky
uczeń LUA <3
Wiek: 45 Na forum: 3965 dni Posty: 24
Nick w MP: Filipovsky
Piwa : 2
Wygl?da mi to na jaki? system paliwa i mechanika, powinien zadzia?a? jak b?dziesz w teamie o nazwie DUPA i aclu o nazwie RCON, jak ju? zrobisz tak jak napisa??m naci?nij "o", spr?buj te? klikn?c LPM na samoch?d.
Podpis
Siema co tam
Wysłany: 2016-10-04, 15:10
Veq..!
Wiek: 28 Na forum: 3825 dni Posty: 6
Nick w MP: Veq..!
Powiesz mi jak zrobic ten team dupa i acl?
Wysłany: 2016-10-04, 15:17
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Grup? ACL tworzymy nast?puj?co:
-Naci?nij klawisz 'P'
-Przejd? do zak?adki 'Resources'
-Po prawej stronie na g?rze jest przycisk 'ACL Manage' to kliknij go.
-Naci?nij po prawej stronie 'create group' i wpisz nazw? grupy czyli 'RCON'
-Naci?nij 'ok'/'create' czy co tam jest napisane.
-Dodaj si? do tej grupy za pomoc? przycisku 'add object' po prawej i wpisz user.sw?j login
-Naci?nij 'ok'/'add'.
Team tworzymy nast?puj?co:
-Naci?nij klawisz 'P'
-W zak?adce Players po prawej stronie w panelu widnieje wiele przycisk?w.
-Znajd? taki przycisk jak 'Create Team'
-Naci?nij go
-Kliknij w przycisk 'create team' lub 'add team' czy jak jest napisane bo nie pami?tam.
-Wpisz nazw? teamu w twoim przypadku du?ymi literami 'DUPA'
-Naci?nij 'create'/'ok'
Dodaj si? do tego teamu:
-Zaznacz po lewej stronie w panelu gracza kt?rego chcesz doda?
-Zaznacz z listy team'?w team DUPA i naci?nij 'add'/'select'/'ok'
Wysłany: 2016-10-07, 19:16
Veq..!
Wiek: 28 Na forum: 3825 dni Posty: 6
Nick w MP: Veq..!
zrobilem wszystko ale ta suszarka dalej nie dziala (jesli to w ogole suszarka)
Wysłany: 2016-10-07, 19:19
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
To je?li to nie jest suszarka to jak ma dzia?a? jak suszarka....
Wysłany: 2016-10-09, 11:25
Veq..!
Wiek: 28 Na forum: 3825 dni Posty: 6
Nick w MP: Veq..!
Wysłany: 2016-10-10, 19:08
Brzysiek
Skrypter pralek
Wiek: 27 Na forum: 5198 dni Posty: 488
Nick w MP: Brzysiek
Piwa : 1034
Wygl?da na to, ?e ten skrypt tworzy jakie? menu Pomocy Drogowej (ale to nie jest zawarte) poprzez klikanie prawym przyciskiem myszy. Je?li to jaka? suszarka to bardzo s?aba przer?bka, kt?ra j? imituje.
Tagi: powie :: ktos :: chodzi :: tym :: skrypcie :: jak :: ustawic?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: