Ban message
#1

Hello im looking for someone that can create a message to the player that is banned, Example :

You have been banned by Admin [name]
Reason of the ban: [Reason]
Make a screenshot and make a unban apply on the forum

Quote:

dcmd_ban(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 4)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);

if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Reason]") &&
SendClientMessage(playerid, orange, "Function: Will Ban the specified player");
if(!strlen(tmp2))
return SendClientMessage(playerid, red, "ERROR: Reason unspecified!");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);

if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
new year,month,day; getdate(year, month, day);
new hour,minuite,second; gettime(hour,minuite,second);
SendCommandToAdmins(playerid,"Ban");
format(string,sizeof(string),"|- %s has been Banned by Administrator %s | Reason: %s [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
SendClientMessageToAll(lightred,string);
new str[128];
format(str,sizeof(str),"%s has been Banned by Administrator %s | Reason: %s",playername,adminname,params[2]);
SaveIn("BanLog",str);
print(string);
if(udb_Exists(PlayerName2(player1)) && AccInfo[player1][LoggedIn] == 1)
dUserSetINT(PlayerName2(player1)).("Banned",1);
format(string,sizeof(string),"Banned by Administrator %s. | Reason: %s",adminname,params[2]);
return BanEx(player1, string);
}
else return SendClientMessage(playerid, red, "ERRPR: Player is not connected or is yourself or is the highest level admin");
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}

Thats my ban thing Its from LuxAdmin System,
Reply
#2

Change
pawn Код:
format(string,sizeof(string),"|- %s has been Banned by Administrator %s | Reason: %s [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
SendClientMessageToAll(lightred,string);
new str[128];
format(str,sizeof(str),"%s has been Banned by Administrator %s | Reason: %s",playername,adminname,params[2]);
SaveIn("BanLog",str);
to your desired settings
Reply
#3

pawn Код:
dcmd_ban(playerid,params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
    {
        if(AccInfo[playerid][Level] >= 4)
        {
            new Index;
            new tmp[256]; tmp = strtok(params,Index);
            new tmp2[256]; tmp2 = strtok(params,Index);

            if(!strlen(params)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Reason]") &&
            SendClientMessage(playerid, orange, "Function: Will Ban the specified player");
            if(!strlen(tmp2))
            return SendClientMessage(playerid, red, "ERROR: Reason unspecified!");
            new player1;
            new string[128];
            new playername[MAX_PLAYER_NAME];
            new adminname [MAX_PLAYER_NAME];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
            {
                GetPlayerName(player1, playername, sizeof(playername));
                GetPlayerName(playerid, adminname, sizeof(adminname));
                new year,month,day; getdate(year, month, day);
                new hour,minuite,second; gettime(hour,minuite,second);
                SendCommandToAdmins(playerid,"Ban");
                format(string,sizeof(string),"|- %s has been Banned by Administrator %s | Reason: %s [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
                SendClientMessageToAll(lightred,string);
                new str[128];
                format(str,sizeof(str),"%s has been Banned by Administrator %s | Reason: %s",playername,adminname,params[2]);
                SaveIn("BanLog",str);
                print(string);
                if(udb_Exists(PlayerName2(player1)) && AccInfo[player1][LoggedIn] == 1)
                dUserSetINT(PlayerName2(player1)).("Banned",1);
                format(string,sizeof(string),"Banned by Administrator %s. | Reason: %s",adminname,params[2]);
                format(string,sizeof(string),"You have been banned from this server by %s",adminname);
                SendClientMessage(playerid,0xFF0000FF,string);
                format(string,sizeof(string),"Reason of the ban: %s",params);
                SendClientMessage(playerid,0xFF0000FF,string);
                BanWithmessage(player1,"Make a screenshot and make a unban upply on forum.");
                return BanEx(player1, string);
            }else return SendClientMessage(playerid, red, "ERRPR: Player is not connected or is yourself or is the highest level admin");
        }else return ErrorMessages(playerid, 1);
    }else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
    return 1;
}
And You need to add this in the bottom of your gamemode

pawn Код:
forward BanPublic(playerid);
public BanPublic(playerid) { Ban(playerid); }

BanWithMessage(playerid, message[])
{
    SendClientMessage(playerid, COLOR_RED, message);
    SetTimerEx("BanPublic", 1000, 0, "d", playerid);
    return 1;
}
Reply
#4

pawn Код:
dcmd_ban(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 4)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);

if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Reason]") &&
SendClientMessage(playerid, orange, "Function: Will Ban the specified player");
if(!strlen(tmp2))
return SendClientMessage(playerid, red, "ERROR: Reason unspecified!");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);

