error 001: expected token: ";", but found "{"
#1

Код:
CMD:pm(playerid, params[])
{
	new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
	if(sscanf(params, "us", id, str2))
	{
	    SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id> <message>");
	    return 1;
	}
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
	if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!")
	{
		GetPlayerName(playerid, Name1, sizeof(Name1));
		GetPlayerName(id, Name2, sizeof(Name2));
		format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
		SendClientMessage(playerid, 0xFF0000FF, str);
		format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
		SendClientMessage(id, 0xFF0000FF, str);
	}
	return 1;
}
Reply
#2

Please a ";" at the end of this line.
Код:
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!")
Also, in future questions, make sure you add the whole error line, including the line number and also indicate the line that the error is on.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)