Need help with my ban system
#4

Quote:
Originally Posted by Debjit
Посмотреть сообщение
Show the ban cmd
PHP код:
CMD:ban(playeridparams[])
{
      new 
targetidreason[200];
    if(
IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 3)
    {
        if(
sscanf(params"us[24]"targetidreason)) return SendClientMessage(playerid,error"Usage: /ban [PlayerName/Playerid] [reason]");
        if(
strlen(reason) < || strlen(reason) > 200) return SendClientMessage(playeriderror"Your reason can only contain 1-100 characters.");
        if(
targetid == INVALID_PLAYER_ID) return SendClientMessage(playeriderror"Player not found.");
        {
            
pInfo[targetid][Banned] = 1;
             
GetPlayerIp(targetid,pIP,16);
            new 
y,m,d,hour,mint,sec,message[300];
            
getdate(y,m,d);
            
gettime(hour,mint,sec);
        
//    pInfo[targetid][Banned] = 1;
            
pInfo[targetid][Banres] = reason;
            new 
INI:File INI_Open(UserPath(targetid));
               
INI_SetTag(File,"data");
              
//INI_WriteString(File,"Ban Reason",reason);
               
INI_WriteInt(File,"Banned",1);
            
INI_WriteString(File,"Bannedby",GetName(playerid));
            
INI_Close(File);
            
format(messagesizeof(message), "[AdmCmd]:{FF6347}%s has been Banned from the server. | Reason: %s"GetName(targetid), reason);
            
SendClientMessageToAll(redmessage);
            
SendClientMessage(targetid,red,"=====================================================");
            
SendClientMessage(targetid,red,"{FF6347}You have been Banned from Caribbean Mafia Warz.");
            
format(messagesizeof(message),"{FF6347}Banned by: %s "GetName(playerid));
            
SendClientMessage(targetid,red,message);
            
format(messagesizeof(message),"{FF6347}Banned Reason: %s "reason);
            
SendClientMessage(targetid,red,message);
            
format(messagesizeof(message),"{FF6347}Date: %d/%d/%d || Time: %d:%d:%d",d,m,y,hour,mint,sec );
            
SendClientMessage(targetid,red,message);
            
format(messagesizeof(message),"{FF6347}IP Address: %s"pIP);
            
SendClientMessage(targetid,red,message);
            
SendClientMessage(targetid,red,"{FF6347}You will need to take a screenshot of this message for your appeal.");
               
SendClientMessage(targetid,red,"{FF6347}Make an Ban Appeal on our forums. An Staff member will review it as soon as possible.");
            
SendClientMessage(targetid,red,"{FF6347}Visit our forums at:"SERVER_FORUMS"");
            
SendClientMessage(targetid,red,"=====================================================");
            
SendClientMessage(targetid,red,"{FF6347}Server Administrators has been notified.");
              
SetTimerEx("BanPlayer",200,false,"ud"targetid,2);
               
CommandToAdmins(playerid,"ban");
        }
    }
      else return 
ShowMessage(playeriderror1);
     return 
1;

Quote:
Originally Posted by McBan
Посмотреть сообщение
In regards to the ban reason not showing, is it just the reason that doesn't show or does the entire "You are banned from this server" string not show?

Are you certain you're saving the string accordingly in the INI file?

Код:
public LoadUser_data(playerid,name[],value[]) 
{ 
INI_String("Reason",pInfo[playerid][Banres],200); 
return 1; 
}
Ok mate as i have said it saves in the .ini file successfully, but when the player logs on to the server and the server runs a ban check on the account it doesnt show the reason why the player is banned but yet it is saved in the player .ini file, so i assume the issue would be with how im loading the user data.. what do you think?


IMAGES:

https://ibb.co/i7qTy6
https://ibb.co/d2YdWR
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)