Saving position bug.
#1

Hi guys..

I have a save position script, but it is kinda buggy. When I am in a vehicle, and I use /s, the angle is EXACTLY the same as when I entered the vehicle, but I want it the angle that it is NOW. And when I save on-foot it all goes fine.

Code:

Код:
  if (strcmp(cmdtext, "/s", true)==0)
  {
    GetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
    GetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
    GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
    GetPlayerFacingAngle(playerid, PosA[playerid]);
		SendClientMessage(playerid, COLOR_GREEN, "== Position saved! Go to this position with /l.");
    PosI[playerid] = (GetPlayerInterior(playerid));
		return 1;
  }

  if (strcmp(cmdtext, "/l", true)==0)
  {
    if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
    {
      return SendClientMessage(playerid, COLOR_RED, "== Use /s first!");
		}
		else
		{
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
	      SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid] +3);
	      SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
	    }
	    else
	    {
				InCar[playerid] = false;
		    SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
		    SetPlayerFacingAngle(playerid, PosA[playerid]);
				SetCameraBehindPlayer(playerid);
			}
			SetPlayerInterior(playerid, PosI[playerid]);
			SendClientMessage(playerid, COLOR_GREEN, "== Position loaded.");
		}
		return 1;
  }
How to save angle ;o?
Reply
#2

Noob way: Park the vehicle like how you want it to be saved.Exit and then re-enter and save the position :P

I don't know about the smarter way :P
Reply
#3

Quote:
Originally Posted by DJDhan
Noob way: Park the vehicle like how you want it to be saved.Exit and then re-enter and save the position :P

I don't know about the smarter way :P
I needa smarter way, without re-entering :").
Reply
#4

Why not just use the built in /save command?
Reply
#5

Quote:
Originally Posted by ruckfules99
Why not just use the built in /save command?
What? o_O
Reply
#6

Quote:
Originally Posted by ruckfules99
Why not just use the built in /save command?
Oh yeah that's right!
Enter the samp debug mode and use /save command to save the exact psoition you are in at the moment you type it.
Reply
#7

Quote:
Originally Posted by DJDhan
Quote:
Originally Posted by ruckfules99
Why not just use the built in /save command?
Oh yeah that's right!
Enter the samp debug mode and use /save command to save the exact psoition you are in at the moment you type it.
But I mean, I don't want to know the location XYZ, but I just want to use /s and /l.

(I have stunt server, so ye.. :>)

EDIT:

Or does that /save thing the same? Saving location, and loading it when you want? :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)