PlayerToPoint...
#1

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

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

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

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.
Reply
#5

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

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

Fixed!! thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)