Save position
#1

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.

Reply
#2

Код:
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");
  }
Reply
#3

Where I must paste this first code and where I must paste this second code??
Reply
#4

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.
Reply
#5

I can't find this.

Please say my where I must this paste.

Or send me link with this.
Reply
#6

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.
Reply
#7

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
Reply
#8

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.
Reply
#9

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

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 !!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)