y_ini help
#1

This is my code for /unban [username].

PHP код:
// /unban[dcmd]
dcmd_unban(playeridparams[])
{
    new 
pName[128], string[128];
    if(
PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playeridCOLOR_WHITE,"Server: Unrecognized command, type /commands to see the commands available for you.");
    if(
PlayerInfo[playerid][pAdmin]<4) return SendClientMessage(playeridCOLOR_ADMINBLUE"ERROR: This command is unavailable for your admin rank.");
    if(
admduty[playerid]==0) return SendClientMessage(playeridCOLOR_ADMINBLUE"ERROR: You must be on duty to use this command.");
    if(
sscanf(params"s"pName)) return SendClientMessage(playeridCOLOR_ADMINBLUE"Correct usage: /unban [username]");
     
format(pNamesizeof(pName), "Users/%s.ini"pName);
    if(!
fexist(string)) return SendClientMessage(playeridCOLOR_ADMINBLUE"ERROR: This user does not exists.");
    new 
INI:File INI_Open(string);
    
SetTag(File"data");
    
INI_WriteInt(File"Banned"0);
    
INI_Close(File);
    
SendClientMessage(playeridCOLOR_ADMINBLUE"User %s has been unbanned."pName);
    return 
1;

I need to add a line that checks if that user is banned or not and if he is banned, then it returns a message SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: This user is not banned.");

I don't know the y_ini function for it. Can anyone please tell me how to do it?
Reply


Messages In This Thread
y_ini help - by ATGOggy - 06.01.2015, 12:54
Re: y_ini help - by ATGOggy - 06.01.2015, 13:09
Re: y_ini help - by ATGOggy - 06.01.2015, 14:48
Re: y_ini help - by ATGOggy - 07.01.2015, 09:09
Re: y_ini help - by Threshold - 07.01.2015, 09:56
Re: y_ini help - by ATGOggy - 07.01.2015, 10:18

Forum Jump:


Users browsing this thread: 1 Guest(s)