Jump to content

Help ?!


BabY

Recommended Posts

Posted

Hey All ...

I Think a Lot Posted like me, asking about " How to make a Marker "

But ...

I Made the Marker

and When I Enter it, It Dosen't Teleport, I Need it to Work, in a DM Map (Race)

I Saw Some one, Made like me, But It was with a Panel or Some thing ...

So I Think my Situaion are Different ...

Debug Script Result :

mtafrm.gif

Hmmm ... Line 5 ...

at the "addEvetHandler" ...

My Script :

function startclient () 
    setSkyGradient( 50 , 255 , 255 , 65 , 100 , 25 ) 
  
    Marker1 = createMarker ( 4183.0122070313, -2877.7978515625, 1067.9123535156, "arrow", 5, 0, 2, 255, 255) 
        addEventHandler( "onClientMarkerHit", Marker1, markerHit) 
end 
  
function warp (player) 
  
  
if source == Marker1 then 
    if isPedInVehicle(player) then 
        local vehicle=getPedOccupiedVehicle(player)  
            setElementPosition (vehicle , 4154.0571289063, -2392.6955566406, 1610.1810302734 ) 
            setTimer( setVehicleFrozen, 1000, 1, vehicle, false ) 
             
        end 
end 
  
function markerHit(thePlayer,dimension) 
  
  if (dimension and thePlayer==getLocalPlayer()) then 
            local sound = playSound("files/warp.mp3") 
  end 
  
end  
end 
  
addEventHandler( "onClientResourceStart", resourceRoot, startclient ) 
addEventHandler( "onClientMarkerHit", getRootElement(), warp )  

so ... Whats Wronge ...

Scripting is rly Strange ... The Debug Scripter Tell me the Problem, and Leave me Burn :evil:

Posted (edited)
  
function startclient () 
    setSkyGradient( 50 , 255 , 255 , 65 , 100 , 25 ) 
  
    Marker1 = createMarker ( 4183.0122070313, -2877.7978515625, 1067.9123535156, "arrow", 5, 0, 2, 255, 255) 
        addEventHandler( "onClientMarkerHit", Marker1) 
end 
  
function warp (player) 
  
if source == Marker1 then 
    if isPedInVehicle(player) then 
        local vehicle=getPedOccupiedVehicle(player)  
            setElementPosition (vehicle , 4154.0571289063, -2392.6955566406, 1610.1810302734 ) 
            setTimer( setVehicleFrozen, 1000, 1, vehicle, false ) 
             
        end 
end 
  
function markerHit(thePlayer,dimension) 
  
  if (dimension and thePlayer==getLocalPlayer()) then 
            local sound = playSound("files/warp.mp3") 
  end 
  
end  
end 
  
addEventHandler( "onClientResourceStart", resourceRoot, startclient ) 
addEventHandler( "onClientMarkerHit", getRootElement(), warp ) 
  

Edited by Guest
Posted

"markerHit" function is not created when you attach event handler to your marker, causing this error.

and that is because you've placed "markerHit" function inside "warp" function (see your "end"s)

function startclient () 
  setSkyGradient( 50 , 255 , 255 , 65 , 100 , 25 ) 
  Marker1 = createMarker ( 4183.0122070313, -2877.7978515625, 1067.9123535156, "arrow", 5, 0, 2, 255, 255) 
  addEventHandler( "onClientMarkerHit", Marker1, markerHit) 
end 
  
function warp (player) 
  if source == Marker1 then 
    if isPedInVehicle(player) then 
      local vehicle=getPedOccupiedVehicle(player) 
      setElementPosition (vehicle , 4154.0571289063, -2392.6955566406, 1610.1810302734 ) 
      setTimer( setVehicleFrozen, 1000, 1, vehicle, false ) 
    end 
  end   
end 
  
function markerHit(thePlayer,dimension) 
  if (dimension and thePlayer==getLocalPlayer()) then 
    local sound = playSound("files/warp.mp3") 
  end 
end 
  
addEventHandler("onClientResourceStart", resourceRoot, startclient) 
addEventHandler("onClientMarkerHit", getRootElement(), warp)  

Posted
  
        addEventHandler( "onClientMarkerHit", Marker1) 
  

nice way to "fix" the undefined function problem — remove it

lol

