Chc? zeby gdy si? wpisze /prawko respi?o nas na dimensionie 0 oraz interiorze 0 - tzn. normalna mapa, poniewa? marker jest w interiorze 3.
kod:
[lua]
local egzaminowany=nil
function sethpnpc ()
end
setTimer( sethpnpc, 1000,0 )
local marker = createMarker (-1734.08, 778.24, 23.9, "cylinder", 1.0, 255, 0, 0)
setElementDimension (marker, 0)
setElementInterior (marker, 3)
function onhit( source )
outputChatBox("Aby zda? prawo jazdy, wpisz nast?puj?ca komend? /prawko.", source)
end
addEventHandler( "onMarkerHit", marker, onhit)
function kurs(source)
if isElementWithinMarker ( source, marker )
then
local konto = getPlayerAccount ( source )
if not getAccountData(konto,"prawojazdy" ) then
outputChatBox("Rozpoczynasz kurs prawa do jazdy. Przestrzegaj przepis?w na drogach! ", source)
outputDebugString( "Start prawo jazdy")
auto = createVehicle ( 401, -2198, 304, 36, 0, 0, 0)
setElementData(auto, "pojazd_opis", "Pojazd egzaminacyjny")
setVehicleColor ( auto, 255, 255, 255 )
setVehiclePlateText(auto, "PRAWKO")
setVehicleHandling(auto, "maxVelocity", 60)
setElementData(auto, "pojazd_paliwo", 99)
warpPedIntoVehicle ( source, auto )
toggleControl(source, "enter_exit", false)
triggerClientEvent ("zdajemyprawko", source )
else
outputChatBox("Posiadasz ju? prawo jazdy!", source)
out... |