string -
DovFlaminggo - 18.05.2018
I got Error like this
D:\Freaxie SAMP\a New GM\filterscripts\ladmin2.pwn(820) : error 017: undefined symbol "string"
D:\Freaxie SAMP\a New GM\filterscripts\ladmin2.pwn(820) : error 017: undefined symbol "string"
D:\Freaxie SAMP\a New GM\filterscripts\ladmin2.pwn(820) : error 029: invalid expression, assumed zero
D:\Freaxie SAMP\a New GM\filterscripts\ladmin2.pwn(820) : fatal error 107: too many error messages on one line
812 if(ServerInfo[NameKick] == 1)
813 {
814 for(new s = 0; s < BadNameCount; s++)
815 {
816 if(!strcmp(BadNames[s],PlayerName,true))
817 {
818
819 SendClientMessage(playerid,red, "Your name is on our black list, you have been kicked.");
820 format(string,sizeof(string),"%s ID:%d was auto kicked. (Reason: Forbidden
821 name)",PlayerName,playerid);
822 SendClientMessageToAll(grey, string); print(string);
823 SaveToFile("KickLog",string); Kick(playerid);
824 return 1;
825 }
826 }
827 }
Re: string -
Kraeror - 18.05.2018
You didn't define the string variable! You can define it by adding new string[256]; before formating it. Use this:
PHP код:
if(ServerInfo[NameKick] == 1)
{
for(new s = 0; s < BadNameCount; s++)
{
if(!strcmp(BadNames[s],PlayerName,true))
{
new string[256];
SendClientMessage(playerid,red, "Your name is on our black list, you have been kicked.");
format(string,sizeof(string),"%s ID:%d was auto kicked. (Reason: Forbidden
name)",PlayerName,playerid);
SendClientMessageToAll(grey, string); print(string);
SaveToFile("KickLog",string); Kick(playerid);
return 1;
}
}
}
Re: string -
CodeStyle175 - 18.05.2018
PHP код:
CheckName(name[]){
new arrBadNames[][]={"john","smith","sarah"};
for(new i,i2=sizeof(arrBadNames); i < i2; i++)if(strfind(name, arrBadNames[i],true) != -1)return 0;
return 1;
}
Re: string -
dani18 - 18.05.2018
Yes, you did not define the string, how did @Kraeror say.