serek123
Lua, MySql, Sql
Wiek: 27 Na forum: 4334 dni Posty: 217
Nick w MP: Serek.
Piwa : 374
Witam.
Potrzebuje pomocy przy skrypcie prawa jazdy jak si? nie myl? to Artysty chcia?bym aby po wyj?ciu gracza z pojazdu on znika? i markery tak samo bo po wyj?ciu z auta markery zostaj? i mo?na zdawa? z buta oto kod
C-side
Kod:
function markerygo ( source )
marker1 = createMarker ( -2007.8035888672, 448.80407714844, 34.719398498535, "checkpoint", 3.0, 255, 0, 0, 100)
end
addEvent( "zdajemyprawkotrolololo", true )
addEventHandler( "zdajemyprawkotrolololo",localPlayer, markerygo )
function MH1 (hitPlayer, matchingDimension)
if hitPlayer == localPlayer then
if source == marker1 then
destroyElement ( marker1 )
marker2 = createMarker ( -2007.1512451172, 356.27447509766, 34.719463348389, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker2 then
destroyElement ( marker2 )
marker3 = createMarker ( -2031.2839355469, 321.81930541992, 34.719440460205, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker3 then
destroyElement ( marker3 )
marker4 = createMarker ( -2148.3205566406, 301.18096923828, 34.875690460205, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker4 then
destroyElement ( marker4 )
marker5 = createMarker ( -2147.951171875, 178.54162597656, 34.875663757324, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker5 then
destroyElement ( marker5 )
marker6 = createMarker ( -2162.1904296875, 95.453231811523, 34.875629425049, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker6 then
destroyElement ( marker6 )
marker7 = createMarker ( -2169.5212402344, 11.678644180298, 34.875617980957, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker7 then
destroyElement ( marker7 )
marker8 = createMarker ( -2169.1672363281, -58.265563964844, 34.878513336182, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker8 then
destroyElement ( marker8 )
marker9 = createMarker ( -2142.7355957031, -72.150901794434, 34.875694274902, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker9 then
destroyElement ( marker9 )
marker10 = createMarker ( -2019.1793212891, -71.768051147461, 34.875659942627, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker10 then
destroyElement ( marker10 )
marker11 = createMarker ( -1963.3054199219, -66.239807128906, 25.42183303833, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker11 then
destroyElement ( marker11 )
marker12 = createMarker ( -1850.4830322266, -118.09896850586, 5.4075512886047, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker12 then
destroyElement ( marker12 )
marker13 = createMarker ( -1797.5603027344, -104.02542114258, 5.5658903121948, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker13 then
destroyElement ( marker13 )
marker14 = createMarker ( -1803.5244140625, 91.251441955566, 14.66473197937, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker14 then
destroyElement ( marker14 )
marker15 = createMarker ( -1805.8244628906, 225.64205932617, 14.658530235291, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker15 then
destroyElement ( marker15 )
marker16 = createMarker ( -1733.9910888672, 315.22134399414, 6.73504114151, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker16 then
destroyElement ( marker16 )
marker17 = createMarker ( -1575.8083496094, 474.17834472656, 6.7350559234619, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker17 then
destroyElement ( marker17 )
marker18 = createMarker ( -1556.2133789063, 639.65899658203, 6.7427668571472, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker18 then
destroyElement ( marker18 )
marker19 = createMarker ( -1534.7618408203, 803.01275634766, 6.7427682876587, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker19 then
destroyElement ( marker19 )
marker20 = createMarker ( -1526.9068603516, 902.021484375, 6.7428755760193, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker20 then
destroyElement ( marker20 )
marker21 = createMarker ( -1552.4194335938, 991.17492675781, 6.7455759048462, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker21 then
destroyElement ( marker21 )
marker22 = createMarker ( -1580.7778320313, 1080.4786376953, 6.7428102493286, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker22 then
destroyElement ( marker22 )
marker23 = createMarker ( -1601.9034423828, 1217.4451904297, 6.7427444458008, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker23 then
destroyElement ( marker23 )
marker24 = createMarker ( -1698.9564208984, 1316.9526367188, 6.7427892684937, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker24 then
destroyElement ( marker24 )
marker25 = createMarker ( -1820.208984375, 1383.4909667969, 6.7449216842651, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker25 then
destroyElement ( marker25 )
marker26 = createMarker ( -1936.6287841797, 1313.3472900391, 6.7496047019958, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker26 then
destroyElement ( marker26 )
marker27 = createMarker ( -2066.5876464844, 1281.4682617188, 8.2682151794434, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker27 then
destroyElement ( marker27 )
marker28 = createMarker ( -2269.6762695313, 1259.2257080078, 42.872062683105, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker28 then
destroyElement ( marker28 )
marker29 = createMarker ( -2268.3161621094, 1152.8293457031, 59.421737670898, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker29 then
destroyElement ( marker29 )
marker30 = createMarker ( -2267.9704589844, 1069.1864013672, 80.996643066406, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker30 then
destroyElement ( marker30 )
marker31 = createMarker ( -2268.2490234375, 970.17901611328, 67.228797912598, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker31 then
destroyElement ( marker31 )
marker32 = createMarker ( -2267.9899902344, 866.65887451172, 66.203788757324, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker32 then
destroyElement ( marker32 )
marker33 = createMarker ( -2267.703125, 748.00549316406, 49.000621795654, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker33 then
destroyElement ( marker33 )
marker34 = createMarker ( -2268.0397949219, 642.25689697266, 48.996223449707, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker34 then
destroyElement ( marker34 )
marker35 = createMarker ( -2251.5817871094, 563.27160644531, 34.719421386719, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker35 then
destroyElement ( marker35 )
marker36 = createMarker ( -2126.1342773438, 562.44769287109, 34.719440460205, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker36 then
destroyElement ( marker36 )
marker37= createMarker ( -2006.8677978516, 557.16131591797, 34.719329833984, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker37 then
destroyElement ( marker37 )
marker38= createMarker ( -2013.5954589844, 477.08596801758, 34.875556945801, "checkpoint", 3.0, 255, 0, 0, 100)
end
if source == marker38 then
destroyElement ( marker38 )
local auto = getPedOccupiedVehicle ( hitPlayer)
local hpauta = getElementHealth ( auto )
localPlayer = getLocalPlayer()
if hpauta > 960 then
triggerServerEvent ( "prawko.zdal", localPlayer )
triggerServerEvent ( "prawkoautosadasdas", localPlayer )
else
localPlayer = getLocalPlayer()
triggerServerEvent ( "prawko.oblal", localPlayer )
triggerServerEvent ( "prawkoautosadasdas", localPlayer )
end
end
end
end
addEventHandler ( "onClientMarkerHit", getRootElement(), MH1 )
S-side
Kod:
function getpos( source )
local x,y,z = getElementPosition ( source )
outputChatBox(""..x..", "..y..", "..z.."", source, 255, 255, 255)
end
addCommandHandler("pozycja", getpos )
function sethpnpc ()
end
setTimer( sethpnpc, 1000,0 )
local marker = createMarker ( -2033.4337158203, -117.67643737793, 1034.171875, "cylinder", 2.0, 255, 0, 0)
setElementInterior ( marker, 3)
function onhit( source )
outputChatBox("Aby zacz?? kurs prawa jazdy wpisz /kurs", source, 255, 255, 255)
end
addEventHandler( "onMarkerHit", marker, onhit)
function kurs(source)
if isElementWithinMarker ( source, marker )
then
local konto = getPlayerAccount ( source )
if not getAccountData(konto,"prawojazdy" ) then
setElementInterior ( source, 0)
auto = createVehicle ( 589, -2019.9250488281, 457.44064331055, 34.876052856445, 0, 0, 270)
setVehicleColor ( auto, 1 )
warpPlayerIntoVehicle ( source, auto )
-- local instruktor2 = createPed(57, 0, 0,0 )
-- warpPlayerIntoVehicle ( instruktor2, auto, 1 )
triggerClientEvent ("zdajemyprawkotrolololo", source )
else
outputChatBox("Masz ju? prawo jazdy.", source, 255, 255, 255)
end
end
end
addCommandHandler("kurs", kurs)
function zdal ()
local nick = getPlayerName ( source)
konto = getPlayerAccount ( source )
setAccountData ( konto, "prawojazdy", true )
end
addEvent( "prawko.zdal", true )
addEventHandler( "prawko.zdal", root, zdal )
function oblal ()
local nick = getPlayerName ( source)
end
addEvent( "prawko.oblal", true )
addEventHandler( "prawko.oblal", root, oblal )
function zabierzauto ( )
local auto = getPedOccupiedVehicle( source )
destroyElement ( auto )
end
addEvent( "prawkoautosadasdas", true )
addEventHandler( "prawkoautosadasdas", root, zabierzauto )
function sadasdsa ( source )
konto = getPlayerAccount ( source )
setAccountData ( konto, "prawojazdy", false)
end
addCommandHandler("sadsavfd343", sadasdsa )