A tiny problem i cant understand
#1

Hey All

Heres the problem:

pawn Код:
C:\Documents and Settings\Administrator\щемзп дтбегд\чйцешй гшк\ощзчйн\samp03asvr_R3_win32\gamemodes\grandlarc.pwn(471) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Administrator\щемзп дтбегд\чйцешй гшк\ощзчйн\samp03asvr_R3_win32\gamemodes\grandlarc.pwn(479) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\Administrator\щемзп дтбегд\чйцешй гшк\ощзчйн\samp03asvr_R3_win32\gamemodes\grandlarc.pwn(490) : error 030: compound statement not closed at the end of file (started at line 471)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Lines of it:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new idx;
    new cmd[256];

    cmd = strtok(cmdtext, idx);

if(strcmp(cmd, "/enter", true) == 0) {
if(PlayerToPoint(25.0,playerid,1331.5435,-631.6592,109.1349))//LS Outside
{
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome Home!");
    SetPlayerPos(playerid, 2003.1180, 2413.1821, 10.8494);
    return 1;
}
   
if(strcmp(cmd, "/exit", true) == 0) {
if(PlayerToPoint(25.0,playerid,2003.1180, 2413.1821, 10.8494))//Inside House
{
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Have A Good-Day!");
    SetPlayerPos(playerid, 1331.5435,-631.6592,109.1349);
    return 1;
}

    return 0;
}
Please help me fix it...

Thanks
Reply
#2

and this at the end of the script
Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
	{
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		tempposx = (oldposx -x);
		tempposy = (oldposy -y);
		tempposz = (oldposz -z);
		//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
		if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
		{
			return 1;
		}
	}
	return 0;
}




Код:
if(strcmp(cmd, "/enter", true) == 0) {
if(PlayerToPoint(25.0,playerid,1331.5435,-631.6592,109.1349))//LS Outside
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome Home!");
SetPlayerPos(playerid, 2003.1180, 2413.1821, 10.8494);
}
return 1;
}

if(strcmp(cmd, "/exit", true) == 0) {
if(PlayerToPoint(25.0,playerid,2003.1180, 2413.1821, 10.8494))//Inside House
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Have A Good-Day!");
SetPlayerPos(playerid, 1331.5435,-631.6592,109.1349);
}
return 1;
}

return 0;
}
Reply
#3

PlayerToPoint was depricated in 0.3 replaced with IsPlayerInRangeOfPoint

So you can use that, or make your own function PlayerToPoint.
Reply
#4

Quote:
Originally Posted by armyoftwo
and this at the end of the script
Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
	{
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		tempposx = (oldposx -x);
		tempposy = (oldposy -y);
		tempposz = (oldposz -z);
		//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
		if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
		{
			return 1;
		}
	}
	return 0;
}




Код:
if(strcmp(cmd, "/enter", true) == 0) {
if(PlayerToPoint(25.0,playerid,1331.5435,-631.6592,109.1349))//LS Outside
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome Home!");
SetPlayerPos(playerid, 2003.1180, 2413.1821, 10.8494);
}
return 1;
}

if(strcmp(cmd, "/exit", true) == 0) {
if(PlayerToPoint(25.0,playerid,2003.1180, 2413.1821, 10.8494))//Inside House
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Have A Good-Day!");
SetPlayerPos(playerid, 1331.5435,-631.6592,109.1349);
}
return 1;
}

return 0;
}
Thank you very much

Can be locked
Reply
#5

Quote:
Originally Posted by Taz86[Life's Good Roleplay
]
Quote:
Originally Posted by armyoftwo
and this at the end of the script
Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
	{
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		tempposx = (oldposx -x);
		tempposy = (oldposy -y);
		tempposz = (oldposz -z);
		//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
		if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
		{
			return 1;
		}
	}
	return 0;
}




Код:
if(strcmp(cmd, "/enter", true) == 0) {
if(PlayerToPoint(25.0,playerid,1331.5435,-631.6592,109.1349))//LS Outside
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome Home!");
SetPlayerPos(playerid, 2003.1180, 2413.1821, 10.8494);
}
return 1;
}

if(strcmp(cmd, "/exit", true) == 0) {
if(PlayerToPoint(25.0,playerid,2003.1180, 2413.1821, 10.8494))//Inside House
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Have A Good-Day!");
SetPlayerPos(playerid, 1331.5435,-631.6592,109.1349);
}
return 1;
}

return 0;
}
Thank you very much

Can be locked
Use IsPlayerInRangeOfPoint, Much better and faster than PlayerToPoint
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)