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



PlayerToPoint... - Luis- - 13.08.2010

Hello, I made this with PlayerToPoint but it is not compiling.

pawn Код:
dcmd_opengate(playerid, params[])
{
    {
        #pragma unused params
        if (PlayerToPoint(5.0, playerid, 1593.70690918, -1638.02673340,12.91628456))
        MoveObject(LSPD, 1593.70690918, -1638.02673340,12.91628456, 2.00);
        SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds
        SendClientMessage(playerid, COLOR_WHITE ,"You are opening a Gate it will close in 7 seconds");
        return 1;
    }
    else if(PlayerToPoint(5.0, playerid, 1415.57385254, -1652.72680664, 12.63281250))
    {
        MoveObject(LF, 1415.57385254, -1652.72680664, 12.63281250, 2.00);
        SetTimer("closeLF", 7000, 0);
        SendClientMessage(playerid, COLOR_WHITE ,"You are opening a Gate it will close in 7 seconds");
        return 1;
    }
    return 1;
}



Re: PlayerToPoint... - Claude - 13.08.2010

Use IsPlayerInRangeOfPoint
Now you ask, Why?
It is faster, and it has the same effect as that
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: PlayerToPoint... - Luis- - 13.08.2010

Alright I still get errors after adding it and replacing it with the PlayerToPoint :/


Re: PlayerToPoint... - FoxtrotZulu - 13.08.2010

The whole point of a compiler window is to show you any problems that happen when you try to compile. Copy and paste the errors here.


Re: PlayerToPoint... - Luis- - 13.08.2010

Код:
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LSRP.pwn(820) : error 029: invalid expression, assumed zero
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LSRP.pwn(820) : warning 215: expression has no effect
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LSRP.pwn(820) : error 001: expected token: ";", but found "if"
C:\Users\BooNii3\Geramia RP\LS-RP\gamemodes\LSRP.pwn(820) : warning 225: unreachable code



Re: PlayerToPoint... - ikey07 - 13.08.2010

pawn Код:
dcmd_opengate(playerid, params[])
{
    #pragma unused params
    if (IsPlayerInRangeOfPoint(playerid, 5.0,1593.70690918, -1638.02673340,12.91628456))
    {
        MoveObject(LSPD, 1593.70690918, -1638.02673340,12.91628456, 2.00);
        SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds
        SendClientMessage(playerid, COLOR_WHITE ,"You are opening a Gate it will close in 7 seconds");
        return 1;
    }
    else if(IsPlayerInRangeOfPoint(playerid, 5.0,1415.57385254, -1652.72680664, 12.63281250))
    {
        MoveObject(LF, 1415.57385254, -1652.72680664, 12.63281250, 2.00);
        SetTimer("closeLF", 7000, 0);
        SendClientMessage(playerid, COLOR_WHITE ,"You are opening a Gate it will close in 7 seconds");
        return 1;
    }
    return 1;
}
Think logical what you write


Re: PlayerToPoint... - Luis- - 13.08.2010

Fixed!! thank you!