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