06.06.2013, 12:11
Using the /gmx is doesn't save the user files. I checked with print on the Save function. It shows the msg but it doesn't save.
GMX CMD:
GMX public
SaveAccounts is a loop for SaveAccountStats(playerid)
And here the /o
It shows the usage. But after filling something it shutdowns the server.exe without any messages on the server.log
GMX CMD:
pawn Код:
CMD:gmx(playerid, params[])
{
new string[128];
if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not authorized to use this command!");
format(string, sizeof(string), "AdmCmd: %s has announced a GMX, Server will restart in a few seconds.", RPName(playerid));
SendClientMessageToAll(COLOR_TOMATO, string);
SaveFactions();
SaveAccounts();
SetTimer("GMX", 20000, false);
return 1;
}
pawn Код:
forward GMX();
public GMX()
{
SendRconCommand("gmx");
}
pawn Код:
function SaveAccountStats(playerid)
{
if(Logged[playerid] == 1)
{
new
INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
new
Float:x,
Float:y,
Float:z
;
GetPlayerPos(playerid,x,y,z);
PlayerInfo[playerid][pPos_x] = x;
PlayerInfo[playerid][pPos_y] = y;
PlayerInfo[playerid][pPos_z] = z;
INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Sex",PlayerInfo[playerid][pSex]);
INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
INI_WriteFloat(File,"Pos_x",PlayerInfo[playerid][pPos_x]);
INI_WriteFloat(File,"Pos_y",PlayerInfo[playerid][pPos_y]);
INI_WriteFloat(File,"Pos_z",PlayerInfo[playerid][pPos_z]);
INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
INI_WriteInt(File,"Member",PlayerInfo[playerid][pMember]);
INI_WriteInt(File,"Cookie",PlayerInfo[playerid][pCookie]);
INI_WriteInt(File,"Accent",PlayerInfo[playerid][pAccent]);
INI_WriteInt(File,"Leader",PlayerInfo[playerid][pLeader]);
INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
INI_WriteInt(File,"Division",PlayerInfo[playerid][pDiv]);
INI_WriteInt(File,"DivLeader",PlayerInfo[playerid][pDivLeader]);
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBan]);
INI_Close(File);
}
return 1;
}
And here the /o
pawn Код:
CMD:ooc(playerid, params[])
{
new string[128],rank[20];
if((noooc) && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: OOC Chat is disabled!");
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: (/o)oc [ooc chat]");
switch(PlayerInfo[playerid][pAdmin])
{
case 0: rank = "Player";
case 1: rank = "Server MOD";
case 2: rank = "Junior Admin";
case 3: rank = "General Admin";
case 4: rank = "Senior Admin";
case 5: rank = "Head Admin";
case 6: rank = "Server Manager";
case 1337: rank = "Server Owner";
default: rank = "Player";
}
format(string, sizeof(string), "((%s %s: %s ))", rank, RPName(playerid), params);
OOCOff(0xCCFFFF00, string);
OOCLog(string);
printf("%s: %s", RPName(playerid),string);
return 1;
}
pawn Код:
function OOCOff(color,const string[])
{
foreach (Player,i)
{
if(!gOoc{i})
{
SendClientMessage(i, color, string);
}
}
}