Wysłany: 2014-10-04, 12:46
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
Witam. Ot??, napisa?em sobi? kod na skrypt pracy dorywczej. Ale po wje?dzie w marker 1, nic si? nie dzieje. Prosz? o pomoc, naturalnie
local gracz = getLocalPlayer ()
function info ( tekst )
exports . msgboxrpg : showBox ( "info" , tekst )
end
ped2 = createPed ( 60 , - 134.60380554199 , 1116.5102539063 , 20.196640014648 )
setPedAnimation ( ped2 , "RAPPING" , "RAP_B_Loop" )
start = createMarker (- 136.267578125 , 1116.515625 , 20.196640014648 , "cylinder" , 1 , 24 , 56 , 21 )
function funkcja1 ( hitElement )
if hitElement == getLocalPlayer () then
if getElementData ( hitElement , "praca:kurier" ) == false then
info ( "Rozpocz??e? prac? jako kurier. Dowie? paczk? w dane miejsce." )
triggerServerEvent ( "Dajpojazd" , getLocalPlayer (), hitElement )
marker1 = createMarker ( 2182.9260253906 , 1677.2681884766 , 11.074653625488 , "cylinder" , 3.5 , 255 , 255 , 0 )
blip1 = createBlipAttachedTo ( marker1 , 41 )
setElementPosition ( gracz , - 140.87875366211 , 1124.3336181641 , 19.749988555908 )
setElementData ( gracz , "praca:kurier" , true )
else
info ( "Ju? zacz??e?/a? prac? jako kurier." )
end
end
end
addEventHandler ( "onClientMarkerHit" , start , funkcja1 )
function funkcja2 ( hitElement )
if getElementData ( gracz , "praca:kurier" ) == true then
info ( "Odwioz?e? paczk?, teraz oddaj pojazd do firmy." )
destroyElement ( marker1 )
destroyElement ( blip1 )
ostatni = createMarker (- 137.49137878418 , 1125.2542724609 , 19.749988555908 , "cylinder" , 3.5 , 255 , 255 , 0 )
blipostatni = createBlipAttachedTo ( ostatni , 41 )
end
end
addEventHandler ( "onClientMarkerHit" , marker1 , funkcja2 )
function funkcja3 ( hitElement )
if getElementData ( gracz , "praca:kurier" ) == true then
info ( "Uko?czy?e? prac? Kuriera, za wykonan? robot? dostajesz 250 z?." )
triggerServerEvent ( "dajKase" , root , gracz , 250 )
triggerServerEvent ( "usun" , getLocalPlayer (), gracz )
destroyElement ( ostatni )
destroyElement ( blipostatni )
setElementData ( gracz , "praca:kurier" , false )
end
end
addEventHandler ( "onClientMarkerHit" , ostatni , funkcja3 )
Wysłany: 2014-10-04, 15:22
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Nie pro?ciej tak? Kod pobrany z prawa jazdy ze starego serwera :
addEventHandler ( "onClientMarkerHit" , root , function ( element )
if source == marker then
if element == localPlayer then
if getElementData ( element , "PrawoJazdy:B" ) then return outputChatBox ( "Posiadasz ju? Prawo Jazdy Kat.B!" , 255 , 255 , 255 ) end
if liczba == #miejsca then
hp = getElementHealth ( getPedOccupiedVehicle ( element ) )
return triggerServerEvent ( "koniecEgzaminu" , element , tonumber ( hp ) ) end
if liczba == 0 then
outputChatBox ( "Zacz??e? egzamin Prawa Jazdy Kategoria B." , 255 , 255 , 255 )
triggerServerEvent ( "onPlayerStart" , localPlayer )
end
liczba = liczba + 1
marker = createMarker ( miejsca [ liczba ][ 1 ], miejsca [ liczba ][ 2 ], miejsca [ liczba ][ 3 ], "checkpoint" , 1.5 , 255 , 0 , 0 )
destroyElement ( source )
end
end
addEvent ( "onPlayerDestroyMarker" , true )
addEventHandler ( "onPlayerDestroyMarker" , root , function ()
if source == localPlayer then
destroyElement ( marker )
liczba = 0
marker = createMarker ( - 102.2421875 , 1231.9173583984 , 21.94800567627 , "cylinder" , 5 , 255 , 255 , 255 , 0 , 0 )
end
end )
end )
Tagi: praca :: dorywcza
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: