C:\Users\Owner\Desktop\NGRP\gamemodes\NGRP.pwn(1341) : error 029: invalid expression, assumed zero C:\Users\Owner\Desktop\NGRP\gamemodes\NGRP.pwn(1341) : warning 215: expression has no effect C:\Users\Owner\Desktop\NGRP\gamemodes\NGRP.pwn(1341) : error 001: expected token: ";", but found ")" C:\Users\Owner\Desktop\NGRP\gamemodes\NGRP.pwn(1341) : error 029: invalid expression, assumed zero C:\Users\Owner\Desktop\NGRP\gamemodes\NGRP.pwn(1341) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
new i = 0; while(i < sizeof(arrForbiddenNames)) if(strcmp(arrForbiddenNames[i++], GetPlayerNameExt(playerid), true) == 0) { SetPlayerName(playerid, "InvalidNick"); SendClientMessage(playerid, COLOR_RED, "You have been kicked & logged for using a forbidden username."); Kick(playerid); return 0; } return 1; }
new i = 0;
while(i < sizeof(arrForbiddenNames))
{ // you forgot this
if(strcmp(arrForbiddenNames[i++], GetPlayerNameExt(playerid), true) == 0)
{
SetPlayerName(playerid, "InvalidNick");
SendClientMessage(playerid, COLOR_RED, "You have been kicked & logged for using a forbidden username.");
Kick(playerid);
return 0;
}
return 1;
}
pawn Код:
|
//forward strfind(const string[],const sub[],bool:ignorecase=false,pos=0); stock InvalidNameCheck(playerid) { new arrForbiddenNames[][] = { "com1", "com2", "com3", "com4", "com5", "com6", "com7", "com8", "com9", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9", "nul", "clock$", "aux", "prn", "con", "InvalidNick" }; new i = 0; while(i < sizeof(arrForbiddenNames)) { // you forgot this line 1342-------- if(strcmp(arrForbiddenNames[i++], GetPlayerNameExt(playerid), true) == 0); { SetPlayerName(playerid, "InvalidNick"); SendClientMessage(playerid, COLOR_RED, "You have been kicked & logged for using a forbidden username."); Kick(playerid); return 0; } return 1; }
stock InvalidNameCheck(playerid)
{
new arrForbiddenNames[][] = {
"com1", "com2", "com3", "com4",
"com5", "com6", "com7", "com8",
"com9", "lpt4", "lpt5", "lpt6",
"lpt7", "lpt8", "lpt9", "nul",
"clock$", "aux", "prn", "con",
"InvalidNick"
};
new i = 0;
while(i < sizeof(arrForbiddenNames))
{ // you forgot this
if(strcmp(arrForbiddenNames[i++], GetPlayerNameExt(playerid), true) == 0) // removed a ;
{
SetPlayerName(playerid, "InvalidNick");
SendClientMessage(playerid, COLOR_RED, "You have been kicked & logged for using a forbidden username.");
Kick(playerid);
return 0;
}
} // added
return 1;
}