[HELP!] Getting shitloads of errors
#1

Hey

Iґve been scripting some things as suddenly this appeared while compiling:

Код:
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(847) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(867) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(876) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(881) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(882) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(891) : error 017: undefined symbol "bigstrtok"
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(891) : error 033: array must be indexed (variable "reason")
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(896) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(911) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(923) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(944) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(960) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(977) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(985) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(991) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(993) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1025) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1037) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1057) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1070) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1086) : error 017: undefined symbol "bigstrtok"
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1086) : error 033: array must be indexed (variable "reason")
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1087) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1106) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1119) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1127) : error 017: undefined symbol "bigstrtok"
OMG! Maybe I deleted some letter or what.. wheres the problem?
Reply
#2

Are you sure that you have the bigstrtok stock?

pawn Код:
stock bigstrtok(const string[], &idx)
{
  new length = strlen(string);
while ((idx < length) && (string[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = string[idx];
idx++;
}
result[idx - offset] = EOS;
return result;
}
try that ^^
Reply
#3

Now only these errors are left ^^


Код:
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(865) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(885) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(894) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(899) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(900) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(914) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(929) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(941) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(962) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(978) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(995) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1003) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1009) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1011) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1043) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1055) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1075) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1088) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1105) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1124) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1137) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1146) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1160) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1173) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1185) : error 079: inconsistent return types (array & non-array)
C:\Dokumente und Einstellungen\Moritz\Desktop\WW3\admin.pwn(1201) : error 079: inconsistent return types (array & non-array)
Reply
#4

give us the code and where the errors comes !
Reply
#5

Maybe you put codes in Worng Place
Reply
#6

Here are the lines

