PDA

View Full Version : Errors


IchNar
20/07/2017, 02:52 PM
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

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

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.

Dayrion
20/07/2017, 03:19 PM
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