Need help with my ban system
#1

Ok so im trying to improve the ban system, anyways these are the issues that i'm currently having, I want to make it that when a player connects and they are banned it will show the reason why they are banned but when i tried to do it , it doesn't work...
PHP код:
enum PlayerInfo
{
Banres[200]
}
new 
pInfo[MAX_PLAYERS][PlayerInfo];
public 
LoadUser_data(playerid,name[],value[])
{
INI_String("Reason",pInfo[playerid][Banres],200);
return 
1;
}  
if(
pInfo[playerid][Banned] == 1)
    {
        new 
reso[128];
        
SendClientMessage(playerid,red,"=====================================================");
        
SendClientMessage(playerid,red"{FF6347}You are banned from this server.");
        
SendClientMessage(playerid,red,"{FF6347}Make an Ban Appeal on our forums. An Staff member will review it as soon as possible.");
        
SendClientMessage(playerid,red,"{FF6347}Visit our forums at: "SERVER_FORUMS"");
    
    
format(reso,sizeof(reso),"{85BB65}Reason: {f0f000}%s",pInfo[playerid][Banres]);
        
SendClientMessage(playerid,-1,reso);
        
SendClientMessage(playerid,red,"=====================================================");
        
SendClientMessage(playerid,red"[AdmCmd]:{FF6347}This Account has been banned from the server."); 
Another issue is why does my unban command creates another line called Ban Reason instead of editing the one which is currently already in the .ini because the banned by edits the old one but the Ban reason creates a new line..

PHP код:
CMD:unban(playeridparams[])
{
       if(
IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 3)
    {
        new 
Name[25],file[256];
        if(
sscanf(params"s[24]"Name)) return SendClientMessage(playeriderror"Usage: /unban <Player Name>");    format(file100PATHName);
        if (!
fexist(file)) return SendClientMessage(playerid,error,"Error: This player doesn't have an account!");
        new 
INI:File INI_Open(file);
           
INI_SetTag(File,"data");
          
INI_WriteInt(File,"Banned",0);
        
INI_WriteString(File,"Bannedby","");
        
INI_WriteString(File,"Ban Reason","");
        
INI_Close(File);
        
format(astringsizeof(astring),"You have successfully unbanned '%s'",Name);
        
SendClientMessage(playerid,-1,astring);
        
format(astring,sizeof(astring),"[UNBAN] %s has UNBANNED Account: %s",GetName(playerid),Name);
        
WriteToLog(astring,"Unban");
        
CommandToAdmins(playerid,"unban");
        return 
1;
    }
     else return 
ShowMessage(playeriderror1);

And how can i make it case sensitive.
Reply


Messages In This Thread
Need help with my ban system - by 1fret - 18.10.2017, 05:11
Re: Need help with my ban system - by McBan - 18.10.2017, 08:47
Re: Need help with my ban system - by Zeth - 18.10.2017, 08:54
Re: Need help with my ban system - by 1fret - 18.10.2017, 16:33
Re: Need help with my ban system - by Zeth - 18.10.2017, 16:48
Re: Need help with my ban system - by 1fret - 18.10.2017, 18:01

Forum Jump:


Users browsing this thread: 1 Guest(s)