need a savepos and loadpos FS
#1

could some one care to make a /s and /l for me?

like when you do /s it saves pos and then /l to load it but even if your in a vehicle and you do /s and then /l it loads the saved pos with your vehicle because iv seen many save pos FS and when you save and load a pos in a vehicle your vehicle goes :/

so could someone please make a FS for /s and /l

thanks
Reply
#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
#3

i want a filterscript lol that has /s and /l cmds
Reply
#4

pawn Code:
CMD:l(playerid, params[])
return GetLastPos(playerid);

CMD:s(playerid, params[])
return SetLastPos(playerid);
Simple?
Reply
#5

pawn Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

enum PLAYERDATA
{
    Float: E_LAST_X,
    Float: E_LAST_Y,
    Float: E_LAST_Z,
   
    bool:  E_SET,
}
new gPlayerData[MAX_PLAYERS][PLAYERDATA];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

CMD:last(playerid, params[])
{
    if(gPlayerData[playerid][E_SET] == true)
    {
        SetPlayerLastPos(playerid);
    } else return SendClientMessage(playerid, 0xFFFFFFFF, "Not set!");
    return 1;
}

CMD:savepos(playerid, params[])
{
    GetPlayerLastPos(playerid);
    SendClientMessage(playerid, 0xFFFFFFFF, "Position set! Use /last to go to that pos!");
    gPlayerData[playerid][E_SET] = true;
    return 1;
}

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]);
}
Bother to not learn anything and have a filterscript here you go. Next time request it on the threads.
Reply
#6

Ok hears mine I made this
Features include
--if player enter /l in a car it will tele port with cars
--it save a file in you scripting files folder so that way when you quit and relog you can type in /l and be in last place
///////////////////////////////////////////////////////
If you Want To Compile make sure you have the right plugins
--dini--
--dudb--
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)