OutStanding Production's - Restricted Name , Bug's

In jos

descarca OutStanding Production's - Restricted Name , Bug's

Mesaj Scris de DarkArms la data de Dum Noi 13, 2016 6:54 pm

Descriere: Acest plugin schimba nick-urile jucatorilor inainte de a se conecta pe server si va aparea astfel: Nume [1] , Nume [2] , pentru a se evita bugu cu (1).
Am inceput sa postez diferite plugin-uri fiinda m-am lasat de acest joc.

Nume: Restricted Names
Versiune: 1.1

[NEW]Serverele care folosesc acest plugin , click -> HERE

Instalare:
1. Fisierul Nick.sma il puneti in addons/amxmodx/scripting
2. Fisierul Nick.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Cod:
Nick.amxx

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
    amx_default_advert "numele default" - numele default care nu va fi afectat
    amx_new_advert "NumeAles" X - Schimba numele in numele ales de tine.


Spoiler:
#include <amxmodx>

new Array:g_Things = Invalid_Array;
new g_NamesCount = 0;
new g_Default = 0;
new g_New = 0;

public plugin_init()
{
register_plugin("Restricted Names", "1.1", "Hattrick JM3Ch3Rul & Fantasy)");

g_Default = register_cvar("amx_default_advert", "CsOutStanding.Com", FCVAR_SERVER | FCVAR_SPONLY | FCVAR_UNLOGGED | FCVAR_EXTDLL);
g_New = register_cvar("amx_new_advert", "Zp.CsOutStanding.Com", FCVAR_SERVER | FCVAR_SPONLY | FCVAR_UNLOGGED | FCVAR_EXTDLL);

if (g_Default == 0)
{
set_fail_state("Plugin failed.");

return;
}

static File, Location[256], ConfigurationFilesDirectory[128], Line[64];

get_localinfo("amxx_configsdir", ConfigurationFilesDirectory, charsmax(ConfigurationFilesDirectory));

formatex(Location, charsmax(Location), "%s/restricted_things.ini", ConfigurationFilesDirectory);

if (!file_exists(Location))
{
File = fopen(Location, "w+");

switch (File)
{
case 0:
{

}

default:
{
fclose(File);
}
}
}

File = fopen(Location, "r");

if (!File)
{
log_amx("Unable to open ^"%s/restricted_things.ini^".", ConfigurationFilesDirectory);

return;
}

g_Things = ArrayCreate(64);

if (g_Things == Invalid_Array)
{
set_fail_state("Plugin failed to load.");

return;
}

while (!feof(File))
{
fgets(File, Line, charsmax(Line));

trim(Line);

if (strlen(Line) && Line[0] != ';')
{
ArrayPushString(g_Things, Line);
}
}

fclose(File);

if (g_Things == Invalid_Array || !ArraySize(g_Things))
{
log_amx("No restricted names found in ^"%s/restricted_things.ini^".", ConfigurationFilesDirectory);
}
}

public client_putinserver(Client)
{
if (g_Things == Invalid_Array || !ArraySize(g_Things))
{
return;
}

static Name[32], Default[32], Iterator, Thing[32], New[32];

get_user_name(Client, Name, charsmax(Name));
get_pcvar_string(g_Default, Default, charsmax(Default));
get_pcvar_string(g_New, New, charsmax(New));

if (containi(Name, Default) != -1)
{
return;
}

for (Iterator = 0; Iterator < ArraySize(g_Things); Iterator++)
{
ArrayGetString(g_Things, Iterator, Thing, charsmax(Thing));

if (containi(Name, Thing) != -1)
{
formatex(Name, charsmax(Name), "%s [%d]", New, ++g_NamesCount);

set_user_info(Client, "name", Name);

client_cmd(Client, "name ^"%s^"", Name);

break;
}
}
}

public client_infochanged(Client)
{
if (g_Things == Invalid_Array || !ArraySize(g_Things))
{
return;
}

static OldName[32], Name[32], Default[32], Iterator, Thing[32], New[32];

get_user_name(Client, OldName, charsmax(OldName));
get_pcvar_string(g_Default, Default, charsmax(Default));
get_user_info(Client, "name", Name, charsmax(Name));
get_pcvar_string(g_New, New, charsmax(New));

if (equali(Name, OldName))
{
return;
}

if (containi(Name, Default) != -1)
{
return;
}

for (Iterator = 0; Iterator < ArraySize(g_Things); Iterator++)
{
ArrayGetString(g_Things, Iterator, Thing, charsmax(Thing));

if (containi(Name, Thing) != -1)
{
formatex(Name, charsmax(Name), "%s [%d]", New, ++g_NamesCount);

set_user_info(Client, "name", Name);

client_cmd(Client, "name ^"%s^"", Name);

break;
}
}
}

Exemplu :

amx_default_advert "Scoala"
amx_new_advert este pus "ScoalaMea"

Aveti un fisier "restricted_things.ini" pe care server-ul il va creea automat in "configs".
In el veti pune caracterele interzise.
In "restricted_things.ini" veti avea interzis numele ".ro" si eu ma conectez cu "Scoala.ro" si nu il va schimba fiinda aveti pus amx_default_advert "Scoala" , sper ca ati inteles.

DarkArms
Founders
Founders

Mesaje : 226
Data de inscriere : 23/09/2016
Varsta : 16
Localizare : Terra

http://lowgamers.forumgratuit.ro

Sus In jos

descarca Re: OutStanding Production's - Restricted Name , Bug's

Mesaj Scris de Dracu la data de Dum Noi 13, 2016 9:31 pm

Good Job!
avatar
Dracu
Moderators
Moderators

Mesaje : 193
Data de inscriere : 11/11/2016

Sus In jos

descarca Re: OutStanding Production's - Restricted Name , Bug's

Mesaj Scris de Tipu la data de Mier Noi 23, 2016 1:28 pm

Good Job!
avatar
Tipu
Administrators
Administrators

Mesaje : 151
Data de inscriere : 22/11/2016

Sus In jos

descarca Re: OutStanding Production's - Restricted Name , Bug's

Mesaj Scris de CelRau la data de Dum Noi 27, 2016 7:58 pm

Good Job!
avatar
CelRau
Registered user
Registered user

Mesaje : 184
Data de inscriere : 26/11/2016

Sus In jos

descarca Re: OutStanding Production's - Restricted Name , Bug's

Mesaj Scris de Continut sponsorizat


Continut sponsorizat


Sus In jos

Sus


 
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum