01.12.2012, 19:38
(
Последний раз редактировалось JustinAn; 01.12.2012 в 20:51.
)
Hey guys, so I've a problem on GMXing my server.
So I made the command:
EDIT: Also, it spawns me into Blue Berry and spawns me under ground 2m down I guess? And then it kills me and then yeah, spawns me back onto the ground BUT still on Blue Berry?
Forwarded the timer.
Forwarded the other timer:
And here's my SaveAccountInfo
But somehow, IT SAVES the STATS perfectly, working good when the Player Disconnects using /q or ESC all that. But somehow not the GMX command.
I used the same function as in OnPlayerDisconnect? SaveAccountInfo(playerid);
I'd like a possible and working solution, thanks!
So I made the command:
EDIT: Also, it spawns me into Blue Berry and spawns me under ground 2m down I guess? And then it kills me and then yeah, spawns me back onto the ground BUT still on Blue Berry?
pawn Код:
CMD:gmx(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1337 || IsPlayerAdmin(playerid))
{
SetTimer("GameModeInitExitFunc", 29000, 0);
SendClientMessageToAll(COLOR_LIGHTRED, "SERVER: A GMX has been intiaited by a admin, the GMX will occur in 30 seconds!");
SendClientMessageToAll(COLOR_GRAD2, " You have been frozen by the GMX system !");
foreach(Player, i)
{
GMX[i] = 1;
TogglePlayerControllable(i, 0);
SaveAccountInfo(i);
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
return 1;
}
pawn Код:
forward GameModeInitExitFunc();
public GameModeInitExitFunc()
{
new string[128];
format(string, sizeof(string), "Server Restarting...");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
DisablePlayerCheckpoint(i);
GameTextForPlayer(i, string, 4000, 5);
SetPlayerInterior(i, 0);
SetPlayerVirtualWorld(i, 0);
SetPlayerCameraPos(i,1460.0, -1324.0, 287.2);
SetPlayerCameraLookAt(i,1374.5, -1291.1, 239.0);
gPlayerLogged[i] = 0;
}
}
SetTimer("GameModeExitFunc", 4000, 0);
return 1;
}
pawn Код:
forward GameModeExitFunc();
public GameModeExitFunc()
{
GameModeExit();
}
pawn Код:
forward SaveAccountInfo(playerid);
public SaveAccountInfo(playerid)
{
new INI:File = INI_Open(UserPath(playerid));
new Float:X, Float:Y, Float:Z;
new Float:facingangle;
new Float:health, Float:armour;
new skin = GetPlayerSkin(playerid);
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armour);
GetPlayerFacingAngle(playerid, facingangle);
GetPlayerPos(playerid, X, Y, Z);
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Level",GetPlayerScore(playerid));
INI_WriteInt(File,"Int",GetPlayerInterior(playerid));
INI_WriteInt(File,"Skin",skin);
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Number",PlayerInfo[playerid][pNumber]);
INI_WriteInt(File,"ADMute",PlayerInfo[playerid][pADMute]);
INI_WriteInt(File,"BankAccount",PlayerInfo[playerid][pBankAccount]);
INI_WriteInt(File,"Accountdata",PlayerInfo[playerid][pAccountdata]);
INI_WriteInt(File,"SecKey",PlayerInfo[playerid][pSecKey]);
INI_WriteInt(File,"Helper",PlayerInfo[playerid][pHelper]);
INI_WriteInt(File,"Stealthed",PlayerInfo[playerid][pStealthed]);
INI_WriteInt(File,"DonateRank",PlayerInfo[playerid][pDonateRank]);
INI_WriteInt(File,"NewbieMuted",PlayerInfo[playerid][pNewbieMuted]);
INI_WriteFloat(File, "FacingAngle", facingangle);
INI_WriteFloat(File, "Health", health);
INI_WriteFloat(File, "Armour", armour);
INI_WriteFloat(File, "LastX", X);
INI_WriteFloat(File, "LastY", Y);
INI_WriteFloat(File, "LastZ", Z);
INI_Close(File);
return 1;
}
I used the same function as in OnPlayerDisconnect? SaveAccountInfo(playerid);
I'd like a possible and working solution, thanks!