SA-MP Forums Archive
error codes - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error codes (/showthread.php?tid=586897)



error codes - karolissas - 26.08.2015

Error codes
Код:
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2294) : error 035: argument type mismatch (argument 1)
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2409) : error 017: undefined symbol "glob0"
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2409) : warning 215: expression has no effect
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2409) : error 001: expected token: ";", but found "]"
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2409) : error 029: invalid expression, assumed zero
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2409) : fatal error 107: too many error messages on one line
on those lines

Код:
 if(!IsPlayerConnected(playerid))
	{
		return 0;
	}
	if(GetPlayerState(playerid) == 2)
	{
		new var0 = 0;
		while(++var0 < 200)
		{
		//2409 line -->	if(IsPlayerInRangeOfPoint(playerid, 1077936128, glob0[var0][1], glob0[var0][2], glob0[var0][3]))
			{
				if(glob0[var0][0] == 1)
				{
					new var1 = 0, var2 = 0, var3 = 0, var4 = 0;
					new var5 = GetPlayerVehicleID(playerid);
					GetVehicleDamageStatus(var5, var1, var2, var3, var4);
					var4 = functionAC4(1, 1, 1, 1);
					UpdateVehicleDamageStatus(var5, var1, var2, var3, var4);
					return 0;
				}
			}
		}
	}
Second error lines
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new var0[256];
	new var1 = 0;
	//2294  line --> var0 = functionB38(cmdtext, var1);
	if(!strcmp(var0, "/spygliai", true))
	{
		if(Policininkas[playerid] == false)
		{
			return SendClientMessage(playerid, 0x10F441AA, "Љi komanda policininkams.");
		}
		new Float:var2 = 0.0, Float:var3 = 0.0, Float:var4 = 0.0, Float:var5 = 0.0;
		GetPlayerPos(playerid, var2, var3, var4);
		GetPlayerFacingAngle(playerid, var5);
		function360(var2, var3, var4, var5);
		return 1;
	}
	if(!strcmp(var0, "/spygliaip", true))
	{
		if(Policininkas[playerid] == false)
		{
			return SendClientMessage(playerid, 0x10F441AA, "Љi komanda policininkams.");
		}
		function810(playerid);
		SendClientMessage(playerid, 0x10F441AA, "Panaikinai paskutinius padetus spyglius.");
		return 1;
	}
	if(!strcmp(var0, "/spygliaivs", true))
	{
		if(Policininkas[playerid] == false)
		{
			return SendClientMessage(playerid, 0x10F441AA, "Љi komanda policininkams.");
		}
		function644();
		SendClientMessage(playerid, 0x10F441AA, "Panaikinai visus spyglius.");
		return 1;
	}
     return 0;
}



Re: error codes - LetsOWN[PL] - 26.08.2015

Quote:
Originally Posted by karolissas
Посмотреть сообщение
Error codes
Код:
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2294) : error 035: argument type mismatch (argument 1)
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2409) : error 017: undefined symbol "glob0"
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2409) : warning 215: expression has no effect
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2409) : error 001: expected token: ";", but found "]"
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2409) : error 029: invalid expression, assumed zero
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2409) : fatal error 107: too many error messages on one line
on those lines

Код:
 if(!IsPlayerConnected(playerid))
	{
		return 0;
	}
	if(GetPlayerState(playerid) == 2)
	{
		new var0 = 0;
		while(++var0 < 200)
		{
		//2409 line -->	if(IsPlayerInRangeOfPoint(playerid, 1077936128, glob0[var0][1], glob0[var0][2], glob0[var0][3]))
			{
				if(glob0[var0][0] == 1)
				{
					new var1 = 0, var2 = 0, var3 = 0, var4 = 0;
					new var5 = GetPlayerVehicleID(playerid);
					GetVehicleDamageStatus(var5, var1, var2, var3, var4);
					var4 = functionAC4(1, 1, 1, 1);
					UpdateVehicleDamageStatus(var5, var1, var2, var3, var4);
					return 0;
				}
			}
		}
	}
Second error lines
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new var0[256];
	new var1 = 0;
	//2294  line --> var0 = functionB38(cmdtext, var1);
	if(!strcmp(var0, "/spygliai", true))
	{
		if(Policininkas[playerid] == false)
		{
			return SendClientMessage(playerid, 0x10F441AA, "Љi komanda policininkams.");
		}
		new Float:var2 = 0.0, Float:var3 = 0.0, Float:var4 = 0.0, Float:var5 = 0.0;
		GetPlayerPos(playerid, var2, var3, var4);
		GetPlayerFacingAngle(playerid, var5);
		function360(var2, var3, var4, var5);
		return 1;
	}
	if(!strcmp(var0, "/spygliaip", true))
	{
		if(Policininkas[playerid] == false)
		{
			return SendClientMessage(playerid, 0x10F441AA, "Љi komanda policininkams.");
		}
		function810(playerid);
		SendClientMessage(playerid, 0x10F441AA, "Panaikinai paskutinius padetus spyglius.");
		return 1;
	}
	if(!strcmp(var0, "/spygliaivs", true))
	{
		if(Policininkas[playerid] == false)
		{
			return SendClientMessage(playerid, 0x10F441AA, "Љi komanda policininkams.");
		}
		function644();
		SendClientMessage(playerid, 0x10F441AA, "Panaikinai visus spyglius.");
		return 1;
	}
     return 0;
}
Where is defined glob0?
What's the prototype of functionB38() (in meaning: what are the formal arguments for it)?

