SA-MP Forums Archive
just 2 error - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: just 2 error (/showthread.php?tid=154327)



just 2 error - by_karizma - 13.06.2010

Код:
C:\Users\samet\Desktop\DMZONEv2.pwn(738) : error 047: array sizes do not match, or destination array is too small
C:\Users\samet\Desktop\DMZONEv2.pwn(751) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Код:
  cmd = strtok(cmdtext, idx);
  if(strcmp(cmd,"/hdf",true)==0)
	{
	  if(!IsPlayerAdmin(playerid))return 0;
	  new tmp1[64],id;
	  tmp1=strtok(cmdtext,idx);
	  if(!strlen(tmp1)) return 0;
	  id=strval(tmp1);
	  Muted[id]=1;
	  new string1[128];
	  format(string1,sizeof(string1),"** %s set's to HDF list.",PlayerName(id));
	  SendClientMessage(playerid,COLOR_LIMEGREEN,string1);
	  return 1;
	}
		if(strcmp(cmd,"/unhdf",true)==0)
	{
	  if(!IsPlayerAdmin(playerid))return 0;
	  new tmp1[64],id;
	  tmp1=strtok(cmdtext,idx);
	  if(!strlen(tmp1)) return 0;
	  id=strval(tmp1);
	  Muted[id]=0;
	  new string1[128];
	  format(string1,sizeof(string1),"** %s revoked from HDF list.",PlayerName(id));
	  SendClientMessage(playerid,COLOR_LIMEGREEN,string1);
	  return 1;
	}
tmp already using and i changed tmp to tmp1





Re: just 2 error - [L3th4l] - 13.06.2010

make, "tmp1[64]" to "tmp1[128]"


Re: just 2 error - by_karizma - 13.06.2010

Quote:
Originally Posted by N000000b :)
make, "tmp1[64]" to "tmp1[128]"
got same errors nothing changed


Re: just 2 error - Jeffry - 13.06.2010

new tmp1[256];


Re: just 2 error - by_karizma - 13.06.2010

Quote:
Originally Posted by Jeffry
new tmp1[256];
thanks got no errors i will trying gamemode now


Re: just 2 error - Jeffry - 13.06.2010

Quote:
Originally Posted by by_karizma
Quote:
Originally Posted by Jeffry
new tmp1[256];
thanks got no errors i will trying gamemode now
You always need the 256 when you call strtok in a command.