SA-MP Forums Archive
string - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: string (/showthread.php?tid=653983)



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 
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;
    }
    }
    } 



Re: string - CodeStyle175 - 18.05.2018

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;




Re: string - dani18 - 18.05.2018

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

Quote:

new string[256];