Checkpoint Issue
#1

Can anyone tell me why the variables are being ignored and the last checkpoint is called no matter what checkpoint is the current target?

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(FirstCheckpoint == 1 && BlastDoorsOpen == 0 && SecDoorsOpen == 0 && JetpackStolen == 0)
    {
        SetPlayerCheckpoint(playerid, 211.6523, 1812.2909, 21.8594, 1.0);
    }
   
    else if(FirstCheckpoint == 0 && BlastDoorsOpen == 0 && SecDoorsOpen == 0 && JetpackStolen == 0)
    {
        SetPlayerCheckpoint(playerid, 279.4721, 1855.4517, 8.7649, 1.0);
    }

    else if(FirstCheckpoint == 0 && BlastDoorsOpen == 1 && SecDoorsOpen == 0 && JetpackStolen == 0)
    {
        SetPlayerCheckpoint(playerid, 268.6385, 1883.4900, -30.0938, 1.0);
    }

    else if(FirstCheckpoint == 0 && BlastDoorsOpen == 1 && SecDoorsOpen == 1 && JetpackStolen == 0)
    {
        SetPlayerCheckpoint(playerid, 427.6015, 2530.6992, 16.6272, 2.0);
    }
    return 1;
}
It should work fairly straight forward, the variable values tell the server what checkpoint to set. Yet for some reason the last checkpoint gets called regardless.
Reply
#2

First use steamer for your checkpoints as in CreateDynamicCP to make more CP: http://forum.sa-mp.com/showthread.ph...hlight=steamer

Second problem you must add [playerid] in front of them for example
pawn Код:
FirstCheckpoint[playerid] == 0
So for the first checkpoint it should be
pawn Код:
if(FirstCheckpoint[playerid] == 1 && BlastDoorsOpen[playerid] == 0 && SecDoorsOpen[playerid] == 0 && JetpackStolen[playerid] == 0)
    {
        SetPlayerCheckpoint(playerid, 211.6523, 1812.2909, 21.8594, 1.0);
    }
Now you get steamer and check SetPlayerCheckpoint and edit the other variable with [playerid] in front
Reply
#3

Well I don't use a streamer as the checkpoints only become viewable at a certain distance and that isn't what I need, also the varibales are global so I don't need [playerid] attatched to them.

I just wanted to know if the code I posted above had anything wrong with it.

Thanks for replying though mate.
Reply
#4

you want it viewed at certain distance?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)