Function - after using a command writting something - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Function - after using a command writting something (
/showthread.php?tid=410108)
Function - after using a command writting something -
maiky1499 - 24.01.2013
Hi,
I need help, with a function or something to do this;
After player using a command like /help he will have two options; teleport/commands.
But I want him to write them like a regular text: [CHAT]/help >> [CHAT]Teleports.
How to do that? and I want disable from doing any other texts or commands. After /help only teleport/commands.
Please, someone.
Re: Function - after using a command writting something -
denNorske - 24.01.2013
Do you mean like this:
I type: /help Commands
Or: /help teleports
Or do you mean that you type the command: /help and then after you pressed enter, you type commands ?
Please explain more so we can help you
Re: Function - after using a command writting something -
maiky1499 - 24.01.2013
Yea after you typed /help and pressed enter you will be able to use only TWO commands, help & teleports, nothing else until you will use them, after using them you're free.
Re: Function - after using a command writting something -
maiky1499 - 25.01.2013
Anyone?
Re: Function - after using a command writting something -
denNorske - 25.01.2013
Why can't you just simply put it in one command only? It makes the coding better.
But, alright..
put "new command = 0" on top of your script.
Under the command you use, you must set a variable to a value like 1 (for example "command=1;")
Then, under "OnPlayerText" you must check if that variable still is 0 or if it is 1. Then, you can use strcmp to check if the entered chat text is "teleport" or "Commands". Then, let the code do what you want.
Hope you understood.
Airplanesimen
Re: Function - after using a command writting something -
maiky1499 - 25.01.2013
Works thanks