Posted

Bu' ...

I Have another Problem :(

When I Enter the Marker, and Every thing is Okay,

I Don't Hear the Sound ...

I Want to Hear it :(

It will make the Markers COOL ;D

Posted

I can be mistaken but errors aren't present

  
function startclient ( hitElement, matchingDimension ) 
if getElementType( hitElement ) == "player" then 
local sound = playSound("files/warp.mp3") 
setSkyGradient( 50 , 255 , 255 , 65 , 100 , 25 ) 
    Marker1 = createMarker ( 4183.0122070313, -2877.7978515625, 1067.9123535156, "arrow", 5, 0, 2, 255, 255) 
       local sound = playSound("files/warp.mp3") 
        addEventHandler( "onMarkerHit", Marker1) 
end 
  
function warp (player) 
  
if source == Marker1 then 
    if isPedInVehicle(player) then 
        local vehicle=getPedOccupiedVehicle(player)  
            setElementPosition (vehicle , 4154.0571289063, -2392.6955566406, 1610.1810302734 ) 
            setTimer( setVehicleFrozen, 1000, 1, vehicle, false ) 
             
        end 
end  
end  
end 
addEventHandler( "onClientResourceStart", resourceRoot, startclient ) 
addEventHandler( "onClientMarkerHit", getRootElement(), warp ) 
  

Posted
Bu' ...

I Have another Problem :(

When I Enter the Marker, and Every thing is Okay,

I Don't Hear the Sound ...

I Want to Hear it :(

It will make the Markers COOL ;D

that is because cause you've used volk-rus "fix" solution. and i'm not here to help people who won't listen and don't want to even try and uderstand the problems they have.

onMarkerhit Search on wiki

actually you should read the wiki yourself first, before posting here nonsense like this:

        addEventHandler( "onMarkerHit", Marker1) 

Posted

Well, Forget the Sound ...

I Had a New Problem ...

I Wanted to Make the Sky be Like a Mario game :)

and Change the Game Speed ...

But I Failed ...

Look at my ******************************************** xD

function startclient () 
    outputChatBox ("= = = = = = = = = =", 255, 255, 0, true) 
    outputChatBox (" ",0 ,0 ,0 ,true) 
    outputChatBox ("#ff0000Happy #0000f0New #00ff002011 #ff00ffYear",0, 0, 0, true) 
    outputChatBox (" ",0,0,0,true) 
    outputChatBox ("= = = = = = = = = =", 255, 255, 0, true) 
    setSkyGradient ( 50 , 255 , 255 , 65 , 100 , 25 ) 
    setWaterColor (50, 60, 100) 
    setTime (00, 0) 
    setWaveHeight ( 0.5 ) 
    setBlurLevel ( 10 ) 
     
     
    Marker1 = createMarker ( 4182.88671875, -2876.1853027344, 1062.5003662109, "corona", 7, 0, 0, 255, 200) 
    Marker2 = createMarker ( 4703.38525390, -2239.5251464844, 1609.0306396484, "corona", 15, 255, 55, 55, 200) 
    addEventHandler( "onMarkerHit", Marker1, markerHit) 
    addEventHandler( "onMarkerHit", Marker2, markerHit) 
     
end 
  
  
function warp (player) 
  
  
if source == Marker1 then 
    if isPedInVehicle(player) then 
        local vehicle=getPedOccupiedVehicle(player)  
            setElementPosition (vehicle , 4154.0571289063, -2392.6955566406, 1608.3810302734 ) 
            setElementRotation (vehicle , 0,0,310.5) 
            setVehicleFrozen ( vehicle , true ) 
            setTimer( setVehicleFrozen, 300, 1, vehicle, false ) 
            setWeather ( 0 ) 
            setTime ( 00, 0) 
            setBlurLevel ( 0 ) 
             
        end 
end 
  
  
  
if source == Marker2 then 
    if isPedInVehicle(player) then 
        local vehicle=getPedOccupiedVehicle(player)  
            setElementPosition (vehicle , 4169.7006835938, -2271.2592773438, 1111.0838623047 )   
            setElementRotation (vehicle , 0, 0, 0 ) 
            setVehicleFrozen ( vehicle , true ) 
            setTimer( setVehicleFrozen, 700, 1, vehicle, false ) 
            setTime ( 00, 0 ) 
            setBlurLevel ( 20 ) 
            setGameSpeed ( 1.5 ) 
           [color=#FF0000] setTimer (loll, 300, 0)[/color] 
            setSkyGradient (math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255)) 
    end 
end 
             
end  
  
  
  
function markerHit(thePlayer,dimension) 
  
  
  if (dimension and thePlayer==getLocalPlayer()) then 
            local sound = playSound("files/warp.mp3")  
        end 
  
end 
  
  
addEventHandler( "onClientResourceStart", resourceRoot, startclient, loll ) 
addEventHandler( "onClientMarkerHit", getRootElement(), warp ) 
             

I Want, When The Player Enter the Marker2 Make the Randomly Sky and Other Stuff ...

But I Enter the Marker it don't make any thin

and i have tried to move the setTimer in defirrent places ... but it's not working ...

Posted

Sorry,

I Forgot to Post "SOVED" xD

LoLz ...

I Searched in the Wiki, and Found Exactly what I Want xD

Just, Copy Paste :)

But I Didn't Found any Solution to Make the HeadLightColor ...

Like the Sky :(

Can you Help me ?

and This will be the Last Question :)

and I Will Request to Lock the Topic :|

Posted

Look

at the Marker2

I Made the Game speed fast

and the Sky Change randomly every 700 ms

and The Water color too ...

and The Car Colors ...

And I Want to Make the Car headlights change too ...

so i will complete the mario world marker :P

But, I Can't Get the HeadLightsColors ...

And I Searched inda Wiki, I Couldn't get my useful ...

so I'am asking for Help :)

Posted

If you are looking for the head light function then it is

SetVehicleHeadLightColor(vehicle,r,g,b)

if you want the sky color same as vehicle then use.

  
r = math.random(0,255) 
g = math.random(0,255) 
b = math.random(0,255) 
  

replace

setSkyGradient (math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255)) 

with

setSkyGradient (r, g, b, math.random(0,255),math.random (0,255),math.random (0,255)) 

and add this for the headlights color same as the sky

setVehicleHeadLightColor(getPedOccupiedVehicle(thePlayer),r,g,b) 

For making r,g,b to get generated randomly after every X miliseconds you can use setTimer

function defineTheRGB() 
    r = math.random(0,255) 
    g = math.random(0,255) 
    b = math.random(0,255) 
end 
setTimer(defineTheRGB,XXX,XXX) 

If this is still not the thing you want then please explain what you want.

Posted
If you are looking for the head light function then it is

SetVehicleHeadLightColor(vehicle,r,g,b)

if you want the sky color same as vehicle then use.

  
r = math.random(0,255) 
g = math.random(0,255) 
b = math.random(0,255) 
  

replace

setSkyGradient (math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255)) 

