#1

I have Problem, press H (2) so nothing happens
if(PlayerInfo[playerid][Job] == 5)..? Army Job

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    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.29000002.0);
                        
Objekty[0] = 1;
                        }else{
                        
MoveObject(Cela[0], 2209.7000000,-2662.8000000,14.29000002.0);
                        
Objekty[0] = 0;
                    }
                }
            }
        }
    }
    return 
1;

Reply
#2

Newkeys Dont work like that.. https://sampwiki.blast.hk/wiki/Keys
Reply
#3

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
Reply
#4

I tried it like this but it does not work..

PHP код:
if ((oldkeys KEY_CTRL_BACK) && !(newkeys KEY_CTRL_BACK)) 
Reply
#5

its KEY_SUBMISSION
Reply
#6

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?
Reply
#7

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
its KEY_SUBMISSION
hmm ok
But when I want to work from H / Caps Lock...?
Reply
#8

Quote:
Originally Posted by EmpireSk
Посмотреть сообщение
hmm ok
But when I want to work from H / Caps Lock...?
H is KEY_CROUCH
Reply
#9

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
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)