SA-MP Forums Archive
PlayerToPoint 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: PlayerToPoint Problem (/showthread.php?tid=79343)



PlayerToPoint Problem - JoeDaDude - 27.05.2009

Код:
C:\Documents and Settings\Joe\Desktop\Server\filterscripts\TimerTest.pwn(49) : error 030: compound statement not closed at the end of file (started at line 40)
pawn Код:
if(!strcmp(cmdtext, "/exit", true))
  {
    if(PlayerToPoint(1.0,playerid,2454.8635,-4314.5889,11.2693))
        {
    SetPlayerPos(playerid, -1618.4510,681.7073,7.1875);
    return 1;
  }
Not the hardest error in the world but ive tried everything i can think off


Re: PlayerToPoint Problem - Weirdosport - 27.05.2009

You didn't close a bracket:

pawn Код:
if(!strcmp(cmdtext, "/exit", true))
  {
    if(PlayerToPoint(1.0,playerid,2454.8635,-4314.5889,11.2693))
        {
    SetPlayerPos(playerid, -1618.4510,681.7073,7.1875);
    }
  return 1;
  }



Re: PlayerToPoint Problem - Laura - 21.12.2009

i have same problem whit point, i want create this command in this place. Thank you


Код:
 #include <a_samp>



#define MAPMENU 1

forward PlayerToPoint(playerid, Float:x, Float:y, Float:z);
forward PlayerToPointStripped(playerid, Float:x, Float:y, Float:z, Float:curx, Float:cury, Float:curz);



public OnPlayerCommandText(playerid, cmdtext[])
{
	 if (strcmp(cmdtext, "/test", true) == 0)
	 {
	   if(IsPlayerConnected(playerid))
	   {
	   if (PlayerToPoint(playerid,255.3,77.4,1003.6))
	   {
    	     	ShowPlayerDialog(playerid, MAPMENU, DIALOG_STYLE_LIST, "Los Santos Police Departament","Nite Stick\nSpraycan", "Take", "Cancel");
  	 }
  	 return 1;
  	 }
	 return 1;
 }
 return 0;
}

 public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == MAPMENU)
	{
		if(response)
		{
			if(listitem == 0) // Nite Stick
			{
  				GivePlayerWeapon(playerid, 3, 0);
			}
			if(listitem == 1) // Spraycan
			{
  				GivePlayerWeapon(playerid, 41, 999999);

			}
		}
	}
	return 1;
}



Re: PlayerToPoint Problem - dice7 - 21.12.2009

Use https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint instead of PlayerToPoint


Re: PlayerToPoint Problem - Snyper18 - 21.12.2009

Here..


Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/test", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerToPoint(playerid,255.3,77.4,1003.6))
{
ShowPlayerDialog(playerid, MAPMENU, DIALOG_STYLE_LIST, "Los Santos Police Departament","Nite Stick\nSpraycan", "Take", "Cancel");
}
return 1;
}
}
}
return 0;
}




Re: PlayerToPoint Problem - Laura - 22.12.2009

is not working



Код:
#include <a_samp>



#define MAPMENU 1

#define PlayerToPoint(%1, %2, %3, %4, %5) IsPlayerInRangeOfPoint(%2, %1, %3, %4, %5)



public OnPlayerCommandText(playerid, cmdtext[])
{
   if (strcmp(cmdtext, "/test", true) == 0)
   {
      if(IsPlayerConnected(playerid))
      {
      if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
      {
           ShowPlayerDialog(playerid, MAPMENU, DIALOG_STYLE_LIST, "Los Santos Police Departament","Nite Stick\nSpraycan", "Take", "Cancel");
        }
      return 1;
     }
     }
  }
  return 0;
 }



 public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == MAPMENU)
	{
		if(response)
		{
			if(listitem == 0) // Nite Stick
			{
  				GivePlayerWeapon(playerid, 3, 0);
			}
			if(listitem == 1) // Spraycan
			{
  				GivePlayerWeapon(playerid, 41, 999999);

			}
		}
	}
	return 1;
}
Код:
C:\Users\Desktop\San Andreas Server\filterscripts\test.pwn(28) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Desktop\San Andreas Server\filterscripts\test.pwn(29) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error./code]



Re: PlayerToPoint Problem - Zeex - 22.12.2009

Indent your code and you will see what is the problem in...