SA-MP Forums Archive
/heal ID some 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: /heal ID some error. (/showthread.php?tid=106762)



/heal ID some error. - Striker_Moe - 05.11.2009

Код:
  new index;
	if (strcmp(cmd, "/heal", true) == 0)
	{
		new tmp[20],id;
		tmp = strtok(cmdtext, index);
		if(medic[playerid] == 0) return SendClientMessage(playerid, 0xFF0000AA, "You need to be a medic to do that!");
		if (strlen(tmp))
		{
			id = strval(tmp);
			if (IsPlayerConnected(id))
			{
				SetPlayerHealth(id, 100.0);
				SendClientMessage(id, 0x00FF00AA, "You have been healed!");
				SendClientMessage(playerid, 0x00FF00AA, "Player healed!");
			}
			else
			{
				SendClientMessage(playerid, 0xFF0000AA, "Player not found");
			}
		}
		else
		{
			SendClientMessage(playerid, 0xFF0000AA, "USAGE: /heal <playerid>");
		}
		return 1;
	}
I get this error:

error 047: array sizes do not match, or destination array is too small

on line

tmp = strtok(cmdtext, index);



Re: /heal ID some error. - Zeromanster - 05.11.2009

Just make this number bigger.

pawn Код:
new tmp[20],id;



Re: /heal ID some error. - RyDeR` - 05.11.2009

Quote:
Originally Posted by Zeromanster
Just make this number bigger.

pawn Код:
new tmp[20];
Yes what he said.

Set it to 256