Greetings.



Re: error codes - karolissas - 26.08.2015

Код:
functionB38(arg0, &arg1)
{
	new var0 = strlen(arg0);
	while(arg1 < var0 && arg0[arg1] <= 32)
	{
		arg1++;
	}
	new var1 = arg1;
	new var2[20];
	while(arg1 < var0 && arg0[arg1] > 32 && arg1 - var1 < 19)
	{
		var2[arg1 - var1] = arg0[arg1];
		arg1++;
	}
	var2[arg1 - var1] = 0;
	return var2;
}



Re: error codes - karolissas - 26.08.2015

Quote:
Originally Posted by LetsOWN[PL]
Посмотреть сообщение
Where is defined glob0?
What's the prototype of functionB38() (in meaning: what are the formal arguments for it)?

Greetings.
Код:
functionB38(arg0, &arg1)
{
	new var0 = strlen(arg0);
	while(arg1 < var0 && arg0[arg1] <= 32)
	{
		arg1++;
	}
	new var1 = arg1;
	new var2[20];
	while(arg1 < var0 && arg0[arg1] > 32 && arg1 - var1 < 19)
	{
		var2[arg1 - var1] = arg0[arg1];
		arg1++;
	}
	var2[arg1 - var1] = 0;
	return var2;
}



Re: error codes - LetsOWN[PL] - 26.08.2015

Quote:
Originally Posted by karolissas
Посмотреть сообщение
Код:
functionB38(arg0, &arg1)
{
	new var0 = strlen(arg0);
	while(arg1 < var0 && arg0[arg1] <= 32)
	{
		arg1++;
	}
	new var1 = arg1;
	new var2[20];
	while(arg1 < var0 && arg0[arg1] > 32 && arg1 - var1 < 19)
	{
		var2[arg1 - var1] = arg0[arg1];
		arg1++;
	}
	var2[arg1 - var1] = 0;
	return var2;
}
So, this function can be executed for non-array arguments.
pawn Код:
functionB38(cmdtext, var1);
cmdtext in this case IS an array. Header of Your function should look like this:
pawn Код:
functionB38(arg0[], &arg1)
{
// ...
By the way, what this code is supposed to do?
The way I see it, is that it just returns part of string, starting at index of arg1 and ending in space (32) sign, and also assigns the value of variable sent via reference to number of characters returned by this command (length, string not it's size)

pawn Код:
new a = 0;
functionB38("abc def", a); // Must be 'a' because of reference. Isn't it pointless?
// returns: abc and 3 (assigned to a)
Isn't it better to use sscanf, which is obviously faster? But still, it's all up to You, whether way You'll choose

Greetings



Re: error codes - karolissas - 26.08.2015

this command suppost do add spike and remove from the last you place and all spikes


Re: error codes - karolissas - 26.08.2015

Quote:
Originally Posted by LetsOWN[PL]
Посмотреть сообщение
Where is defined glob0?
What's the prototype of functionB38() (in meaning: what are the formal arguments for it)?

Greetings.
Quote:
Originally Posted by LetsOWN[PL]
Посмотреть сообщение
So, this function can be executed for non-array arguments.
pawn Код:
functionB38(cmdtext, var1);
cmdtext in this case IS an array. Header of Your function should look like this:
pawn Код:
functionB38(arg0[], &arg1)
{
// ...
By the way, what this code is supposed to do?
The way I see it, is that it just returns part of string, starting at index of arg1 and ending in space (32) sign, and also assigns the value of variable sent via reference to number of characters returned by this command (length, string not it's size)

pawn Код:
new a = 0;
functionB38("abc def", a); // Must be 'a' because of reference. Isn't it pointless?
// returns: abc and 3 (assigned to a)
Isn't it better to use sscanf, which is obviously faster? But still, it's all up to You, whether way You'll choose

Greetings
I fix all erros only left 3 warnings
Код:
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2427) : warning 213: tag mismatch
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2428) : warning 213: tag mismatch
C:\Users\Core i5\Desktop\GRP4 EDITED\gamemodes\grandlarc.pwn(2429) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
lines
Код:
function360(Float:arg0, Float:arg1, Float:arg2, Float:arg3)
{
	for(new var0 = 0; var0 < 200; var0++)
	{
		if(!glob0[var0][0])
		{
			glob0[var0][0] = 1;
	2427 -->    glob0[var0][1] = arg0;
	2428-->	glob0[var0][2] = arg1;
	2429-->		glob0[var0][3] = arg2 - 0.6999;
			glob0[var0][4] = CreateObject(2899, arg0, arg1, arg2 - 0.8999, 0.0, 0.0, arg3 - 90, 0);
			return 1;
		}
	}
	return 0;
}



Re: error codes - BKarner - 26.08.2015

I believe I may have answered your question here:
https://sampforum.blast.hk/showthread.php?tid=586912