Posts: 372
Threads: 37
Joined: Jul 2007
Reputation:
0
I have certain code that teleports a player to a vehicle thats driven by an NPC problem is I used OnPlayerSpawn.. checked if the name matched and it teleported me but it took like 3 seconds+ for it to actually do the recorded path... Is there a specific callback I can use it get it exactly right cause it needs to be in sync with some times I have setup or certain things will happen either early/late
Posts: 372
Threads: 37
Joined: Jul 2007
Reputation:
0
Obviously not. OnPlayerSpawn is called after OnPlayerConnect.. and thats not good enough.
Posts: 2,203
Threads: 154
Joined: Oct 2009
Reputation:
0
Make a custom callback that will start it and do what you need?
Posts: 88
Threads: 24
Joined: Jun 2011
Reputation:
0
I know what you mean mate. Now.. I do not know if there is a function to get the npc's state. Well, what you can do is restart the npc everytime.. Like : OnPlayerSpawn(..){SpawnPlayer(npcid);PutPlayerInVe hicle(playerid,2,2);}
Try that.. Now get the vehicle id the npc is driving. And place it on the first number 2. Plus the the id of the driver(npc).
I hope this worked for you mate..
Posts: 36
Threads: 7
Joined: Jul 2010
Reputation:
0
Use a PVar and set it in your filterscript right after the NPC recording starts and have a timer in your gamemode where it checks if the PVar is a certain value and if it is, it calls a custom callback called OnNPCStartPath and have that loop through all the players with strcmp and see if the name matches with a NPC name you put in.