24.10.2014, 09:52
EDIT: Get saving system from here
https://sampforum.blast.hk/showthread.php?tid=273088
Well if you have a path for saving
And some enums
You can add pKicks to it
Save them on OnPLayerDisconnect
And if you have a kick command
This is just to let you know how can you do it :P
https://sampforum.blast.hk/showthread.php?tid=273088
Well if you have a path for saving
pawn Код:
#define PATH "/Users/%s.ini"
pawn Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
pKicks
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("Kicks",PlayerInfo[playerid][pKicks]);
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Kicks",PlayerInfo[playerid][pKicks]);
INI_Close(File);
return 1;
}
pawn Код:
CMD:kick(playerid, params[])
{
PlayerInfo[targetid[pKicks]++;
//Timer for kick
return 1;
}