SA-MP Forums Archive
Errors - 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: Errors (/showthread.php?tid=637735)



Errors - IchNar - 20.07.2017

Greedings,its again me and i need again help...
I have got some errors in command unban please help me..
There is a code.
//errors
PHP код:
C:\Users\ichna\Desktop\SAMP server\pawno\RaIZone.pwn(781) : error 033: array must be indexed (variable "UnbanName")
C:\Users\ichna\Desktop\SAMP server\pawno\RaIZone.pwn(785) : error 033: array must be indexed (variable "UnbanName"
//command//and lines
PHP код:
CMD:unban(playerid,params[])
{
    new 
UnbanName[MAX_PLAYER_NAME],dovod[128],string[64],cesta[16+15],kesta[16+15];
    if(
AdminLevel[playerid] < 3)return SendClientMessage(playerid,COLOR_RED,"[!] {FFFFFF}Nemбљ oprбvnenie na tento prнkaz");
    if(
sscanf(params,"us[128]",UnbanName,dovod))return SendClientMessage(playerid,COLOR_RED,"[!] {FFFFFF}Musнљ zadať /unban [MenoHrбča] [Dфvod]");
    
format(cesta,sizeof(cesta),"Banneds/%s.ini",PlayerIP(playerid));
    
format(kesta,sizeof(kesta),"PermaBanneds/%s.ini",PlayerIP(playerid));
    
//this line// if(UnbanName == DOF2_GetString(cesta,"MenoHraca"))
    
{
          
DOF2_RemoveFile(cesta);
    }
        
//this line// else if(UnbanName == DOF2_GetString(kesta,"MenoHraca"))
    
{
          
DOF2_RemoveFile(kesta);
    }
    return 
1;
}
Thank you for helping me



Re: Errors - Dayrion - 20.07.2017

You can't compare 2 strings with operators. You have to use strcmp which mean string comparation. Check on the wiki what is the syntaxe