[RESOVLED]Empty Statement(PlayerToPoint) and Checkpoints
#1

I have two quick questions
--------------------------
(1) I have a timer that checks if a player is near a certatin position, if true creates a checkpoint.

pawn Код:
public timer()
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        if(PlayerToPoint(10.0,i,-2047.0293,-100.7723,35.1641)==0);//line 47
        {
            SetPlayerCheckpoint(i,-2047.0293,-100.7723,35.1641,10);
        }
    }
}
I get the error that line 47 is an empty statement.
----------------------------------------------------------------------------------------
(2) Also I have multiple checkpoints that are activated at a certain time. Under "OnPlayerEnterCheckpoint" how can I make it so that a different thing happens for each checkpoint? Is there a way to define them?

Thanks!
Reply
#2

remove the ==0 thingy i guess
Reply
#3

Quote:
Originally Posted by Moustafa
remove the ==0 thingy i guess
That is what I had at first; same problem.
Reply
#4

Anyone? Other scripts have it formated exactly the same but this one says empty statement
Reply
#5

pawn Код:
if(PlayerToPoint(10.0,i,-2047.0293,-100.7723,35.1641)==0);
should be:
pawn Код:
if(PlayerToPoint(10.0,i,-2047.0293,-100.7723,35.1641)==0)
You forgot to remove ;
Reply
#6

(1)
pawn Код:
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        if(PlayerToPoint(10.0,i,-2047.0293,-100.7723,35.1641))
        {
            SetPlayerCheckpoint(i,-2047.0293,-100.7723,35.1641,10);
        }
    }
}
(2) You cant have multiple checkpoints at once, unless using a streamer. If using a streamer, theres normally a guide within it.
Reply
#7

pawn Код:
forward timer();
public timer()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerToPoint(10.0,i,-2047.0293,-100.7723,35.1641)==0)
{
SetPlayerCheckpoint(i,-2047.0293,-100.7723,35.1641,10);
return 0;
}
Just another suggestion.
Reply
#8

pawn Код:
forward timer();
public timer()
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        if(PlayerToPoint(10.0, i, -2047.0293, -100.7723, 35.1641))
        {
            SetPlayerCheckpoint(i,-2047.0293,-100.7723,35.1641,10);
            return 1;
        }
    }
    return 1;
}
Try that, it probably isn't right but oh well, most likely it's not what you wanted. :P
Reply
#9

Quote:
Originally Posted by Don Correlli
pawn Код:
if(PlayerToPoint(10.0,i,-2047.0293,-100.7723,35.1641)==0);
should be:
pawn Код:
if(PlayerToPoint(10.0,i,-2047.0293,-100.7723,35.1641)==0)
You forgot to remove ;
Thanks! I can't believe that I didn't notice that :P

Also thanks to everyone else for helping
Reply
#10

pawn Код:
{
    for(new i = 0, j = GetMaxPlayers(); i < j; i++)
Would be better to use that type of loop if you are going to use GetMaxPlayers as it will save a ton of function calls (won't effect sync) or better yet adjust your MAX_PLAYERS using:

pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS //(some number here)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)