PlayerToPoint Problem
#1

Код:
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
Reply
#2

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;
  }
Reply
#3

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;
}
Reply
#4

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

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;
}

Reply
#6

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]
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)