Quote:
Originally Posted by [HK]Ryder[AN]
Where it saves the INI..probably OnPlayerDisconnect
and also where it creates the INI..most probably OnPlayerConnect
|
No it creates it using a cmd however
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
// - - General Stuff - - //
aDuty[playerid] = 0;
new pName[MAX_PLAYER_NAME], Str[64];
GetPlayerName(playerid, pName, sizeof(pName));
// - - Leaving Message - - //
switch(reason)
{
case 0: format(Str, sizeof(Str), "{FF8000}>{C0C0C0} %s Has Left The Server {FF0000}(Timeout)", pName);
case 1: format(Str, sizeof(Str), "{FF8000}>{C0C0C0} %s Has Left The Server {FF0000}(Leaving)", pName);
}
SendClientMessageToAll(-1, Str);
// - - Saving Stats - - //
if(fexist(UserPath(playerid)))
{
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File, "Adminlevel", pInfo[playerid][Adminlevel]);
INI_WriteInt(File, "Money", GetPlayerMoney(playerid));
INI_WriteInt(File, "Scores", GetPlayerScore(playerid));
INI_WriteInt(File, "Kills", pInfo[playerid][Kills]);
INI_WriteInt(File, "Banned", pInfo[playerid][Banned]);
INI_WriteInt(File, "Hours", pInfo[playerid][pPlayingTime]);
INI_WriteInt(File, "Deaths", pInfo[playerid][Deaths]);
INI_Close(File);
return 1;
}
return 1;
}
And the register command /register [password]
pawn Код:
CMD:register(playerid, params[])
{
if(fexist(UserPath(playerid))) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {FFFFFF}You Are Already Registered");
if(isnull(params)) return SendClientMessage(playerid, -1, "{FF8000}USAGE: {FFFFFF}/register [password]");
new pName[MAX_PLAYER_NAME], HashPass[129];
GetPlayerName(playerid, pName, sizeof(pName));
WP_Hash(HashPass, sizeof(HashPass), params);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File, "Destiny Gang Wars Player Information");
INI_WriteString(File, "Password", HashPass);
INI_WriteInt(File, "AdminLevel", 0);
INI_WriteInt(File, "Money", 0);
INI_WriteInt(File, "Kills", 0);
INI_WriteInt(File, "Banned", 0);
INI_WriteInt(File, "PlayingTime", 0);
INI_WriteInt(File, "Deaths", 0);
INI_Close(File);
SendClientMessage(playerid, -1, "{FF8000}>>{FFFFFF} You Have Been {00FF00}Successfully{FFFFFF} Registered");
return 1;
}