Wysłany: 2016-10-19, 21:34
Demic
Lua&Mapping
Wiek: 29 Na forum: 4247 dni Posty: 63
Nick w MP: Demic
Piwa : 620
Wi?c tak, mam problem.
W skrypcie ?adnie pieknie.
Bior? tack? z jedzeniem i chc? ?eby przy wyj?ciu z budynku (gdy wchodzisz w marker kt?ry cie teleportuje na zewn?trz) znika?a tacka (obiekt) marker, oraz blip.
Kod:
Kod: local praca = createMarker(212.89999389648, -184.5, -22, 'cylinder', 1, 135, 124, 119)
local blip = createBlip(212.89999389648, -184.5, -22, 10)
local miejscakelner = {
{204, -199.30000305176, -21.10000038147},
{215.19999694824, -199.5, -21.10000038147},
{212.30000305176, -198.80000305176, -21.10000038147},
{215.30000305176, -196.19999694824, -21.10000038147},
{212.39999389648, -195.19999694824, -21.10000038147},
{208.60000610352, -195.39999389648, -21.10000038147},
{212.39999389648, -189.19999694824, -21.10000038147},
{215.30000305176, -190.19999694824, -21},
}
addEventHandler("onClientMarkerHit", praca, function(el, md)
if not md or getElementType(el) ~= "player" then return end
if el ~= localPlayer then return end
outputChatBox("* Zarobki pracy: 99 $ za tac?")
outputChatBox("* Aby rozpocz?? prac? wci?nij 'E'")
end)
bindKey("e", "down", function()
if not isElementWithinMarker(localPlayer, praca) then return end
if not getElementData(localPlayer, "gracz_praca") then
outputChatBox("* Bierzesz tac?")
skrzynia = createObject(2814, 0, 0, 0, 0, 0, 0)
attachElements ( skrzynia, localPlayer, 0, 0.6, 0.4)
setTimer(function()
setElementFrozen(el, false)
end, 3600, 1)
local losuj = math.random(2, #miejscakelner)
setElementData(localPlayer, "gracz_praca", true)
outputChatBox("* Od??? tac? na stolik.")
setPedAnimation ( localPlayer, "CARRY", "crry_prtial", 1,true )
toggleControl("sprint", false )
toggleControl("jump", false )
toggleControl("crouch", false )
local cel = createMarker(miejscakelner[losuj][1], miejscakelner[losuj][2], miejscakelner[losuj][3]-1.0, "checkpoint", 1.0, 255, 0, 0)
local blip = createBlipAttachedTo(cel, 41)
addEventHandler("onClientMarkerHit", cel, function(el, md)
if not md or getElementType(el) ~= "player" then return end
if el ~= localPlayer then return end
if getPedOccupiedVehicle(el) then
outputChatBox("* Nie mo?esz tego od?o?y? b?d?c w poje?dzie!")
return
end
destroyElement(blip)
setElementFrozen(el, true)
outputChatBox("* K?adziesz tace na stolik, odczekaj chwil?.")
setTimer(function()
setElementFrozen(el, false)
outputChatBox("* Po?o?y?e? tac?! Otrzymujesz napiwek ")
destroyElement(skrzynia)
destroyElement(cel)
setPedAnimation(localPlayer, false)
setElementData(el, "gracz_praca", false)
toggleControl("sprint", true )
toggleControl("jump", true )
toggleControl("crouch", true )
local hajskelenr = math.random(99, 99)
triggerServerEvent("onKelnerobCashReceived", localPlayer, hajskelenr)
end, 2000, 1)
end)
else
outputChatBox("* Posiadasz aktywn? prac?.Je?eli komunikat si? powtarza zr?b reloga.")
end
end)
oraz marker kt?ry teleportuje na zewn?trz.
Kod: local maker = createMarker( 208.10000610352, -201.80000305176, -20.299999237061, 'arrow', 1.5, 57, 189, 197)
function tele( hitPlayer, matchingDimension )
setElementPosition ( hitPlayer, 200.69999694824, -206, 1.6000000238419 )
end
addEventHandler( "onMarkerHit", maker, tele )
Wysłany: 2016-10-19, 21:39
Emm
***** ***
Wiek: 32 Na forum: 3880 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Podpis
Użytkownik : 20.10.2015r
GTAO Member : 06.03.2016r
Support-Team : 20.01.2016r
Moderator : 30.03.2016r
Mod-Team : 08.10.2016r
Vice Admin : 04.05.2018r
Administrator : 03.05.2022r
[you]
! Koniecznie zapoznaj się z
regulaminem forum .
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również
regulaminy działów , w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez
Administrację , przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w
tym dziale .
Najważniejsze informacje od
Administracji możesz przeczytać
tutaj oraz
tutaj .
Wysłany: 2016-10-19, 21:41
Demic
Lua&Mapping
Wiek: 29 Na forum: 4247 dni Posty: 63
Nick w MP: Demic
Piwa : 620
Emm , Ale gdzie mam tego u?y?
Wysłany: 2016-10-19, 21:49
FaydenFX.
Wiek: 27 Na forum: 4056 dni Posty: 246
Nick w MP: faydn
Piwa : 11
Zr?b wyj?cie po stronie clienta i w nim dodaj:
if isElement ( zmienna_tacy ) then destroyElement ( zmienna_tacy ) end
Wysłany: 2016-10-19, 21:54
Demic
Lua&Mapping
Wiek: 29 Na forum: 4247 dni Posty: 63
Nick w MP: Demic
Piwa : 620
Wysłany: 2016-10-19, 22:00
FaydenFX.
Wiek: 27 Na forum: 4056 dni Posty: 246
Nick w MP: faydn
Piwa : 11
Wysłany: 2016-10-19, 23:22
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
Skoro napisa?e? takie co? to i dasz rad? podpi?? to pod wej?cie w marker kt?ry tp na zewn?trz. Zamie? oczywi?cie na swoje warto?ci w funkcji. Ten kod jest z innego skryptu ale na dosy? podobnej zasadzie pracy magazyniera i innych typu zacznij, wejd? w marker itp.
local function finishJob ( missionValue )
if isElement ( missionBlip ) then
destroyElement ( missionBlip )
missionBlip = nil
end
if isElement ( missionMarker ) then
destroyElement ( missionMarker )
missionMarker = nil
end
if missionValue then
setElementData ( localPlayer , "player:job" , false )
triggerServerEvent ( "mower:stopJOB" , localPlayer , missionVehicle )
missionVehicle = nil
missionMarker = nil
missionBlip = nil
end
end
addEventHandler ( "onClientPlayerWasted" , getLocalPlayer (), finishJob )
Podpis
"amited" napisał/a :
Wysłany: 2016-10-20, 09:04
Demic
Lua&Mapping
Wiek: 29 Na forum: 4247 dni Posty: 63
Nick w MP: Demic
Piwa : 620
local maker = createMarker ( 208.10000610352 , - 201.80000305176 , - 20.299999237061 , 'arrow' , 1.5 , 57 , 189 , 197 )
function tele ( hitPlayer , matchingDimension )
setElementPosition ( hitPlayer , 200.69999694824 , - 206 , 1.6000000238419 )
if isElement ( skrzynia ) then destroyElement ( skrzynia ) end
end
addEventHandler ( "onMarkerHit" , maker , tele )
//Stosuj znaczniki lua
Ostatnio zmieniony przez _Wicek_ 2016-10-20, 23:16, w całości zmieniany 1 raz
Wysłany: 2016-10-20, 16:48
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
makerwyjscie = createMarker ( 208.10000610352 , - 201.80000305176 , - 20.299999237061 , 'arrow' , 1.5 , 57 , 189 , 197 )
function tele ( source , skrzynia , cel )
destroyElement ( skrzynia )
destroyElement ( cel )
setElementPosition ( source , 200.69999694824 , - 206 , 1.6000000238419 )
end
addEventHandler ( "onMarkerHit" , makerwyjscie , tele )
Masz zobacz to.
Podpis
"amited" napisał/a :
Tagi: dodanie :: fukcnki
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: