SA-MP Forums Archive
Y_ini problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Y_ini problem (/showthread.php?tid=622649)



Y_ini problem - iamjems - 25.11.2016

Heres my command:

PHP код:
CMD:oban(playerid,params[])
{
    new 
msg[144];
    new 
filestring[80];
    new 
name[24];
    if(
PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(
PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playeridCOLORERROR"AdmCmd: You must be on duty to do this. (/aduty)");
        if(
sscanf(params"s[24]"name)) return SendClientMessage(playeridCOLORWHITE"USAGE: /o(ffline)ban <fullplayername>");
        
format(filestring,sizeof(filestring),"/Users/%s.ini",name);
        if(
fexist(filestring))
        {
            
INI_ParseFile(filestring"LoadOfflineUser_%s", .bExtra true, .extra playerid);
            if(
PlayerInfo[playerid][pCheckingOfflineBan] == 0)
            {
                new 
INI:File INI_Open(filestring);
                
INI_SetTag(File"data");
                
INI_WriteInt(File"Banned"1);
                
INI_Close(File);
                
format(msg,sizeof(msg),"AdmBan: Player %s (Last IP - %s) was offline banned by %s."paramsPlayerInfo[playerid][pCheckingOfflineIP], GetName(playerid));
                
ABroadcast(COLORLIGHTREDmsg3);
                
AddBan(PlayerInfo[playerid][pCheckingOfflineIP]);
                
Log("logs/bans.txt"msg);
                
            } else return 
SendClientMessage(playeridCOLORERROR"That account is already banned.");
        } else return 
SendClientMessage(playeridCOLORERROR"That player was not found in our database.");
    } else return 
SendClientMessage(playeridCOLORERROR"You must be atleast a Head Admin to use this!");
    return 
1;

The problem is that the file gets saved as Player_Name with no extension at the end, and not in the Users folder, but in the scriptfiles...

PHP код:
format(filestring,sizeof(filestring),"/Users/%s.ini",name); 
http://i.imgur.com/ltdIg8B.png

My other saving code works perfectly except this.
What am I doing wrong?


Re: Y_ini problem - iamjems - 25.11.2016

Bump


Re: Y_ini problem - iamjems - 25.11.2016

Anyone


Re: Y_ini problem - iamjems - 25.11.2016

Nevermind, fixed.

I had to use a stock function for this to work but it's literally the same as formatting the string within the command... Oh well.