Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2017-05-01, 14:28


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

Mam problem z "setMarkerTarget" dok?adnie chodzi mi o to ze nie mog? przez to sko?czy? prawo jazdy prosz? o pomoc


function stworzNowyCheckpoint(source) 
if isElement(punktthen
removeEventHandler("onClientMarkerHit"punktonCheckpointHit)

destroyElement(punktdestroyElement(blipend 

punkt createMarker (trasa[checkpoint][1], trasa[checkpoint][2], trasa[checkpoint][3] , "checkpoint"30255255150)
strzala setMarkerTarget(punkttrasa[checkpoint+1][1], trasa[checkpoint+1][2], trasa[checkpoint][3]) 
blip createBlipAttachedTo(punkt12)

addEventHandler("onClientMarkerHit"punktonCheckpointHitend 


oraz DB



Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-01, 14:35


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

poniewaz funckja nie wie czym tam jest trasa oraz cheackpoint.

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-01, 14:49


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

wytumaczysz mi jak to naprawi? ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-01, 15:13


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

musisz dac trase i cheatpoint na pobliczny czyli bez local przed nimi

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-02, 19:04


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

Skrpyt po stronie clienta wygl?da tak


--kolejne wspolrzedne punktow 
trasa = { 
{-2433.10,137.52,34.64},
{-2423.41,49.75,34.67},
{-2490.89,42.26,25.34},
{-2503.28,-18.36,25.26},
{-2498.41,-67.22,25.24},
{-2425.34,-72.59,34.93},
{-2367.20,-72.58,34.92},
{-2248.50,-72.56,34.82},
{-2094.59,-72.55,34.83},
{-2004.19,-44.57,34.82},
{-2002.75,101.94,27.19},
{-1993.15,145.24,27.19},
{-1999.10,186.68,27.19},
{-2000.17,304.51,34.48},
{-2000.85,495.63,34.66},
{-2069.21,507.24,34.67},
{-2136.70,506.92,34.67},
{-2221.06,511.22,34.67},
{-2231.39,566.56,34.66},
{-2371.14,568.79,24.39},
{-2514.59,568.69,14.12},
{-2596.61,568.83,14.12},
{-2609.33,364.80,4.74},
{-2550.22,339.34,18.97},
{-2579.24,228.92,9.03},
{-2564.10,167.27,3.93},
{-2509.20,161.18,4.26},
{-2257.47,318.78,34.83},
{-2308.31,417.21,34.66},
{-2368.01,362.39,34.67},
{-2419.75,187.99,34.67},
{-2461.36,165.84,34.69},
}--{xyz},


--nasze kategorie oraz ceny 
local kategorie = { 
{"A"100}, 
{"B"0}, 
{"C"150},    
{"D"300},
{"D+E"500},
} 

--gui 
mojeW,mojeH 640480 
sW,sH guiGetScreenSize() 
widthheight = (sW/mojeW), (sH/mojeHlocal guiprawko = {} 
guiprawko[1] = guiCreateWindow(150*width65*height321*width309*height"Prawo Jazdy"falseguiWindowSetSizable(guiprawko[1], falseguiprawko[2] = guiCreateLabel(61*width62*height204*width37*height"Zdawanie prawa jazdy\n Na serwerze San Andreas Life"falseguiprawko[1]) 
guiLabelSetHorizontalAlign(guiprawko[2], "left"trueguiprawko[3] = guiCreateGridList(45*width113*height236*width132*heightfalseguiprawko[1]) 
guiprawko[4] = guiGridListAddColumn(guiprawko[3], "Kategoria"0.5guiprawko[5] = guiGridListAddColumn(guiprawko[3], "Koszt (PLN)"0.5local row guiGridListAddRow (guiprawko[3]) 
guiGridListSetItemText (guiprawko[3], rowguiprawko[4], "Kategoria A"falsefalseguiGridListSetItemText (guiprawko[3], rowguiprawko[5], kategorie[1][2], falsefalselocal row guiGridListAddRow (guiprawko[3]) 
guiGridListSetItemText (guiprawko[3], rowguiprawko[4], "Kategoria B"falsefalseguiGridListSetItemText (guiprawko[3], rowguiprawko[5], kategorie[2][2], falsefalselocal row guiGridListAddRow (guiprawko[3]) 
guiGridListSetItemText (guiprawko[3], rowguiprawko[4], "Kategoria C"falsefalseguiGridListSetItemText (guiprawko[3], rowguiprawko[5], kategorie[3][2], falsefalselocal row guiGridListAddRow (guiprawko[3]) 
guiGridListSetItemText (guiprawko[3], rowguiprawko[4], "Kategoria D"falsefalseguiGridListSetItemText (guiprawko[3], rowguiprawko[5], kategorie[4][2], falsefalselocal row guiGridListAddRow (guiprawko[3]) 
guiGridListSetItemText (guiprawko[3], rowguiprawko[4], "Kategoria C+E"falsefalseguiGridListSetItemText (guiprawko[3], rowguiprawko[5], kategorie[5][2], falsefalseguiprawko[6] = guiCreateButton(10*width255*height122*width44*height"Anuluj"falseguiprawko[1]) 
guiprawko[7] = guiCreateButton(190*width255*height121*width44*height"Dalej"falseguiprawko[1]) 
guiSetVisible(guiprawko[1], falseaddEvent("showGUIPrawko"trueaddEventHandler("showGUIPrawko"getRootElement(), 
function(abcdeguiSetVisible(guiprawko[1], trueshowCursor(trueend) 

function onPrawkoZamknij() 
guiSetVisible(guiprawko[1], falseshowCursor(falseend 
addEventHandler ("onClientGUIClick"guiprawko[6], onPrawkoZamknijfalse) 

function onPrawkoDalej() 
local rowcolumn guiGridListGetSelectedItem(guiprawko[3]) 
if row ~= -1 then 
local text guiGridListGetItemText (guiprawko[3], rowguiprawko[4]) 
local cena guiGridListGetItemText (guiprawko[3], rowguiprawko[5]) 
if tonumber(cena) <= getPlayerMoney(localPlayerthen 
if text == "Kategoria A" then 
triggerServerEvent("egzaminPrawaJazdy"localPlayer"A"cena) 
elseif text == "Kategoria B" then 
triggerServerEvent("egzaminPrawaJazdy"localPlayer"B"cena) 
elseif text == "Kategoria C" then 
triggerServerEvent("egzaminPrawaJazdy"localPlayer"C"cena) 
elseif text == "Kategoria C+E" then 
triggerServerEvent("egzaminPrawaJazdy"localPlayer"C+E"cena) 
elseif text == "Kategoria D" then 
triggerServerEvent("egzaminPrawaJazdy"localPlayer"D"cenaend 
else 
outputChatBox("Nie posiadasz wystarczaj?co pieni?dzy."230230230trueend 
end 
end 
addEventHandler ("onClientGUIClick"guiprawko[7], onPrawkoDalejfalse) 

--egzamin 
addEvent("startEgzamin"trueaddEventHandler("startEgzamin"getRootElement(), 
function(vehonPrawkoZamknij() 

SAVEVEH veh --zapisuje sobie moj pojazd 
checkpoint 1 
stworzNowyCheckpoint() 

addEventHandler("onClientVehicleExit"resourceRoot, function(playerseat) 
if seat == 0 then 
triggerServerEvent("egzaminOblany"localPlayerusunOstatniCheckpoint() 
checkpoint false 
SAVEVEH false 
end 
end) 


--4. sek po respie auta mozna dopiero oblac dla bezpieczenstwa przy respawnie 
setTimer(function() 
fixVehicle(SAVEVEHaddEventHandler("onClientVehicleCollision"SAVEVEHonVehicleCollisionend40001end) 

function stworzNowyCheckpoint(source) 
if isElement(punktthen
removeEventHandler("onClientMarkerHit"punktonCheckpointHit)

destroyElement(punktdestroyElement(blipend 

punkt createMarker (trasa[checkpoint][1], trasa[checkpoint][2], trasa[checkpoint][3] , "checkpoint"30255255150)
strzala setMarkerTarget(punkttrasa[checkpoint+1][1], trasa[checkpoint+1][2], trasa[checkpoint][3]) 
blip createBlipAttachedTo(punkt12)

addEventHandler("onClientMarkerHit"punktonCheckpointHitend 

function usunOstatniCheckpoint() 
if isElement(punktthen 
removeEventHandler("onClientMarkerHit"punktblipstrzalaonCheckpointHitdestroyElement(punkt)
destroyElement(blip)
destroyElement(strzala)
end 
end 

function onCheckpointHit(hitElement) 
if localPlayer == hitElement then 
checkpoint checkpoint if checkpoint #trasa then 
triggerServerEvent("egzaminZdany"localPlayerzakonczEgzamin() 
else 
stworzNowyCheckpoint() 
end 
end 
end 

function onVehicleCollision(elementloss) 
if loss 50 then 
triggerServerEvent("egzaminOblany"localPlayerzakonczEgzamin() 
end 
end 

function zakonczEgzamin() 
removeEventHandler("onClientVehicleCollision"SAVEVEHonVehicleCollisionusunOstatniCheckpoint() 
checkpoint false 
SAVEVEH false 
end 


co mam zmieni? ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-02, 19:12


_Haze

Peace Yo!






Wiek: 24
Na forum: 4185 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

strzala setMarkerTarget(punkttrasa[checkpoint+1][1], trasa[checkpoint+1][2], trasa[checkpoint+1][3]) 

zapomnia?e? da? +1 w indexie i jak chcesz mo?esz da? takiego ifa
if (checkpoint+1) <= #trasa then 


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
polaczkos
Wysłany: 2017-05-02, 19:31


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

zrobi?em tak i nie ma ?adnch b??d?w ale uk?czy? prawka si? nie da

[ Dodano: 2017-05-02, 19:33 ]
Ju? dzia?a tylko end w z?ym miejscu da?em :D leci piwko za pomoc :D

Postaw piwo autorowi tego posta
 

 
Tagi: prawko
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » prawko Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku