Posts: 591
Threads: 150
Joined: Sep 2013
Reputation:
0
when you enter one of the dynamic CPs, a textdraw show for player like this:
1- repair
2- refuel
3- add nos
how to use OnPlayerText to make it when a player is in this dynamic cp, if he response or text [1] it will repair his vehicle, and if he respond [2] it will refuel and.....?
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
What? I'm sure you want to do something else and you chose the wrong callback.
Posts: 591
Threads: 150
Joined: Sep 2013
Reputation:
0
idk what callback i should use but i have a box that contains textdraws which it appears when you enter one of my dynamic cps, the textdraws are:
1- repair
2- refuel
3- add nos
so it just show the textdraws without any point, so how to make it if i'm in this dynamic cp that shows this textdraws, when the player respond or reply with [1] in chat, it will repair his vehicle instead of sending number [1] to chat like that:
Player(id:0): 1
Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
I see exactly what your trying to do here, so basically what you need is an cp processor function to check which cp the player is in then execute the specified action lets break down the steps.
First part Checkpoints:
1.) Create Checkpoints (save their IDs in a array)
2.) Player enters checkpoint show textdraws
3.) Record which check point player entered
Second part Actions:
1.) Player gave input is the player in a checkpoint? If true are they still in the checkpoint ? Yes continue no cancel action invalidate checkpoint record
2.) Which action did the player specify? Is this action valid?
3.) Execute specified action
@Matkill: Never use IsPlayerInRangeOfPoint() in OnPlayerUpdate() dynamic checkpoints/areas eliminate the need for that completely on top of that your idea isn't even logical.
Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
Second part is in OnPlayerText() or could be a dialog input it doesn't really matter how you get the value you just need to know you have to process that value and do a few checks, heck you could even skip most of the steps I gave and just use IsPlayerInRangeOfPoint() but that would more CPU overall but very marginal.