Код:
	if(strcmp(cmd, "/makeadmin", true) == 0) // Make player an admin
	{
		if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, ORANGE, "USAGE: /makeadmin [playerid] [level 1-5]");
				SendClientMessage(playerid, ORANGE, "FUNCTION: Player will be an admin depending on the given level.");
				return 1;
			}
			new giveplayerid = ReturnUser(tmp, playerid);
			tmp = strtok(cmdtext, idx);
			new level = strval(tmp);
			if(giveplayerid != INVALID_PLAYER_ID)
			{
			  if (level >= 0)
			  {
					GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					printf("ADMIN: %s made %s a level %d admin.", sendername, giveplayername, level);
					format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, sendername);
					SendClientMessage(giveplayerid, LIGHTBLUE, string);
					format(string, sizeof(string), "|- Administrator %s has given %s an Admin Level. [Level: %d] -|", sendername,giveplayername,level);
					SendClientMessageToAdmins(ADMIN_RED, string, 1);
					AccountInfo[giveplayerid][AdminLevel] = level;
					format(string, sizeof(string), "You have given %s level %d admin.", giveplayername,AccountInfo[giveplayerid][AdminLevel]);
					SendClientMessage(playerid, LIGHTBLUE, string);
				}
				else return SendClientMessage(playerid, RED, "You can't go below level 0!");
			}
			else if(giveplayerid == INVALID_PLAYER_ID)
			{
				format(string, sizeof(string), "%i is not an active player.", giveplayerid);
				SendClientMessage(playerid, RED, string);
			}
		}
		else SendClientMessage(playerid, RED, "You are not a lead admin!");
		return 1;
	}

	if(strcmp(cmd, "/gmx", true) == 0) // Reboot the server
	{
		if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid)) return GameModeExit();
		else return SendClientMessage(playerid, RED, "You are not a lead admin!");
	}
	
	if(strcmp(cmd, "/kickall", true) == 0) // Kick everyone except the one who does this
	{
		new reason[128];
		if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
		{
			GetPlayerName(playerid, sendername, sizeof(sendername));
			reason = bigstrtok(cmdtext, idx);
			if(!strlen(reason))
			{
				SendClientMessage(playerid, ORANGE, "USAGE: /kickall [reason]");
				SendClientMessage(playerid, ORANGE, "FUNCTION: Will kick all the players.");
				return 1;
			}
			printf("ADMIN: Admin %s kicked everyone. Reason: %s", sendername, reason);
			format(string, sizeof(string), "-| Administrator %s kicked everyone. [Reason: %s ] |-", sendername,reason);
			SendClientMessageToAll(ADMIN_RED, string);
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
			  if (i != playerid)
			  {
					Kick(i);
					KickLog(string);
				}
			}
		}
		else SendClientMessage(playerid, RED, "You are not a lead admin!");
		return 1;
	}
	
	if(strcmp(cmd, "/nuke", true) == 0) // Nuke a player (explode)
	{
		if (AccountInfo[playerid][AdminLevel] >= 3)
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, ORANGE, "USAGE: /nuke [playerid]");
				SendClientMessage(playerid, ORANGE, "FUNCTION: Player will explode.");
				return 1;
			}
			new Float:X,Float:Y,Float:Z;
			new giveplayerid = ReturnUser(tmp, playerid);
		  	if(IsPlayerConnected(giveplayerid))
		  	{
  				GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
	  		GetPlayerName(playerid, sendername, sizeof(sendername));
				GetPlayerPos(giveplayerid, X,Y,Z);
  			CreateExplosion(X,Y,Z,2,3.0);
				SetPlayerHealth(giveplayerid, 0.0);
				format(string, sizeof(string), "-| Administrator %s nuked %s |-",sendername,giveplayername);
				SendClientMessageToAdmins(ADMIN_RED, string,1);
			}
			else if (!IsPlayerConnected(giveplayerid))
			{
				format(string, sizeof(string), "%d is not an active player.", giveplayerid);
				SendClientMessage(playerid, RED, string);
			}
  		}
		else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
		return 1;
	}
	
	if(strcmp(cmd, "/angle", true) == 0) // Shows your current angle + sets it
	{
		if (IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 1)
		{
			new Float:angle;
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, ORANGE, "USAGE: /angle [angle degree]");
				SendClientMessage(playerid, ORANGE, "FUNCTION: Will change your current angle.");
				GetPlayerFacingAngle(playerid,angle);
				format(string, sizeof(string), "HELP: Your current angle is %f", angle);
				SendClientMessage(playerid, ORANGE, string);
				return 1;
			}
			angle = floatstr(tmp);
			if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
				SetVehicleZAngle(GetPlayerVehicleID(playerid), angle);
				format(string, sizeof(string), "You have changed your angle degree to %f" ,angle);
				SendClientMessage(playerid, GREEN, string);
			}
			else
			{
				SetPlayerFacingAngle(playerid,angle);
				format(string, sizeof(string), "You have changed your angle degree to %f",angle);
				SendClientMessage(playerid, GREEN, string);
			}
		}
		else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
		return 1;
 	}
 	
 	if(strcmp(cmd, "/rangeban", true) == 0) // Range-bans a player with the amount of ranges entered.
	{
		if (AccountInfo[playerid][AdminLevel] >= 4)
		{
		  tmp = strtok(cmdtext,idx);
			if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /rangeban [playername/id] [ranges(2 max)]");
		  new ip[20],ban[128];
		  new giveplayerid = ReturnUser(tmp);
		  if (IsPlayerConnected(giveplayerid))
		  {
		    tmp = strtok(cmdtext,idx);
				if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /rangeban [playername/id] [RANGES(2 max)]");
				new ranges = strval(tmp);
				if (ranges < 0 || ranges > 2) return SendClientMessage(playerid, RED, "Minimum ranges: 0 | Maximum ranges: 2");
				if (ranges == 0)
				{
				  Ban(giveplayerid);
				}
			  	GetPlayerName(giveplayerid, giveplayername, sizeof giveplayername);
		    	GetPlayerIp(giveplayerid, ip, sizeof ip);
		    	new count = 1;
		    	for(new i = strlen(ip); i > 0; i--)
		    	{
		    	  if (ip[i] == '.')
		    	  {
		    	    if (count == ranges)
		    	    {
		    	      format(ban, sizeof ban, "banip %s", ip);
			    	    SendRconCommand(ban);
			    	    break;
		    	    }
		    	    else count++;
		    	  }
		    	  else ip[i] = '*';
		    	}
				format(ban, sizeof ban, "%s has been banned with the ip '%s'", giveplayername, ip);
		    SendClientMessage(playerid, GREEN, ban);
		  }
		  else
		  {
				format(string, sizeof(string), "%i is not an active player.", giveplayerid);
				SendClientMessage(playerid, RED, string);
		  }
		}
		else SendClientMessage(playerid, RED, "You're not a lead admin !");
		return 1;
	}

	if(strcmp(cmd, "/ip", true) == 0) // Look at the player's IP address
	{
		if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, ORANGE, "USAGE: /ip [playername/id]");
				SendClientMessage(playerid, ORANGE, "FUNCTION: View a player's IP.");
				return 1;
			}

			new giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
				new sstring[256];
				new ip[20];
				GetPlayerIp(giveplayerid, ip, sizeof ip);
				GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
				format(sstring, sizeof(sstring), "-| %s's IP: %s |-", giveplayername,ip);
				SendClientMessage(playerid,LIGHTBLUE, sstring);
			}
			else
			{
				format(string, sizeof(string), "%d is not an active player.", giveplayerid);
				SendClientMessage(playerid, RED, string);
			}
		}
		else SendClientMessage(playerid, RED, "You are not an admin.");
		return 1;
	}
	
	if(strcmp(cmd, "/ban", true) == 0) // Bans a player from the server
	{
		new reason[128];
		if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, ORANGE, "USAGE: /ban [playername/id] [reason]");
				SendClientMessage(playerid, ORANGE, "FUNCTION: Will BAN the specified player.");
				return 1;
	 		}
	 		
			new giveplayerid = ReturnUser(tmp);
			
			if (AccountInfo[giveplayerid][AdminLevel] > AccountInfo[playerid][AdminLevel])
			{
			  format(string, sizeof(string), "-| [%i]%s tried to ban you! |-",playerid,sendername);
				SendClientMessage(giveplayerid, ADMIN_RED,string);
				SendClientMessage(playerid, ADMIN_RED, "You are not allowed to ban an admin with a higher level than you!");
			}
			
			else if (giveplayerid != INVALID_PLAYER_ID)
			{
			  GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
				GetPlayerName(playerid, sendername, sizeof(sendername));
				reason = bigstrtok(cmdtext, idx);
				if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /ban [playername/id] [reason]");
				new ip[20];
				printf("ADMIN: Admin %s banned %s. Reason: %s", sendername, giveplayername, reason);
				format(string, sizeof(string), "-| Administrator %s banned %s. [Reason: %s ] |-", sendername, giveplayername, reason);
				SendClientMessageToAll(ADMIN_RED, string);
				GetPlayerIp(giveplayerid, ip, sizeof ip);
				format(string, sizeof(string), "-| Banned Player's IP: %s |-", ip);
				SendClientMessageToAdmins(ADMIN_RED, string, 1);
				AccountInfo[giveplayerid][AdminLevel] = 0; // Resets the banned player's admin level for security reasons
				format(reason, sizeof reason, "[%s]%s", sendername, reason);
				BanEx(giveplayerid, reason);
			}
			else if(giveplayerid == INVALID_PLAYER_ID)
			{
				format(string, sizeof(string), "%d is not an active player.", giveplayerid);
				SendClientMessage(playerid, RED, string);
			}
		}
		else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
		return 1;
	}
	
	if(strcmp(cmd, "/kick", true) == 0) // Kicks the player from the server
	{
		new reason[128];
		if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, ORANGE, "USAGE: /kick [playername/id] [reason]");
				SendClientMessage(playerid, ORANGE, "FUNCTION: Will kick the specified player.");
				return 1;
			}

			new giveplayerid = ReturnUser(tmp);
			if(giveplayerid != INVALID_PLAYER_ID)
			{
			  GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
				GetPlayerName(playerid, sendername, sizeof(sendername));
				reason = bigstrtok(cmdtext, idx);
				if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /kick [playername/id] [reason]");
				printf("ADMIN: Admin %s kicked %s. Reason: %s", sendername, giveplayername, reason);
				format(string, sizeof(string), "-| Administrator %s kicked %s. [Reason: %s ] |-", sendername, giveplayername, reason);
				SendClientMessageToAll(ADMIN_RED, string);
				Kick(giveplayerid);
				KickLog(string);
			}
			else if(giveplayerid == INVALID_PLAYER_ID)
			{
				format(string, sizeof(string), "%d is not an active player.", giveplayerid);
				SendClientMessage(playerid, RED, string);
			}
		}
		else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
		return 1;
	}

	if(strcmp(cmd, "/mute", true) == 0) // Mutes the player from talking in the chat box
	{
		new reason[128];
		if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, ORANGE, "USAGE: /mute [playername/id] [reason]");
				SendClientMessage(playerid, ORANGE, "FUNCTION: Will mute the specified player.");
				return 1;
			}

			new giveplayerid = ReturnUser(tmp);

			if(giveplayerid != INVALID_PLAYER_ID)
			{
				if (AccountInfo[giveplayerid][Mute] == 0)
				{
				  GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					reason = bigstrtok(cmdtext, idx);
					if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /mute [playername/id] [reason]");
					printf("ADMIN: Admin %s muted %s. Reason: %s", sendername, giveplayername, reason);
					format(string, sizeof(string), "-| Administrator %s muted %s. [Reason: %s ]|-", sendername,giveplayername,reason);
					SendClientMessageToAll(ADMIN_RED, string);
					AccountInfo[giveplayerid][Mute] = 1;
				}
				else if (AccountInfo[giveplayerid][Mute] == 1) SendClientMessage(playerid, RED, "Player is already muted!");
			}

			else if(giveplayerid == INVALID_PLAYER_ID)
			{
				format(string, sizeof(string), "%d is not an active player.", giveplayerid);
				SendClientMessage(playerid, RED, string);
			}
		}
		else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
		return 1;
	}
Reply
#7

Anyone? I dont want the whole script fucked up .
Reply
#8

Up..

please.. its IMPORTANT
Reply
#9

Up.. pleeeaaasee
Reply
#10

Solved, just a wrong placed { :O
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)