21.05.2011, 12:40
pawn Code:
/*
*
*
* Lorenc's INC's
* This is a last pos finder/setter include that
* gets your last position set, and you can set the
* player to that position.
*
* Useful for race scripts.
* Credits: Lorenc!
*
* VERSION 1 (beta)
*/
#if defined _lastpos_included
#endinput
#endif
#define _lastpos_included
#include <a_samp>
enum PLAYERDATA
{
Float: E_LAST_X,
Float: E_LAST_Y,
Float: E_LAST_Z
}
new gPlayerData[MAX_PLAYERS][PLAYERDATA];
/*
native GetPlayerLastPos(playerid, Float:pX, Float:pY, Float:pZ);
native SetPlayerLastPos(playerid);
*/
stock GetPlayerLastPos(playerid)
{
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
gPlayerData[playerid][E_LAST_X] = pX;
gPlayerData[playerid][E_LAST_Y] = pY;
gPlayerData[playerid][E_LAST_Z] = pZ;
}
stock SetPlayerLastPos(playerid)
{
SetPlayerPos(playerid,gPlayerData[playerid][E_LAST_X],gPlayerData[playerid][E_LAST_Y], gPlayerData[playerid][E_LAST_Z]);
}

