string
#1

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 }
Reply
#2

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 
0BadNameCounts++)
    {
 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(greystring); print(string);
    
SaveToFile("KickLog",string); Kick(playerid);
    return 
1;
    }
    }
    } 
Reply
#3

PHP код:
CheckName(name[]){
    new 
arrBadNames[][]={"john","smith","sarah"};
    for(new 
i,i2=sizeof(arrBadNames); i2i++)if(strfind(namearrBadNames[i],true) != -1)return 0;
    return 
1;

Reply
#4

Yes, you did not define the string, how did @Kraeror say.

Quote:

new string[256];

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)