i need a /s and /l - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: i need a /s and /l (
/showthread.php?tid=253624)
i need a /s and /l -
[EDT]AmanSingh123 - 07.05.2011
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?
Re: i need a /s and /l -
Lorenc_ - 07.05.2011
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.