Entry Key
#2

About the "ping-ponging" effect, you have to know two new coordinates, per side (in/out) one for the pickup and one for the teleport positioning.

For the keyboard you can use this as example:
pawn Код:
#include <a_samp> //default include
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) //define pressed keys
   
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_SECONDARY_ATTACK)) //if you pressed enter (according to the SA-MP wiki this is KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid,5,x,y,z)) //playerid,range (5 for a small area),x,y,z position OF PICKUP!
        {
            //teleport the player here
        } else if (IsPlayerInRangeOfPoint(playerid,5,x,y,z))
        {
            //another teleport
        } //etc
    }
    return 0;
}
I hope this was usefull to you ^^
Reply


Messages In This Thread
Entry Key - by Skidmarks - 27.05.2011, 14:00
Re: Entry Key - by gamer931215 - 27.05.2011, 15:17

Forum Jump:


Users browsing this thread: 1 Guest(s)