with

setSkyGradient (r, g, b, math.random(0,255),math.random (0,255),math.random (0,255)) 

and add this for the headlights color same as the sky

setVehicleHeadLightColor(getPedOccupiedVehicle(thePlayer),r,g,b) 

For making r,g,b to get generated randomly after every X miliseconds you can use setTimer

function defineTheRGB() 
    r = math.random(0,255) 
    g = math.random(0,255) 
    b = math.random(0,255) 
end 
setTimer(defineTheRGB,XXX,XXX) 

If this is still not the thing you want then please explain what you want.

Dude,

Step by Step ..

I Don't Understand any of what you Said ...

Just Post what I Have to Put in the lua file, and You will Have my Best Greeting ^^

P.S = HI AIBOOOO !!!! xD

Posted

read carefully.

you have setSkyGradient before, and

if you want the sky color same as vehicle then use.

Static-X wants to show you how to make sky same color as headlights.

Read carefully. We can't help you with your English misunderstanding, answering five times to same problem is useless.

Posted

I Want the Script to Make the Head Light color Change Randomly Every 800 MS and Please Post as you are Treating a Nab, and Make it Simple to Read, Because I'am not interisted in Reading Hard languages .

Greetz, needless to be profiled .

Posted (edited)
setTimer (setVehicleHeadLightColor,800,0,getPedOccupiedVehicle(thePlayer),math.random(0,255),math.random(0,255),math.random(0,255)) 

Edited by Guest

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...