[HELP] PlayerToPoint with HOTKEY is not working.. :/
#1

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_ACTION)
    {
        if (PlayerToPoint(1, playerid, -2038.6663,-87.8214,35.3203))
        {
        SetPlayerPos(playerid, -2038.6670,-87.1617,35.4203);
        return 1;
        }
        }
    return 1;
    }
The coord's are right, every thing is right, but when i enter the game, and press the key and it is " ENTER " or " F " it doesnt work.. does anybody know how to make it work? :/
Reply
#2

Why noone is answering is it so hard? just let me know..
Reply
#3

The distance in PlayerToPoint of 1 is right on the point. Make sure, 100% that you are right on the spot.
Reply
#4

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
    if(newkeys == KEY_ACTION && PlayerToPoint(1, playerid, -2038.6663,-87.8214,35.3203)) {
            SetPlayerPos(playerid, -2038.6670,-87.1617,35.4203);
            return 1;
        }
    }
    return 1;
}
David
Reply
#5

And if i want to make another one with the same hotkey and different coord how can i do it?
Reply
#6

David yours does the same exact thing as his does already.

Moustafa: Use the code you origionally had, just put differnet coords, like the following:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(newkeys & KEY_ACTION)
  {
   if (PlayerToPoint(1, playerid, -2038.6663,-87.8214,35.3203))
   {
     SetPlayerPos(playerid, -2038.6670,-87.1617,35.4203);
     return 1;
   }
   else if(PlayerToPoint(1, playerid, x, y, z))
   {
     // stuff here
   }
  }
  return 1;
}
Reply
#7

Quote:
Originally Posted by David.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
    if(newkeys == KEY_ACTION && PlayerToPoint(1, playerid, -2038.6663,-87.8214,35.3203)) {
            SetPlayerPos(playerid, -2038.6670,-87.1617,35.4203);
            return 1;
        }
    }
    return 1;
}
David
That will only work if the player is only pressing 1 key.
Reply
#8

Quote:
Originally Posted by Moustafa
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_ACTION)
    {
        if (PlayerToPoint(1, playerid, -2038.6663,-87.8214,35.3203))
        {
        SetPlayerPos(playerid, -2038.6670,-87.1617,35.4203);
        return 1;
        }
        }
    return 1;
    }
The coord's are right, every thing is right, but when i enter the game, and press the key and it is " ENTER " or " F " it doesnt work.. does anybody know how to make it work? :/
-,-''
Enter or F is not the Action key!
TAB is the Action Key
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)