[Ajuda] Como usar o "IsPlayerInRangeOfPoint" ?
#1

Eu gostaria de saber como fazer esse portгo abrir em um certo Raio de 2.0
Onde posso encaixar o IsPlayerInRangeOfPoint ??


pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/ap15", cmdtext, true) == 0)
{
MoveObject(ID15, 1991.5396,-1727.6708,4.6313,3,0.0000,0.0000,-90.2999);
SetTimer("MoveID15", 5000, 0);
SendClientMessage(playerid, 0x2641FEFF, "Portao aberto");
return true;
}
Vlw !!
Reply
#2

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
se o player estiver a beira da porta.
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1991.5396,-1727.6708,4.6313,3,0.0000,0.0000,-90.2999)== true)
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
if(
strcmp("/ap15"cmdtexttrue) == 0)
{
 if(
IsPlayerInRangeOfPoint(playerid2.01991.5396,-1727.6708,4.6313,3,0.0000,0.0000,-90.2999)== true)
{
MoveObject(ID151991.5396,-1727.6708,4.6313,3,0.0000,0.0000,-90.2999);
SetTimer("MoveID15"50000);
SendClientMessage(playerid0x2641FEFF"Portao aberto");
return 
true;
}

Reply
#3

pawn Код:
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Warnings.
Reply
#4

Tenta Assim!
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp("/ap15", cmdtext, true) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1991.5396, -1727.6708, 4.6313))
	    {
			MoveObject(ID15, 1991.5396,-1727.6708,4.6313,3,0.0000,0.0000,-90.2999);
			SetTimer("MoveID15", 5000, 0);
			SendClientMessage(playerid, 0x2641FEFF, "Portao aberto");
		}
		else
		{
		    SendClientMessage(playerid, -1, "Erro!, Vocк nгo esta proximo ao portгo!");
		}
	}
	return 1;
}
Provavelmente ira funcionar!
Procure usar ZCMD, й mais fбcil!
Reply
#5

Ai man, eu arrumei mas ainda deu um erro

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/ap15", cmdtext, true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1991.5396,-1727.6708,4.6313)== true)
{
MoveObject(ID15, 1991.5396,-1727.6708,4.6313,3,0.0000,0.0000,-90.2999);
SetTimer("MoveID15", 5000, 0);
SendClientMessage(playerid, 0x2641FEFF, "Portao aberto");
return true;
}
}

E deu o seguinte erro : warning 213: tag mismatch
Reply
#6

AdrianoStk eu botei assim e deu 2 Warnings

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/ap15", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 1991.5396, -1727.6708, 4.6313))
        {
            MoveObject(ID15, 1991.5396,-1727.6708,4.6313,3,0.0000,0.0000,-90.2999);
            SetTimer("MoveID15", 5000, 0);
            SendClientMessage(playerid, 0x2641FEFF, "Portao aberto");
        }
    return 1;
}
: warning 217: loose indentation
: warning 217: loose indentation
Reply
#7

loose indentation quer dizer que as linhas nгo estгo alinhadas conforme os parametros,
Reply
#8

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/ap15", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 1991.5396, -1727.6708, 4.6313))
        {
            MoveObject(ID15, 1991.5396,-1727.6708,4.6313,3,0.0000,0.0000,-90.2999);
            SetTimer("MoveID15", 5000, 0);
            SendClientMessage(playerid, 0x2641FEFF, "Portao aberto");
        }
    return 1;
    }
}
Reply
#9

PHP код:
public OnPlayerCommandText(playeridcmdtext[]) {
    if(!
strcmp(cmdtext"/ap15"true)) {
        if(
IsPlayerInRangeOfPoint(playerid2.01991.5396, -1727.67084.6313)) {
            
MoveObject(ID151991.5396, -1727.67084.631330.00000.0000, -90.2999);
            
SetTimer("MoveID15"50000);
            
SendClientMessage(playerid0x2641FEFF"Portao aberto");
        }
        return 
1;
    }
    return 
0;

Reply
#10

Deu certo aki ууу:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/ap15", cmdtext, true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1991.5396, -1727.6708, 4.6313))
{
MoveObject(ID15, 1991.5396,-1727.6708,4.6313,3,0.0000,0.0000,-90.2999);
SetTimer("MoveID15", 5000, 0);
SendClientMessage(playerid, 0x2641FEFF, "Portao aberto");
}
return 1;
}
Vlw a todos ai (Y)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)