27.03.2011, 23:31
(
Последний раз редактировалось LuxurioN™; 28.03.2011 в 00:50.
)
Um sistema bбsico, parte por E4sTsId3. Nгo й o mais rбpido ou prбtico, entretanto, deve resolver seu problema:
Topo do seu script:
OnGameModeInit:
Em "OnPlayerConnect":
Funзгo:
Comando (zcmd):
Lembre-se de criar o arquivo "Nomes.cfg" na pasta "Scriptfiles", coloque um nome em cada linha, sendo um limite de 50 nomes (Edite o cуdigo).
Topo do seu script:
Код:
new
Proibidos[50][50],
Total = 0;
Код:
CarregarNomes();
Код:
new pNome[MAX_PLAYER_NAME]; GetPlayerName(playerid,pNome,sizeof(pNome));
for(new s = 0; s < Total; s++)
{
if(!strcmp(Proibidos[s],pNome,true))
return SendClientMessage(playerid, Cor,
"Seu nome estб proibido neste servidor."),
Kick(playerid);
//Ou Ban(playerid);
}
Код:
stock CarregarNomes()
{
new
File:Arq,
string[50];
Total = 0;
if( ( Arq = fopen( "Nomes.cfg",io_read ) ) )
{
while(fread( Arq,string ))
{
for(new i = 0, j = strlen( string ); i < j; i++)
if(string[i] == '\n'|| string[i] == '\r') string[i] = '\0';
//-------------------
Proibidos[Total] = string;
Total++;
}
fclose(Arq);
}
}
Код:
CMD:bnome(playerid,params[])
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, Cor, "Vocк nгo й Administrador");
if(!strlen(params))
return SendClientMessage(playerid, Cor, "Use: /bnome [Nome]");
new
File:Arq,
string[128];
Arq = fopen("Nomes.cfg",io_append); format(string,sizeof(string),"%s\r\n",params[0]);
fwrite(Arq,string);
return fclose(Arq);
}

