26.04.2012, 16:32
Desenvolvi esse fs sei q ja tem muitos e prontos mais como estou aprendendo pawn quero desenvolver meus prуprios scripts mais nesse aqui eu realmente nгo sei oq tem de errado.
ele compila d boa mais ele n ta banindo o player e nгo estб mostrando o nome do player nos logs
Alguem poderia me Ajudar?
ele compila d boa mais ele n ta banindo o player e nгo estб mostrando o nome do player nos logs
pawn Код:
new NomesProibidos[35][MAX_PLAYER_NAME] =
{
"com1",
"com2",
"com3",
"com4",
"com5",
"com6",
"com7",
"com8",
"com9",
"lpt1",
"lpt2",
"lpt3",
"lpt4",
"lpt5",
"lpt6",
"lpt7",
"lpt8",
"lpt9",
"Carl",
"Rocky",
"Sony",
"clock$",
"prn",
"nul",
"con",
"Azucar",
"CON",
"con",
"con1",
"aux",
"aux1",
"prn",
"PRN",
"AUX",
"Caio_Freeze"
};
public OnPlayerConnect(playerid)
{
for(new i; i<sizeof(NomesProibidos); i++)
{
new Nome[40];
new String[128];
new Nick[MAX_PLAYER_NAME];
GetPlayerName(i,Nome,sizeof(Nome));
GetPlayerName(playerid, Nick, sizeof(Nick));
if(!strcmp(Nick, NomesProibidos[i], true)){
SendClientMessage(i, 0xFFFF00AA, "[INFO-NICK] Vocк Foi Banido/Kickado Do Servidor Por Usar Um Nick Proibido!");
Ban(i, "-=[Nick Proibido]=-);
format(String, sizeof(String), "[Anti Nick's] O Jogador %s Foi Kickado/Banido Por Tentar Entrar Com Nick Proibido", Nome);
SendClientMessageToAll(0xFF0000AA, String);
WriteLog("NicksProibidos", String); }
}
return 0;
}
stock WriteLog(filename[],text[])
{
printf("%s => %s", filename, text);
new File:file;
new filepath[256], string[128], year,day,month, hour,minute,second;
getdate(year,day,month); gettime(hour,minute,second);
format(filepath,sizeof(filepath),"/Anti-Nicks/%s.log",filename);
file = fopen(filepath,io_append);
format(string,sizeof(string),"[%02d/%02d/%d|%02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second,text);
fwrite(file,string);
fclose(file);
return 1;
}