SA-MP Forums Archive
Quick, small problem. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Quick, small problem. (/showthread.php?tid=120612)



Quick, small problem. - Perker12345 - 12.01.2010


I seem to have a problem when i compile my filterscript, first time i try to create something myself.
I added a proxdetector to the script, i forwarded it and made it public but, i still have errors with the things in the proxdetector

Код:
C:\Users\Wallew\Desktop\Tazer.pwn(142) : error 017: undefined symbol "GetPlayerNameEx"
C:\Users\Wallew\Desktop\Tazer.pwn(143) : error 004: function "ProxDetector" is not implemented
C:\Users\Wallew\Desktop\Tazer.pwn(150) : error 017: undefined symbol "GetPlayerNameEx"
C:\Users\Wallew\Desktop\Tazer.pwn(151) : error 004: function "ProxDetector" is not implemented
The error lines
Код:
public PlayerPlayerActionMessage(playerid,targetid,Float:radius,message[])
{
	new string[128];
	format(string, sizeof(string), "%s %s %s", GetPlayerNameEx(playerid), message,GetPlayerNameEx(targetid));
	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	return 1;
}

public PlayerActionMessage(playerid,Float:radius,message[])
{
	new string[128];
	format(string, sizeof(string), "%s %s", GetPlayerNameEx(playerid), message);
	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	return 1;
}



Re: Quick, small problem. - timmehhh - 12.01.2010

Код:
public PlayerPlayerActionMessage(playerid,targetid,Float:radius,message[])
{
	new string[128];
	format(string, sizeof(string), "%s %s %s", GetPlayerName(playerid), message,GetPlayerName(targetid));
	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	return 1;
}

public PlayerActionMessage(playerid,Float:radius,message[])
{
	new string[128];
	format(string, sizeof(string), "%s %s", GetPlayerName(playerid), message);
	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	return 1;
}

public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
	if(IsPlayerConnected(playerid))
	{
		new Float:posx, Float:posy, Float:posz;
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		new plvw, ivw;
		plvw = GetPlayerVirtualWorld(playerid);
		//radi = 2.0; //Trigger Radius
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
				if(!BigEar[i])
				{
				    ivw = GetPlayerVirtualWorld(i);

				  	if (ivw == plvw)
				  	{
				  
							GetPlayerPos(i, posx, posy, posz);
							tempposx = (oldposx -posx);
							tempposy = (oldposy -posy);
							tempposz = (oldposz -posz);
							//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
							if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
							{
								SendClientMessage(i, col1, string);
							}
							else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
							{
								SendClientMessage(i, col2, string);
							}
							else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
							{
								SendClientMessage(i, col3, string);
							}
							else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
							{
								SendClientMessage(i, col4, string);
							}
							else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
							{
								SendClientMessage(i, col5, string);
							}
						}
				}
				else
				{
					SendClientMessage(i, col1, string);
				}
			}
		}
	}//not connected
	return 1;
}



Re: Quick, small problem. - Perker12345 - 12.01.2010

Thanks!
Last errors ( I think i need your forward code )
C:\Users\Wallew\Desktop\Tazer.pwn(141) : warning 202: number of arguments does not match definition
C:\Users\Wallew\Desktop\Tazer.pwn(141) : warning 202: number of arguments does not match definition
C:\Users\Wallew\Desktop\Tazer.pwn(141) : warning 202: number of arguments does not match definition
C:\Users\Wallew\Desktop\Tazer.pwn(141) : warning 202: number of arguments does not match definition
C:\Users\Wallew\Desktop\Tazer.pwn(149) : warning 202: number of arguments does not match definition
C:\Users\Wallew\Desktop\Tazer.pwn(149) : warning 202: number of arguments does not match definition
C:\Users\Wallew\Desktop\Tazer.pwn(215) : error 010: invalid function or declaration



Re: Quick, small problem. - timmehhh - 12.01.2010

Would help if you showed the lines


Re: Quick, small problem. - Perker12345 - 12.01.2010

Код:
C:\Users\Wallew\Desktop\Tazer.pwn(133) : warning 202: number of arguments does not match definition
C:\Users\Wallew\Desktop\Tazer.pwn(133) : warning 202: number of arguments does not match definition
C:\Users\Wallew\Desktop\Tazer.pwn(133) : warning 202: number of arguments does not match definition
C:\Users\Wallew\Desktop\Tazer.pwn(133) : warning 202: number of arguments does not match definition
Код:
public PlayerPlayerActionMessage(playerid,targetid,Float:radius,message[])
{
	new string[128];
	format(string, sizeof(string), "%s %s %s", GetPlayerName(playerid), message,GetPlayerName(targetid)); // Line 133
	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	return 1;
}
Код:
C:\Users\Wallew\Desktop\Tazer.pwn(141) : warning 202: number of arguments does not match definition
C:\Users\Wallew\Desktop\Tazer.pwn(141) : warning 202: number of arguments does not match definition
Код:
public PlayerActionMessage(playerid,Float:radius,message[])
{
	new string[128];
	format(string, sizeof(string), "%s %s", GetPlayerName(playerid), message); // Line 141
	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	return 1;
}



Re: Quick, small problem. - timmehhh - 12.01.2010

I was talkin about the error


Re: Quick, small problem. - Perker12345 - 12.01.2010

Код:
public PlayerPlayerActionMessage(playerid,targetid,Float:radius,message[])
{
	new string[128];
Код:
	format(string, sizeof(string), "%s %s %s", GetPlayerName(playerid), message,GetPlayerName(targetid)); // Line 133
Код:
	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	return 1;
}
I added // line where the error is.
And my forwards, if needed.
Код:
forward PlayerActionMessage(playerid,Float:radius,message[]);
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
forward PlayerPlayerActionMessage(playerid,targetid,Float:radius,message[]);