Jump to content

Help.


gazzxr

Recommended Posts

hi , take a look at this:

  
function chatBox() 
    rpTeleone1 = createMarker ( -1363.9683837891, 494.1506652832, 11.1953125, "cylinder", 1,0, 255, 255, 255, 255) 
     
    addEventHandler ( "onMarkerHit", rpTeleone1, onTeleone1Hit ) 
     
end 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), chatBox) 
  
function onTeleone1Hit ( player ) 
    if source == rpTeleone1 then 
    outputChatBox ( "Sergant P.J: Shit! they called for backup!", player, 0, 255, 255 ) 
    outputChatBox ( "Sergant P.J: We have sent you a helicopter for rescue!", player, 0, 255, 255 ) 
    outputChatBox ( "Sergant P.J: But you must make you're way to the helicopter!", player, 0, 255, 255 ) 
    outputChatBox ( "Sergant P.J: Hurry!", player, 0, 255, 255 ) 
    console ( "npcsparrowgo", player ) 
    end 
  end 

and this:

function setupForRace (NPC) 
    local RacerPed = createPed ( 287, -1252.2747802734, 500.51760864258, 18.16457748131 ) 
    local RaceVehicle = createVehicle ( 469, -1252.2747802734, 500.51760864258, 18.16457748131 )        
    warpPedIntoVehicle ( RacerPed, RaceVehicle )               
end 
addCommandHandler ( "npcsparrowgo", setupForRace )    

ITs all working fine , but , i cant make it when players steps in the marker , to execute command : "npcsparrowgo" tried even

outputConsole ( "npcsparrowgo", player )

Link to comment
  
local localPlayer = getLocalPlayer ( ) 
  
outputConsole ( "npcsparrowgo", localplayer ) 
  

I could be wrong

ERROR: telleports/telleports.lua:46: attempt to call global 'getLocalPlayer' (a nil value)

local localPlayer = getLocalPlayer ( ) 
      outputConsole ( "npcsparrowgo", localplayer ) 

Link to comment
  
local localPlayer = getLocalPlayer ( ) 
  
outputConsole ( "npcsparrowgo", localplayer ) 
  

I could be wrong

ERROR: telleports/telleports.lua:46: attempt to call global 'getLocalPlayer' (a nil value)

local localPlayer = getLocalPlayer ( ) 
      outputConsole ( "npcsparrowgo", localplayer ) 

He don't even know that getLocalPlayer() is client sided function or he can't differentiate between server and client sided scripts. Also, could you explain what is your goal ?

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