Error 001: expected token: ",", but found ";"
#1

Yes, this is probably a fools mistake and most likely the easiest thing to fix in the world, I have tried but everything I change generates a new error. Sorry, but I'm completely new to PAWN.

Код:
public OnPlayerConnect(playerid)
{
	playersconnected++;
	SendClientMessage(playerid, 0xFF8000FF, "Welcome to the test server!");
	new string[128];
	format (string, sizeof(string), "There are currently %i players in the server (Including you)", playersconnected;
	SendClientMessageToAll(0xFF8000FF, string);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	playersconnected--;
	new string[128];
	format (string, sizeof(string), "There are currently %i players in the server (Including you)", playersconnected;
	SendClientMessageToAll(0xFF8000FF, string);
	return 1;
The lines in bold are the issue.
Reply
#2

Which line the error in ?
Reply
#3

Put this:
Код:
public OnPlayerConnect(playerid)
{
	playersconnected++;
	SendClientMessage(playerid, 0xFF8000FF, "Welcome to the test server!");
	new string[128];
	format (string, sizeof(string), "There are currently %i players in the server (Including you)", playersconnected);
	SendClientMessageToAll(0xFF8000FF, string);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	playersconnected--;
	new string[128];
	format (string, sizeof(string), "There are currently %i players in the server (Including you)", playersconnected);
	SendClientMessageToAll(0xFF8000FF, string);
	return 1;
Reply
#4

Quote:
Originally Posted by Jack Lewis
Посмотреть сообщение
format (string, sizeof(string), "There are currently %i players in the server (Including you)", playersconnected;

format (string, sizeof(string), "There are currently %i players in the server (Including you)", playersconnected;

return 1;

The lines in bold are the issue.
As I said... The lines in bold.
Reply
#5

I see that you didn't place a bracket at the end of the public OnPlayerDisconnect.
Reply
#6

I've already put you over that you forgot to put bracket
format (string, sizeof(string), "There are currently %i players in the server (Including you)", playersconnected);
Reply
#7

Quote:
Originally Posted by Darnell
Посмотреть сообщение
I see that you didn't place a bracket at the end of the public OnPlayerDisconnect.
It's there, must have got cut off when I was copy and pasting.

Quote:
Originally Posted by Gagi_Corleone
Посмотреть сообщение
I've already put you over that you forgot to put bracket
format (string, sizeof(string), "There are currently %i players in the server (Including you)", playersconnected);
Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)