need a savepos and loadpos FS
#2

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]);
}
An Include i made, just use the functions below
Reply


Messages In This Thread
need a savepos and loadpos FS - by [EDT]AmanSingh123 - 21.05.2011, 12:35
Re: need a savepos and loadpos FS - by Lorenc_ - 21.05.2011, 12:40
Re: need a savepos and loadpos FS - by [EDT]AmanSingh123 - 21.05.2011, 12:55
Re: need a savepos and loadpos FS - by Lorenc_ - 21.05.2011, 12:57
Re: need a savepos and loadpos FS - by Lorenc_ - 21.05.2011, 13:04
Re: need a savepos and loadpos FS - by copman87 - 04.10.2012, 21:28

Forum Jump:


Users browsing this thread: