have trouble with /s (save pos) and /l (load pos)
#1

okay bassicly when im in a vehicle and do /s to save my pos and then do /l to load that pos i just saved i dont teleport their with my vehicle i just tele their on foot without my vehicle, and i dont know how to fix it :S heres my FS script..

#include <a_samp>

#define SUCCESS 0xFFFF00AA
#define UNSUCCESS 0xAA3333AA
#define SCM SendClientMessage

new Pozicija[MAX_PLAYERS];

public OnFilterScriptInit()
{
print("|| Pozicija Sistem by Matt Loaded ||");
return true;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/s", cmdtext, true))
{

new Floatpoz,Float:ypoz,Float:zpoz;
GetPlayerPos(playerid,xpoz,ypoz,zpoz);
GetVehiclePos(playerid,xpoz,ypoz,zpoz);
SetPVarFloat(playerid,"XPos",xpoz); SetPVarFloat(playerid,"YPos",ypoz); SetPVarFloat(playerid,"ZPos",zpoz);
SCM(playerid, SUCCESS, "You have saved your position, now type /l to go back their");
if(Pozicija[playerid] == 0)
{
Pozicija[playerid] = 1;
}
return true;
}
if(!strcmp("/l", cmdtext, true))
{
if(Pozicija[playerid] == 1)
{
SetPlayerPos(playerid, GetPVarFloat(playerid,"XPos"), GetPVarFloat(playerid,"YPos"), GetPVarFloat(playerid,"ZPos"));
SetVehiclePos(playerid, GetPVarFloat(playerid,"XPos"), GetPVarFloat(playerid,"YPos"), GetPVarFloat(playerid,"ZPos"));
SCM(playerid, SUCCESS, "You have teleported to your last saved position.");
}
else SCM(playerid, UNSUCCESS, "You didn't save your position! Please type /s again.");
return true;
}
return false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)