05.11.2015, 21:12
pawn Код:
#define USER_PATH "/Users/%s.ini"
new off_warn;
forward OfflineWarn(name[], value[]);
public OfflineWarn(name[], value[])
{
INI_Int("Warn",off_warn);
return 1;
}
YCMD:offwarn(playerid, params[],help)
{
#pragma unused help
if(isnull(params)) SCM(playerid,-1,"/offwarn [NICK]");
else if(!(2 < strlen(params) < MAX_PLAYER_NAME)) SendClientMessage(playerid,-1,"Error: Incorrect name lenght.");
else
{
new str[60];
off_warn = 0;
format(str, sizeof(str),USER_PATH,params);
if(!INI_ParseFile(str, "OfflineWarn")) SendClientMessage(playerid,-1,"Error: Account doesn't exists.");
else
{
new INI:iniFile = INI_Open(str);
INI_SetTag(iniFile,"data");
INI_WriteInt(iniFile,"Warn",off_warn + 1);
INI_Close(iniFile);
}
}
return 1;
}