SA-MP Forums Archive
Assign key to CMD - 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: Assign key to CMD (/showthread.php?tid=652211)



Assign key to CMD - bookknp - 05.04.2018

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


Re: Assign key to CMD - Mugala - 06.04.2018

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,"");)


Re: Assign key to CMD - bookknp - 06.04.2018

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)


Re: Assign key to CMD - Mugala - 06.04.2018

which command processor u're using?


Re: Assign key to CMD - bookknp - 06.04.2018

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


Re: Assign key to CMD - Mugala - 06.04.2018

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




Re: Assign key to CMD - bookknp - 06.04.2018

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


Re: Assign key to CMD - bookknp - 06.04.2018

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


Re: Assign key to CMD - Mugala - 06.04.2018

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


Re: Assign key to CMD - bookknp - 06.04.2018

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" ??