Rwarns
#1

I just made this command to reset the warnings to an offline player but seems don't work.

The warnings are still there (in /stats and in player file):

pawn Код:
CMD:rwarns(playerid,params[])
{
    if(pInfo[playerid][Logged] == 0) return SCM(playerid,0x0080C0FF,"Please login before using this command.");
    if(pInfo[playerid][Admin] >= 5)
    {
    new id;
    new name[128];
    new aName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aName, sizeof(aName));
    if(sscanf(params, "s[128]",name)) return SCM(playerid,-1,"{F70505}Usage: {FFFFFF}/rwarns <account name>");
    if(GetPVarInt(id,"CmdTime")>GetTickCount())return SCM(playerid,0xFF0000FF,"Please wait before using this command again.");
    new string[250];
    new echos[250];
    new Year, Month, Day, Hour, Minute, Second;
    getdate(Year, Month, Day);
    gettime(Hour, Minute, Second);

    new stringo[90];
    new filestring[128];
    format(filestring, sizeof(filestring), "/Users/%s.ini", name);
    if(!fexist(filestring)) return SCM(playerid,red, "Player account not found.");
    else
    {
        dini_IntSet(filestring, "Warn", 0);
        format(stringo, sizeof(stringo),"Success! You have resetted %s's warnings.", name);
        SCM(playerid, red,stringo);
    }
    format(string, sizeof(string), "** Admin %s (%d) resetted %s's warnings - %02d/%02d/%02d - %02d:%02d:%02d", aName,id,name,Day,Month,Year,Hour,Minute,Second);
    format(echos, sizeof(echos), "1,4** Admin %s (%d) resetted %s's warnings - %02d/%02d/%02d - %02d:%02d:%02d", aName,id,name,Day,Month,Year,Hour,Minute,Second);
    SendMessageToAdmins(red,string);
    IRC_Say(gGroupID, IRC_CHANNEL, echos);
    IRC_Say(gGroupID, IRC_ACHANNEL, echos);
    SetPVarInt(id,"CmdTime",GetTickCount()+2000);
    RWarnsLog(string);
    }
    return 1;
}
the "Users" folder is in scriptfiles, obv.
Reply
#2

May you please output the "Warn" value of the file you just edited as a debug printf?
Reply
#3

I remember some weeks ago where you made a post asking for help and you used y_ini. Now I see you use dini. There is an incompatibility between dini and y_ini because dini reads this: warns=0 while y_ini reads this: warn = 0.
Reply
#4

Just wanted to point out one thing, there is no such word as "resetted" it is simply "reset".

@Hurtlocker that is a good possibility, I don't see much of a problem in this code besides how ugly it looks to me.
Reply
#5

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
I remember some weeks ago where you made a post asking for help and you used y_ini. Now I see you use dini. There is an incompatibility between dini and y_ini because dini reads this: warns=0 while y_ini reads this: warn = 0.
I switched globally to dini.
Reply
#6

Bump, still need help with this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)