SA-MP Forums Archive
Zcmd 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)
+--- Thread: Zcmd error... (/showthread.php?tid=547798)



Zcmd error... - dundolina - 25.11.2014

I have error on 1 zcmd command:

Код:
CMD:admin(playerid, params[])
{
	    if(IsPlayerConnected(playerid))
	    {
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[256];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_WHITE, "Използвай: (/a)dmin [admin chat]");
				return 1;
			}
			format(string, sizeof(string), "{9AFF00}({FFFFFF}Admin{9AFF00}) {FF0000}%s: {008480}%s", PlayerName(playerid), result);
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				SendAdminMessage(COLOR_WHITE, string);
			}
		}
		return 1;
}
Код:
C:\Users\НИКИ\Desktop\gangwars4.pwn(3437) : error 017: undefined symbol "cmdtext"
C:\Users\НИКИ\Desktop\gangwars4.pwn(3438) : error 017: undefined symbol "idx"
C:\Users\НИКИ\Desktop\gangwars4.pwn(3438) : error 029: invalid expression, assumed zero
C:\Users\НИКИ\Desktop\gangwars4.pwn(3438) : error 029: invalid expression, assumed zero



Re : Zcmd error... - Dutheil - 25.11.2014

Use sscanf and read this