Assign key to CMD
#1

Hello guys, i need to assign a key to a cmd, could someone help me?? (need code)
Reply
#2

what do you exactly mean?
by pressing KEY, command must be called or..?

if yes, than you must write code in OnPlayerKeyStateChange if(newkeys == yourkey) than you must call function (depending on your commands system, for examle zcmd: cmd_command(playerid,"");)
Reply
#3

Quote:
Originally Posted by Mugala
Посмотреть сообщение
what do you exactly mean?
by pressing KEY, command must be called or..?

if yes, than you must write code in OnPlayerKeyStateChange if(newkeys == yourkey) than you must call function (depending on your commands system, for examle zcmd: cmd_command(playerid,"");)
I'm looking for the CMD to be activated by pressing "enter", What would the code be? (im using zcmd)
Reply
#4

which command processor u're using?
Reply
#5

Quote:
Originally Posted by Mugala
Посмотреть сообщение
which command processor u're using?
Zcmd in pawn
Reply
#6

than, you can use this.
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys == 16// 16 = enter
    
{
        
cmd_commandname(playerid,"");
    }
    return 
1;

Reply
#7

Quote:
Originally Posted by Mugala
Посмотреть сообщение
than, you can use this.
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys == 16// 16 = enter
    
{
        
cmd_commandname(playerid,"");
    }
    return 
1;

Very thx friend
Reply
#8

I need the value of the "G" key by default, do u can help me?
Reply
#9

G key is not usable in SA:MP.
here is a list of keys - https://sampwiki.blast.hk/wiki/Keys
Reply
#10

Quote:
Originally Posted by Mugala
Посмотреть сообщение
G key is not usable in SA:MP.
here is a list of keys - https://sampwiki.blast.hk/wiki/Keys
there is no way to use "G" ??
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)