Send a command by pressing a key
#1

Hello to all! I wanted to know how could I do to run the command "/enter" when you press ENTER! How can I do? Thank you.
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

Keys: https://sampwiki.blast.hk/wiki/Keys

If you use ZCMD, check if he press ENTER and do:

return cmd_enter(playerid, "");
Reply
#3

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

Keys: https://sampwiki.blast.hk/wiki/Keys

If you use ZCMD, check if he press ENTER and do:

return cmd_enter(playerid, "");
I use this type of commands:
pawn Код:
if(strcmp(cmd, "/enter", true) == 0) // Trasforma in INVIO
    {
What can I do?
I know how to use the Keys, the problem's the command
Reply
#4

Switch to ZCMD. (Consider it.)

Ok, you can do a function where move enter code, or do: OnPlayerCommandText(playerid, "/enter");
Reply
#5

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
Switch to ZCMD. (Consider it.)

Ok, you can do a function where move enter code, or do: OnPlayerCommandText(playerid, "/enter");
Thank you very much. I will switch to ZCMD...
Rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)