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;
}
Ban(i, "-=[Nick Proibido]=-);
BanEx(i, "-=[Nick Proibido]=-);
BanEx(i, "-=[Nick Proibido]=-);
Entao Voce Tem que usar assim
pawn Код:
|
#include a_samp
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!");
BanEx(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 1;
}
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;
}
pawn Код:
|
C:\Documents and Settings\Fernando\Desktop\Anti-Nick.pwn(78) : error 017: undefined symbol "WriteLog"
C:\Documents and Settings\Fernando\Desktop\Anti-Nick.pwn(80) : warning 217: loose indentation
C:\Documents and Settings\Fernando\Desktop\Anti-Nick.pwn(82) : warning 217: loose indentation
C:\Documents and Settings\Fernando\Desktop\Anti-Nick.pwn(82) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Fernando\Desktop\Anti-Nick.pwn(82) : error 017: undefined symbol "WriteLog"
C:\Documents and Settings\Fernando\Desktop\Anti-Nick.pwn(84) : error 017: undefined symbol "filename"
C:\Documents and Settings\Fernando\Desktop\Anti-Nick.pwn(88) : error 017: undefined symbol "filename"
C:\Documents and Settings\Fernando\Desktop\Anti-Nick.pwn(90) : error 017: undefined symbol "text"
C:\Documents and Settings\Fernando\Desktop\Anti-Nick.pwn(95) : error 030: compound statement not closed at the end of file (started at line 66)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
7 Errors.
@Topico Perceberam que o BanEx(i, "-= ... =-); estб faltando um ", nй? .-. |
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!");
BanEx(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 1;
}