CMD:ewa(playerid, params[])
{
INI:UserPath(playerid)[](name[], value[])
{
INI_String("Banned", PlayerInfo[playerid][Banned]);
}
INI_Load("UserPath.ini");
return 1;
}
error 029: invalid expression, assumed zero error 017: undefined symbol "@INI_UserPath" error 029: invalid expression, assumed zero fatal error 107: too many error messages on one line |
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
UserPath(playerid)
{
new string[75], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof string, "/Users/%s.txt", pName);
return string;
}
CMD:ewa(playerid, params[])
{
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File,"Banned", PlayerInfo[playerid][Banned]);
INI_Close(File);
return 1;
}
CMD:ewa(playerid, params[])
{
if(PlayerInfo[playerid][Banned] == 1)
{
SendClientMessage(playerid, -1, "{FF0000}You're banned!");
}
else if(PlayerInfo[playerid][Banned] == 0)
{
SendClientMessage(playerid, -1, "{FF0000}You're not banned!");
}
return 1;
}
Lol, I appreciate it that you're trying to help me, but yet again, I mean if someone is offline. You can't unban a online player
|
CMD:unban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return 0;
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_YELLOWGREEN, "Error: You are not authorized to use this command.");
new string[75], user[128];
if(sscanf(params, "s[128]", user)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /unban [playername]");
format(string, sizeof string, "/Users/%s.txt", user);
if(fexist(string))
{
new INI:File = INI_Open(string);
// if(INI_WriteInt(File, "Banned", PlayerInfo[string][Banned]) == 0) return SendClientMessage(playerid, COLOR_RED, "Error: The player is not banned!");
printf("Userfile opened");
INI_SetTag(File, "PlayerData");
INI_WriteInt(File, "Banned", 0);
printf("User unbanned");
INI_Close(File);
printf("File closed");
format(string, sizeof string, "You have succesfully unbanned the player.");
SendClientMessage(playerid, COLOR_YELLOW, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Error: The user is not found in the database!");
}
return 1;
}