OnPlayerKeyStateChange QUICK HELP
#1

pawn Код:
if(newkeys == KEY_HORN) //Its not suppose to say horn. what do I put here for the button H
    {
        new
            Float:x,
            Float:y,
            Float:z;
        GetPlayerPos(playerid, x, y, z);
        SetPlayerPos(playerid, x, y, z + 10.0);
    }
  if(newkeys == KEY_NITRO) //Nitro Doesnt exist What key would it say for Alt
    {
      if(IsPlayerInAnyVehicle(playerid))
        {
        new Float:s[3];
          GetVehicleVelocity(GetPlayerVehicleID(playerid),s[0],s[1],s[2]);
          s[0]=1.5*s[0];
          s[1]=1.5*s[1];
          s[2]=1.5*s[2];
          SetVehicleVelocity(GetPlayerVehicleID(playerid),s[0],s[1],s[2]);
        }
        return 1;
    }
Reply
#2

I know that the nitro button is defined as KEY_FIRE, I don't recall with the horn button is defined as, if it even is.
Reply
#3

The horn key is KEY_CROUCH
KEY_FIRE for ALT.
Reply
#4

can anyone tell me why the speed thing is only working 1/2 of the time? whats wrong with my code?
Reply
#5

Probably because your code ignore keys combinations.
Reply
#6

Quote:
Originally Posted by 0rb
Probably because your code ignore keys combinations.
what do you suggest I change.

- Also the Jumping one moves your player up but doesnt bring your car with you. its basically a giant slap.
Reply
#7

Quote:
Originally Posted by [SU
BP13 ]
Quote:
Originally Posted by 0rb
Probably because your code ignore keys combinations.
what do you suggest I change.

- Also the Jumping one moves your player up but doesnt bring your car with you. its basically a giant slap.
That's because your using SetPlayerPos, use SetVehiclePos.. seriously use the wiki before posting, you need the least bit of knowledge for us to help you.
Reply
#8

Quote:
Originally Posted by |№іі7
Quote:
Originally Posted by [SU
BP13 ]
Quote:
Originally Posted by 0rb
Probably because your code ignore keys combinations.
what do you suggest I change.

- Also the Jumping one moves your player up but doesnt bring your car with you. its basically a giant slap.
That's because your using SetPlayerPos, use SetVehiclePos.. seriously use the wiki before posting, you need the least bit of knowledge for us to help you.
I took these examples from wiki, so don't say I didn't check wiki.

I guess you don't know how to deal with this either cause I did what you did and now it does nothing at all.
Reply
#9

SetVehiclePos(GetPlayerVehicleID(playerid),...);

Use it like that.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)