[HELP]Check in Players' files
#1

Hey , I'm registering players' stats as variables (I save those variables in disconnection) , but how to get players' chosen variable when they're disconnected? Like /accountban [PlayerName] to ban disconnected player.

Код:
 NB: I'm using DINI & dcmd
Reply
#2

pawn Код:
dcmd_aban(playerid,params[])
{
    new LEN = strlen(params);
    if(!LEN) SCM(...); // Usage: /aban [PlayerName]
    else if(!(2 < LEN < 21)) SCM(...); // PlayerName must be between 3 and 20 characters
    else if(!dini_Exists(filename[])) SCM(...); // That account doesnt exists
    else{
        dini_Set(filename[],"AccBanned","1");
    }
    return 1;
}
Reply
#3

thanks ! gonna try this.
Reply
#4

Код:
C:\Documents and Settings\PC\Bureau\DATABASE DE ALAE\SND\ICI\SWAT Vs TERRORISTS Server[TDM]\gamemodes\SVTS.pwn(2412) : error 029: invalid expression, assumed zero
C:\Documents and Settings\PC\Bureau\DATABASE DE ALAE\SND\ICI\SWAT Vs TERRORISTS Server[TDM]\gamemodes\SVTS.pwn(2414) : error 029: invalid expression, assumed zero
line 2414:
pawn Код:
dini_Set(file[],"Banned","1");
line 2412:
pawn Код:
else if(!dini_Exists(file[])) SendClientMessage(playerid,COLOR_CYAN,"Can't find it!"); // That account doesnt exists
Reply
#5

pawn Код:
dcmd_aban(playerid,params[])
{
    new LEN = strlen(params);
    if(!LEN) SCM(...); // Usage: /aban [PlayerName]
    else if(!(2 < LEN < 21)) SCM(...); // PlayerName must be between 3 and 20 characters
    else{
        new str[64];
        format(str,sizeof(str),"/Accounts/%s.ini",params);
        if(!dini_Exists(str)) SCM(...); // That account doesnt exists
        else{
            dini_Set(str,"AccBanned","1");
        }
    }
    return 1;
}
Reply
#6

thanks a lot ! works great .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)