if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
new year,month,day; getdate(year, month, day);
new hour,minuite,second; gettime(hour,minuite,second);
SendCommandToAdmins(playerid,"Ban");
format(string,sizeof(string),"|- %s has been Banned by Administrator %s | Reason: %s [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
SendClientMessageToAll(lightred,string);
new str[128];
format(str,sizeof(str),"%s has been Banned by Administrator %s | Reason: %s",playername,adminname,params[2]);
SaveIn("BanLog",str);
print(string);
if(udb_Exists(PlayerName2(player1)) && AccInfo[player1][LoggedIn] == 1)
dUserSetINT(PlayerName2(player1)).("Banned",1);
format(string, sizeof(string),"You have been banned by Admin %s", adminname);
SendClientMessage(player1, red, string);
format(string, sizeof(string),"Reason of the ban: %s", params[2]);
SendClientMessage(player1, red, string);
return BanEx(player1, "Make a screenshot and make a unban apply on the forum");
}
else return SendClientMessage(playerid, red, "ERRPR: Player is not connected or is yourself or is the highest level admin");
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
EDIT: They were faster^
Reply
#5

Quote:
Originally Posted by Loot
Посмотреть сообщение
pawn Код:
dcmd_ban(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 4)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);

if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Reason]") &&
SendClientMessage(playerid, orange, "Function: Will Ban the specified player");
if(!strlen(tmp2))
return SendClientMessage(playerid, red, "ERROR: Reason unspecified!");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);

if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
new year,month,day; getdate(year, month, day);
new hour,minuite,second; gettime(hour,minuite,second);
SendCommandToAdmins(playerid,"Ban");
format(string,sizeof(string),"|- %s has been Banned by Administrator %s | Reason: %s [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
SendClientMessageToAll(lightred,string);
new str[128];
format(str,sizeof(str),"%s has been Banned by Administrator %s | Reason: %s",playername,adminname,params[2]);
SaveIn("BanLog",str);
print(string);
if(udb_Exists(PlayerName2(player1)) && AccInfo[player1][LoggedIn] == 1)
dUserSetINT(PlayerName2(player1)).("Banned",1);
format(string, sizeof(string),"You have been banned by Admin %s", adminname);
SendClientMessage(player1, red, string);
format(string, sizeof(string),"Reason of the ban: %s", params[2]);
SendClientMessage(player1, red, string);
return BanEx(player1, "Make a screenshot and make a unban apply on the forum");
}
else return SendClientMessage(playerid, red, "ERRPR: Player is not connected or is yourself or is the highest level admin");
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
EDIT: They were faster^
Not working,
Reply
#6

Quote:
Originally Posted by Tayab
Посмотреть сообщение
pawn Код:
dcmd_ban(playerid,params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)
    {
        if(AccInfo[playerid][Level] >= 4)
        {
            new Index;
            new tmp[256]; tmp = strtok(params,Index);
            new tmp2[256]; tmp2 = strtok(params,Index);

            if(!strlen(params)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Reason]") &&
            SendClientMessage(playerid, orange, "Function: Will Ban the specified player");
            if(!strlen(tmp2))
            return SendClientMessage(playerid, red, "ERROR: Reason unspecified!");
            new player1;
            new string[128];
            new playername[MAX_PLAYER_NAME];
            new adminname [MAX_PLAYER_NAME];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
            {
                GetPlayerName(player1, playername, sizeof(playername));
                GetPlayerName(playerid, adminname, sizeof(adminname));
                new year,month,day; getdate(year, month, day);
                new hour,minuite,second; gettime(hour,minuite,second);
                SendCommandToAdmins(playerid,"Ban");
                format(string,sizeof(string),"|- %s has been Banned by Administrator %s | Reason: %s [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
                SendClientMessageToAll(lightred,string);
                new str[128];
                format(str,sizeof(str),"%s has been Banned by Administrator %s | Reason: %s",playername,adminname,params[2]);
                SaveIn("BanLog",str);
                print(string);
                if(udb_Exists(PlayerName2(player1)) && AccInfo[player1][LoggedIn] == 1)
                dUserSetINT(PlayerName2(player1)).("Banned",1);
                format(string,sizeof(string),"Banned by Administrator %s. | Reason: %s",adminname,params[2]);
                format(string,sizeof(string),"You have been banned from this server by %s",adminname);
                SendClientMessage(playerid,0xFF0000FF,string);
                format(string,sizeof(string),"Reason of the ban: %s",params);
                SendClientMessage(playerid,0xFF0000FF,string);
                BanWithmessage(player1,"Make a screenshot and make a unban upply on forum.");
                return BanEx(player1, string);
            }else return SendClientMessage(playerid, red, "ERRPR: Player is not connected or is yourself or is the highest level admin");
        }else return ErrorMessages(playerid, 1);
    }else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
    return 1;
}
And You need to add this in the bottom of your gamemode

pawn Код:
forward BanPublic(playerid);
public BanPublic(playerid) { Ban(playerid); }

BanWithMessage(playerid, message[])
{
    SendClientMessage(playerid, COLOR_RED, message);
    SetTimerEx("BanPublic", 1000, 0, "d", playerid);
    return 1;
}
C:\Users\Davey\Desktop\LuxAdmin.pwn(4774) : error 017: undefined symbol "BanWithmessage"
C:\Users\Davey\Desktop\LuxAdmin.pwn(11175) : warning 203: symbol is never used: "BanWithMessage"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

Do somebody knows how to fix the warnings/errors from me in de last post
Reply
#8

C:\Users\Davey\Desktop\LuxAdmin.pwn(4774) : error 017: undefined symbol "BanWithmessage" - A Typo

Change it to BanWithMessage ... M IS BIG
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)