27.05.2011, 15:17
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:
I hope this was usefull to you ^^
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;
}