errors
#1

Can any one find the brackets ive got wrong

Код:
 new pName[MAX_PLAYER_NAME];
  	if(dini_Exists(udb_encode(pName)))
	{
		new IPP[50];
		GetPlayerIp(playerid, IPP, sizeof(IPP));
		dini_Set(udb_encode(pName), "IP", IPP);
	}

	if( logged[playerid] == 0 )
	{
		if(dini_Exists(udb_encode(playername)))
		{
 			if(logged[playerid] == 0)
	  	{
				SendClientMessage(playerid, COLOR_RED, "Your account has been detected in our database. Use /login to log in!");
				ShowPlayerDialog(playerid,60,DIALOG_STYLE_INPUT,"Login","Welcome to the server\n\nPlease enter your server password\n\nEnter a password:","Login","Quit");
			}
  		}
  	else if(!dini_Exists(udb_encode(playername)))
		{
			SendClientMessage(playerid, COLOR_RED, "You are not registered! Use /register");
  		}
	return 1;
	}
	if(gPlayerClass[playerid] == ASSAULT) {
  classes[playerid] = Create3DTextLabel("ASSAULT",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
  }
  else if(gPlayerClass[playerid] == DEMOLITION) {
  classes[playerid] = Create3DTextLabel("DEMOLITION",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
 	else if(gPlayerClass[playerid] == SNIPER) {
  classes[playerid] = Create3DTextLabel("SNIPER",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
 	else if(gPlayerClass[playerid] == PILOT) {
  classes[playerid] = Create3DTextLabel("PILOT",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == MEDIC) {
  classes[playerid] = Create3DTextLabel("MEDIC",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == ENGINEER) {
  classes[playerid] = Create3DTextLabel("ENGINEER",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == PYRO) {
  classes[playerid] = Create3DTextLabel("PYRO",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == SCOUT) {
  classes[playerid] = Create3DTextLabel("SCOUT",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == ADMIN) {
  classes[playerid] = Create3DTextLabel("ADMIN",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == GENERAL) {
  classes[playerid] = Create3DTextLabel("GENERAL",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
  }
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\my server\pawno\include\foreach.inc(346) : warning 201: redefinition of constant/macro (symbol "OnPlayerConnect")
C:\Program Files\Rockstar Games\GTA San Andreas\my server\pawno\include\foreach.inc(436) : warning 201: redefinition of constant/macro (symbol "OnPlayerDisconnect")
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2302) : error 021: symbol already defined: "pName"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2367) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2367) : error 004: function "Itter_OnPlayerDisconnect" is not implemented
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2416) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2417) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2421) : error 017: undefined symbol "reason"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2433) : warning 225: unreachable code
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2433) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2433) : error 004: function "SetPlayerRankStars" is not implemented
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2438) : warning 225: unreachable code
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2438) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2438) : error 004: function "Mines" is not implemented
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2442) : warning 225: unreachable code
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2442) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2442) : error 004: function "OnPlayerSpawn" is not implemented
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2445) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2447) : error 054: unmatched closing brace ("}")
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2464) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2466) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2475) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2480) : error 021: symbol already defined: "TogglePlayerControllable"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2482) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2487) : error 021: symbol already defined: "SetPlayerInterior"
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2489) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2493) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2495) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2496) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2497) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2498) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2499) : error 010: invalid function or declaration
C:\Program Files\Rockstar Games\GTA San Andreas\my server\gamemodes\black.pwn(2500) : error 010: invalid function or declaration

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


26 Errors.

Reply
#2

The very last bracket doesn't belong anywhere, its an extra... Which then the return 1; would have to be moved up so it comes before the last closing bracket, other than that, the bracket structure seems just fine
Reply
#3

Ive done what i think you have expianed but i must have it wrong.

Код:
new pName[MAX_PLAYER_NAME];
  	if(dini_Exists(udb_encode(pName)))
	{
		new IPP[50];
		GetPlayerIp(playerid, IPP, sizeof(IPP));
		dini_Set(udb_encode(pName), "IP", IPP);
	}

	if( logged[playerid] == 0 )
	{
		if(dini_Exists(udb_encode(playername)))
		{
 			if(logged[playerid] == 0)
	  	{
				SendClientMessage(playerid, COLOR_RED, "Your account has been detected in our database. Use /login to log in!");
				ShowPlayerDialog(playerid,60,DIALOG_STYLE_INPUT,"Login","Welcome to the server\n\nPlease enter your server password\n\nEnter a password:","Login","Quit");
			}
  		}
  	else if(!dini_Exists(udb_encode(playername)))
		{
			SendClientMessage(playerid, COLOR_RED, "You are not registered! Use /register");
			}
	}
	if(gPlayerClass[playerid] == ASSAULT) {
  classes[playerid] = Create3DTextLabel("ASSAULT",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
  }
  else if(gPlayerClass[playerid] == DEMOLITION) {
  classes[playerid] = Create3DTextLabel("DEMOLITION",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
 	else if(gPlayerClass[playerid] == SNIPER) {
  classes[playerid] = Create3DTextLabel("SNIPER",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
 	else if(gPlayerClass[playerid] == PILOT) {
  classes[playerid] = Create3DTextLabel("PILOT",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == MEDIC) {
  classes[playerid] = Create3DTextLabel("MEDIC",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == ENGINEER) {
  classes[playerid] = Create3DTextLabel("ENGINEER",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == PYRO) {
  classes[playerid] = Create3DTextLabel("PYRO",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == SCOUT) {
  classes[playerid] = Create3DTextLabel("SCOUT",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == ADMIN) {
  classes[playerid] = Create3DTextLabel("ADMIN",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
 	}
  else if(gPlayerClass[playerid] == GENERAL) {
  classes[playerid] = Create3DTextLabel("GENERAL",0xFF0000FF,30.0,40.0,50.0,40.0,0);
 	Attach3DTextLabelToPlayer(classes[playerid], playerid, 0.0, 0.0, 0.7);
return 1;
  }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)