Help with OnPlayerKeyStateChange
#1

Hey guys,

Basically I am trying to detect if someone is activating some particular hacks. I know some troll hacks and their activation keys and I want to take advantage of OnPlayerKeyStateChange function to tell me if someone is holding those 2 keys together.

Here is my script:
Quote:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new Keys,ud,lr;
new name[24];
new string[100];
if(Keys == KEY_ACTION && KEY_SUBMISSION)
{
GetPlayerKeys(playerid,Keys,ud,lr);
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"Warning :- %s is suspected to be using car troll hacks.",string);
MessageToAdmins(red,string);
}
return 1;
}

This was supposed to detect if someone is HOLDING CTRL + 2 but it is not detecting it.

I kindly request to the scripters here to take out some time to help me fix this script.

Thank you very much in advance
Reply


Messages In This Thread
Help with OnPlayerKeyStateChange - by Merciful - 13.12.2016, 04:38
Re: Help with OnPlayerKeyStateChange - by X337 - 13.12.2016, 05:20
Re: Help with OnPlayerKeyStateChange - by Merciful - 13.12.2016, 09:15

Forum Jump:


Users browsing this thread: 2 Guest(s)