i need a /s and /l
#1

hey im a new scripter and i need help in making /s (savepos) and /l (loadpos)

and when im in a vehicle and do /s and then do /l it should tele me to the saved pos in the vehicle.. could anyone make a command like that for me?
Reply
#2

pawn Код:
/*
    *
    *
    *                  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]);
}
I made an include a fair time ago. Use the functions given, make sure you make a new inc and paste it there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)