Problem With /a
#1

Ok, so I clearly can't see the problem here. It compiles perfectly when I write it in string compare and not ZCMD. But lets face it, who wants to use string compare these days? It's too outdated, which is why I'm converting this over to ZCMD, but I hit a rock here =3

Errors
Код:
C:\Users\Jay\Desktop\SacGTA\gamemodes\sacgta40.pwn(17085) : error 029: invalid expression, assumed zero
C:\Users\Jay\Desktop\SacGTA\gamemodes\sacgta40.pwn(17091) : error 020: invalid symbol name ""
C:\Users\Jay\Desktop\SacGTA\gamemodes\sacgta40.pwn(17091) : error 029: invalid expression, assumed zero
C:\Users\Jay\Desktop\SacGTA\gamemodes\sacgta40.pwn(17091) : error 029: invalid expression, assumed zero
C:\Users\Jay\Desktop\SacGTA\gamemodes\sacgta40.pwn(17091) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Error line one
Код:
while((idx < length) && cmdtext[idx] <= ' '))
Error line two
Код:
while((idx < length) && ((idx - offset) < (sizeof)result) -1)))
Код:
CMD:a(playerid, cmdtext[])
{
	new idx;
	new sendername[MAX_PLAYER_NAME];
	if(IsPlayerConnected(playerid))
	{
	    GetPlayerName(playerid, sendername, sizeof(sendername));
	    new length = strlen(cmdtext);
	    while((idx < length) && cmdtext[idx] <= ' '))
	    {
	        idx++;
		}
		new offset = idx;
		new result[64];
		while((idx < length) && ((idx - offset) < (sizeof)result) -1)))
		{
		    result[idx - offset] = cmdtext[idx];
		    idx++;
		}
		result[idx - offset] = EOS;
		if(!strlen(result))
		{
		    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /a [admin chat]");
		    return 1;
		}
		new string[128];
		format(string, sizeof(string), "*%d Admin %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
		if(PlayerInfo[playerid][pAdmin] >= 1)
		{
		    SendAdminMessage(COLOR_YELLOW, string);
		}
		printf("Admin %s: %s", sendername, result);
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)