Y_ini help with my ban system
#1

So I am currently making a DM server for a client , he requested it in Y_ini , I had no problem because I just started learning MySQL a couple weeks ago, anyways I made a ip ban system for him and this is how it works, it sets the players account to banned and then saves the ip address in another folder but save the reason/admin name/date to the account folder(two different folders) and when a player joins a ban check gets done on the account and ifthe IP is found in the IP ban folder(IP Bans in scriptfiles) it then returns the reason/admin name/ date of ban(located in the User folder), it works perfectly as intended, but now I want to unban the players ip but I don't know if it is possible to be done this way. I want when the admin enters the players Ip address it would then checks the Users folder to see if any of the players account that Is registered is linked to the inputted ip address and if so , it should edit the players account file to set the account as unbanned.

MAJOR UPDATE:

I changed the saving method to save in 1 folder as a smart person would do but now iv'e worked with loading saved y_ini strings for years now in many projects anyways, I wonder why this one is not loading as you can see in the screen shot but yet it writes to the player's file successfully but wont load.

PHP код:

//writing the data to the saved file
//Under the /banip command
new INI:IPFile INI_Open(IPPath(targetid));
INI_SetTag(IPFile,"IPData");
INI_WriteString(IPFile,"IPBannedBy",aname);
INI_WriteString(IPFile,"IPBannedRea",reason);
INI_WriteString(IPFile,"IPBannedDate",string);
INI_Close(IPFile);
//loading the stored data to the following (admin/date/rea)
forward LoadIPBan(playerid,name[],value[]);
public 
LoadIPBan(playerid,name[],value[])
{
    
INI_String("IPBannedBy",admin,24);
    
INI_String("IPBannedRea",rea,64);
    
INI_String("IPBannedDate",bdate,64);
    return 
1;
}
//calling the LoadIPBan function here
//Under loadacc function
INI_ParseFile(IPPath(playerid), "LoadIPBan_%s", .bExtra true, .extra playerid); 
If you need to see more code just ask and I will post it as soon as possibly



Please ignore the fact that it should have been written as "IPBannedBy","IPBannedDate","IPBannedRea", but yet in the file it says "BannedRea","BannedDate","BannedBy", because I have updated it to the right format

Reply


Messages In This Thread
Y_ini help with my ban system - by Leaky - 22.08.2018, 05:25
Re: Y_ini help with my ban system - by Leaky - 23.08.2018, 07:41
Re: Y_ini help with my ban system - by Leaky - 24.08.2018, 06:43
Re: Y_ini help with my ban system - by Leaky - 26.08.2018, 01:21
Re: Y_ini help with my ban system - by Leaky - 27.08.2018, 04:17
Re: Y_ini help with my ban system - by KinderClans - 27.08.2018, 08:16
Re: Y_ini help with my ban system - by Leaky - 27.08.2018, 08:57

Forum Jump:


Users browsing this thread: 1 Guest(s)