gazzxr Posted November 23, 2010 Posted November 23, 2010 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 )
Kenix Posted November 23, 2010 Posted November 23, 2010 local localPlayer = getLocalPlayer ( ) outputConsole ( "npcsparrowgo", localplayer ) I could be wrong
dzek (varez) Posted November 23, 2010 Posted November 23, 2010 cant you just replace line 16 with setupForRace()? if you really want make this like that, use this
gazzxr Posted November 23, 2010 Author Posted November 23, 2010 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 )
gazzxr Posted November 23, 2010 Author Posted November 23, 2010 cant you just replace line 16 with setupForRace()?if you really want make this like that, use this Yes i could , but then every player that steps in marker will spawn 1 helicopter and 1 NPC in it , and 1 at the time .... (you know the rest )
Static-X Posted November 23, 2010 Posted November 23, 2010 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 ?
gazzxr Posted November 23, 2010 Author Posted November 23, 2010 (edited) Nop , thanks for the help. i got i working .... Edited November 23, 2010 by Guest
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now