Key -
EmpireSk - 12.01.2018
I have Problem, press H (2) so nothing happens
if(PlayerInfo[playerid][Job] == 5)..? Army Job
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerConnected(playerid))
{
if(newkeys == 2)
{
if(PlayerInfo[playerid][Job] == 5)
{
if(IsPlayerInRangeOfPoint(playerid,30,2209.7000000,-2662.8000000,0.2900000))
{
if(Objekty[0] == 0)
{
MoveObject(Cela[0], 2209.7000000,-2662.8000000,0.2900000, 2.0);
Objekty[0] = 1;
}else{
MoveObject(Cela[0], 2209.7000000,-2662.8000000,14.2900000, 2.0);
Objekty[0] = 0;
}
}
}
}
}
return 1;
}
Re: Key -
jasperschellekens - 12.01.2018
Newkeys Dont work like that..
https://sampwiki.blast.hk/wiki/Keys
Re: Key -
Sew_Sumi - 12.01.2018
That's not how you use OnPlayerKeyStateChange...
Check the wiki, and read "How NOT to use" and it will show your current usage.
https://sampwiki.blast.hk/wiki/OnPlayerK...heck_for_a_key
If you are on foot, it won't be H, if you are using "2"... It will be C.
https://sampwiki.blast.hk/wiki/Keys
Re: Key -
EmpireSk - 12.01.2018
I tried it like this but it does not work..
PHP код:
if ((oldkeys & KEY_CTRL_BACK) && !(newkeys & KEY_CTRL_BACK))
Re: Key -
RogueDrifter - 12.01.2018
its KEY_SUBMISSION
Re: Key -
Sew_Sumi - 12.01.2018
Quote:
Originally Posted by EmpireSk
I tried it like this but it does not work..
|
Did you even try with your old code just pressing C if you are on foot?
Re: Key -
EmpireSk - 12.01.2018
Quote:
Originally Posted by RogueDrifter
its KEY_SUBMISSION
|
hmm ok
But when I want to work from H / Caps Lock...?
Re: Key -
RogueDrifter - 12.01.2018
Quote:
Originally Posted by EmpireSk
hmm ok
But when I want to work from H / Caps Lock...?
|
H is KEY_CROUCH
Re: Key -
EmpireSk - 12.01.2018
Quote:
Originally Posted by RogueDrifter
H is KEY_CROUCH
|
Yes KEY_CROUCH <=> 2 .....
When I arrive at the gate and I enter H/caps lock so I should open the gate Well but will not open
Re: Key -
Sew_Sumi - 12.01.2018
Use, another, key, to, check, the, code, is, actually, friggen, working, ffs...
If this is a filterscript, then check your gamemode is returning 1, on the same callback.