Jump to content

An unknown Error


SkrillexX

Recommended Posts

Greetings , as /debugscript 3 said , there's an error somewhere in line 4 , problem is that i'm unable to find it.

function HitMarker(thePlayer,theMarker ) 
local thePlayer = getLocalPlayer() 
local thePlayerPos = getElementPosition(thePlayer) 
 if (thePlayerPos == x ,y ,z) then 
 outputChatBox ("keep inside the Marker and type /robtime to know what's the remaining time" ,thePlayer ,0 ,250 ,0 ,false ) 
 dxDrawText("ROBBERY IS PROGRESSING ( 50000$ )", 279, 143, 661, 201, tocolor(255, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false) 
 setTime ( 00 , 00 ) 
 else return 
 end 
end 
addEventHandler("OnClientMarkerHit" ,getRootElement() ,HitMarker ) 

btw i precised the "x ,y ,z" on a previous function

Here's debugscript's message :

ERROR; Loading Script Failed : Rob\Robbery.lua:4:')' expected near '.'

Link to comment

I tried to correct the code , check it out , i added the first part of it.

function RobMarker(thePlayer) 
local pos = 281.12664794922 ,-1768.4904785156 ,4.5230431556702  
local theMarker = createMarker ( pos, "checkpoint" ,4.0 ,255 ,0 ,0 ) 
createBlip ( pos ,32 ,2 ,255 ,0 ,0 ,255 ,0 ) 
setTimer (RobMarker , 600000 ,0 ) 
end 
addEventHandler ("onClientResourceStart" ,getRootElement() ,RobMarker) 
  
function HitMarker(thePlayer,theMarker ) 
local thePlayer = getLocalPlayer() 
local markercheck = isElementWithinMarker(thePlayer ,theMarker ) 
 if ( markercheck ) then 
 outputChatBox ("keep inside the Marker and type /robtime to know what's the remaining time" ,thePlayer ,0 ,250 ,0 ,false ) 
 dxDrawText("ROBBERY IS PROGRESSING ( 50000$ )", 279, 143, 661, 201, tocolor(255, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false) 
 setTime ( 00 , 00 ) 
 else return 
 end 
end 
addEventHandler("onClientMarkerHit" ,getRootElement() ,HitMarker ) 

Link to comment

Euh , i don't think this code is correct but anyways .. Correct me if there's mistakes

  
function HitMarker(thePlayer,theMarker ) 
local thePlayer = getLocalPlayer() 
local markercheck = isElementWithinMarker(thePlayer ,theMarker ) 
end  
addEventHandler("onClientMarkerHit" ,getRootElement() ,HitMarker ) 
 function dxDraw() 
  if ( markercheck ) then 
  outputChatBox ("keep inside the Marker and type /robtime to know what's the remaining time" ,thePlayer ,0 ,250 ,0 ,false ) 
  dxDrawText("ROBBERY IS PROGRESSING ( 50000$ )", 279, 143, 661, 201, tocolor(255, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false) 
  setTime ( 00 , 00 ) 
  else return 
  end 
 end 
addEventHandler("onClientRender" ,getRootElement() ,dxDraw ) 
  

Link to comment
function HitMarker ( thePlayer ) 
    if ( thePlayer == localPlayer and source == theMarker ) then 
        addEventHandler ( "onClientRender" ,getRootElement(), dxDraw ) 
    end 
end 
addEventHandler ( "onClientMarkerHit" ,getRootElement(), HitMarker ) 
  
function dxDraw ( ) 
    if isElementWithinMarker ( localPlayer, theMarker ) then 
        outputChatBox ( "keep inside the Marker and type /robtime to know what's the remaining time", 0, 250, 0 ) 
        dxDrawText ( "ROBBERY IS PROGRESSING ( 50000$ )", 279, 143, 661, 201, tocolor(255, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, true, false, false ) 
    end 
end 

I removed setTime because that function sets the game time, maybe you thought it did something else?

Link to comment

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...