I want member/admins in my server to use [HS] Tag on their name.
If someone that tries to go in the server with [HS] tag and he's not a [HS], system kick's him.
pawn Код:
#include <a_samp>
#define DIALOGCLAN 1000
#define TAGCLAN "[HS]" // example [HS]
#define PASSWORDCLAN "password" //Enter the clan password
#define FAPZ 0xFF66FFAA
#define HACKZ 0x00BFFFAA
public OnPlayerConnect(playerid)
{
new stringa[500];
new nome[24];
GetPlayerName(playerid, nome, 24);
if(strfind(nome, TAGCLAN, true) == 0)
{
format(stringa, sizeof(stringa), "{FFFFFF}Welcome {FF4444}%s{FFFFFF}!\nYou must confirm the clan password {FF4444}%s{FFFFFF}.\n{FFFFFF}Enter the clan password and confirm.", nome);
ShowPlayerDialog(playerid, DIALOGCLAN, DIALOG_STYLE_INPUT, "{33AA33}Clan", stringa, "Confirm", "Exit");
}
else
{
SendClientMessage(playerid, HACKZ, "Welcome!");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
{
new stringa[500];
if(dialogid == DIALOGCLAN)
{
if(response)
{
if(!strlen(inputtext))
{
new nome[24];
GetPlayerName(playerid, nome, 24);
format(stringa, sizeof stringa, "{FF4444}Error:{FFFFFF} Insert a password.\n\n{FFFFFF}Welcome {FF4444}%s{FFFFFF}!\nYou must confirm the clan password {FF4444}%s{FFFFFF}.\n{FFFFFF}Enter the clan password and confirm.", nome);
ShowPlayerDialog(playerid, DIALOGCLAN, DIALOG_STYLE_INPUT, "{33AA33}Account:", stringa, "Confirm", "Exit");
return 0;
}
if(!strcmp(inputtext, PASSWORDCLAN, false))
{
new nome[24];
GetPlayerName(playerid, nome, 24);
format(stringa, sizeof(stringa), "** {FFFFFF}%s{00BFFF} has confirmed to be part of the clan.", nome);
SendClientMessageToAll(HACKZ, stringa);
SendClientMessage(playerid, HACKZ, "You have confirmed to be part of the clan!");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
return 1;
}
else
{
new nome[24];
GetPlayerName(playerid, nome, 24);
format(stringa, sizeof(stringa), "** {FFFFFF}%s{00BFFF} has been kicked from the Server. [Reason: {FFFFFF}Failed login attempt in the clan{00BFFF}]", nome);
SendClientMessageToAll(HACKZ, stringa);
SendClientMessage(playerid, FAPZ, "*** {FFFFFF}You have been kicked. Reason: {FF66FF}Failed login attempt in the clan{FFFFFF}.");
Kick(playerid);
}
}
else if(!response)
{
new nome[24];
GetPlayerName(playerid, nome, 24);
SendClientMessage(playerid, FAPZ, "*** {FFFFFF}You have been kicked. Reason: {FF66FF}Failed login attempt in the clan{FFFFFF}.");
format(stringa, sizeof(stringa), "** {FFFFFF}%s{00BFFF} has been kicked from the Server. [Reason: {FFFFFF}Failed login attempt in the clan{00BFFF}]", nome);
SendClientMessageToAll(HACKZ, stringa);
Kick(playerid);
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
}
return 1;
}
}