SA-MP Forums Archive
Save position - 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)
+--- Thread: Save position (/showthread.php?tid=100005)



Save position - Matevos - 02.10.2009

Hi, I'm new user in this forum. I'm from Polish so my english is bad


My question is: "How to make in my server command "Save position" and "Load position" player.
This is must be script.

Please make for me this command because I do not know language "pawn"
I know only C++ and Visual Basic.




Re: Save position - DSK_Vyorel - 02.10.2009

Код:
enum SavePosENUM { Float:sX, Float:sY, Float:sZ, Float:sA, SavedPos };
new SavePos[MAX_PLAYERS][SavePosENUM];
Код:
if(!strcmp(cmdtext, "/spos",true) || !strcmp(cmdtext,"/sp",true))
  {
		if (IsPlayerInAnyVehicle(playerid))
		{
      GetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
      GetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][sA]);
		}
		else
		{
      GetPlayerPos(playerid, SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
      GetPlayerFacingAngle(playerid, SavePos[playerid][sA]);
		}
		SavePos[playerid][SavedPos] = 1;
    return SendClientMessage(playerid, COLOR_WHITE,"Pozitie salvata, foloseste /lp pentru a reveni inapoi.");
  }
//------------------------------------------------------------------------------
  if(!strcmp(cmdtext, "/lp",true) || !strcmp(cmdtext,"/lpos",true))
  {
    SetCameraBehindPlayer(playerid);
    if (SavePos[playerid][SavedPos] == 0) return SendClientMessage(playerid, COLOR_WHITE, "[SERVERBOT]> Foloseste /sp");
    if (IsPlayerInAnyVehicle(playerid))
		{
      SetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
      SetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][sA]);
		}
		else
		{
      SetPlayerPos(playerid, SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
      SetPlayerFacingAngle(playerid, SavePos[playerid][sA]);
		}
    return SendClientMessage(playerid, COLOR_WHITE, "Ai revenit la ultima pozitie salvata");
  }



Re: Save position - Matevos - 02.10.2009

Where I must paste this first code and where I must paste this second code??


Re: Save position - Correlli - 02.10.2009

Quote:
Originally Posted by Matevos
My question is: "How to make in my server command "Save position" and "Load position" player.
This is must be script.
Try to look for DINI/DUDB topic and tutorial how to save player's position with DINI/DUDB, it's on this forum, just try to search a little.


Re: Save position - Matevos - 02.10.2009

I can't find this.

Please say my where I must this paste.

Or send me link with this.


Re: Save position - Correlli - 02.10.2009

http://forum.sa-mp.com/index.php?topic=4798.0
http://forum.sa-mp.com/index.php?top...59458#msg59458
If that's what you're looking for.


Re: Save position - Pawno_Master - 02.10.2009

uhh you can automatticly save something already?

just use /save [your text here] and it will just save in server or debug you dont need a cmd for that


Re: Save position - Matevos - 02.10.2009

When I compile code I have this Error:
Код:
C:\Użytkownicy\Mateusz\Pulpit\Multiplayer Server\gamemodes\freeroam.pwn(15) : fatal error 100: cannot read from file: "dini"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Save position - Correlli - 02.10.2009

You need to put dini.inc into "\pawno\include\" folder.


Re: Save position - Madsen - 12.04.2011

Quote:
Originally Posted by DSK_Vyorel
Посмотреть сообщение
Код:
enum SavePosENUM { Float:sX, Float:sY, Float:sZ, Float:sA, SavedPos };
new SavePos[MAX_PLAYERS][SavePosENUM];
Код:
if(!strcmp(cmdtext, "/spos",true) || !strcmp(cmdtext,"/sp",true))
  {
		if (IsPlayerInAnyVehicle(playerid))
		{
      GetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
      GetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][sA]);
		}
		else
		{
      GetPlayerPos(playerid, SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
      GetPlayerFacingAngle(playerid, SavePos[playerid][sA]);
		}
		SavePos[playerid][SavedPos] = 1;
    return SendClientMessage(playerid, COLOR_WHITE,"Pozitie salvata, foloseste /lp pentru a reveni inapoi.");
  }
//------------------------------------------------------------------------------
  if(!strcmp(cmdtext, "/lp",true) || !strcmp(cmdtext,"/lpos",true))
  {
    SetCameraBehindPlayer(playerid);
    if (SavePos[playerid][SavedPos] == 0) return SendClientMessage(playerid, COLOR_WHITE, "[SERVERBOT]> Foloseste /sp");
    if (IsPlayerInAnyVehicle(playerid))
		{
      SetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
      SetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][sA]);
		}
		else
		{
      SetPlayerPos(playerid, SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
      SetPlayerFacingAngle(playerid, SavePos[playerid][sA]);
		}
    return SendClientMessage(playerid, COLOR_WHITE, "Ai revenit la ultima pozitie salvata");
  }
omg ty !!!