PDA

View Full Version : Key to commands ??


xganyx
23/06/2013, 08:57 AM
Press N
For My Weapon command
How Can I Do that ?
:confused:

DobbysGamertag
23/06/2013, 08:59 AM
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

xganyx
23/06/2013, 09:12 AM
Can You Explain more for me

Lordzy
23/06/2013, 09:20 AM
http://wiki.sa-mp.com/wiki/OnPlayerKeyStateChange


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_NO) //Normal no response is of key "N".
{
//Stuffs here.
}
return 1;
}


I suggest you to read the wiki of OnPlayerKeyState first.

DobbysGamertag
23/06/2013, 09:20 AM
Do you have a weapon command already? :) i can make you an example giving a weapon if you like?

Anak
23/06/2013, 09:46 AM
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_NO) //No key
{
// do something here !
// example:
SendClientMessage(playerid, -1," noob!!!");//.....
//etc
}
return 1;
}

xganyx
23/06/2013, 10:50 AM
Thanks All.
DobbysGamertag: I Ready Have A weapon command but thank you.