Checkpoint system??
#1

pawn Код:
if(strcmp(cmd, "/roadsweep", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(PlayerInfo[playerid][pJob] == 17)
        {
                SendClientMessage(playerid, COLOR_GREEN, "You are now sweeping, please drive a sweeper to the first checkpoint");
                new checkpoint1 = 1;
                new checkpoint2 = 0;
                if(checkpoint1 == 0)
                {
                  SetPlayerCheckpoint(playerid, 1724.9197,2280.1985,10.5474, 3.0);
                  OnPlayerEnterCheckpoint(playerid);
                    {
                      checkpoint1 = 0;
                      checkpoint2 = 1;
                      DisablePlayerCheckpoint(playerid);
                      return 1;
                    }
                }
                else if(checkpoint2 == 1)
                {
                  SetPlayerCheckpoint(playerid, 1574.1616,2275.9275,10.4686, 3.0);
                  OnPlayerEnterCheckpoint(playerid);
                  {
                    checkpoint2 = 0;
                        DisablePlayerCheckpoint(playerid);
                        return 1;
                    }
                }
                else
                {
                  SendClientMessage(playerid, COLOR_RED, "You dont have the job/the script is faaaked");
                  return 1;
                }
            }
        }
    }
What's up? Why doesn't it create a checkpoint
Reply
#2

Код:
new checkpoint1 = 1; <<<====
...
if(checkpoint1 == 0) <<====
{
Thats why.
Reply
#3

this is t messed up code. just use SetPlayerCheckPoint and variables
And give those variables a value. At OnPlayerEnterCheckpoint match witch value got which result.
Reply
#4

Quote:
Originally Posted by =>Sandra<=
Код:
new checkpoint1 = 1; <<<====
...
if(checkpoint1 == 0) <<====
{
Thats why.
OH GOD /facepalm haha thanks :P

Quote:
Originally Posted by Rks_
this is t messed up code. just use SetPlayerCheckPoint and variables
And give those variables a value. At OnPlayerEnterCheckpoint match witch value got which result.
?
Reply
#5

u create one, and suddenly u also do OnPlayerEnterCheckPoint?
But doesnt OnPlayerEnterCheckPoint automatically gets called when entering a checkpoint.
Reply
#6

Quote:
Originally Posted by Rks_
u create one, and suddenly u also do OnPlayerEnterCheckPoint?
But doesnt OnPlayerEnterCheckPoint automatically gets called when entering a checkpoint.
Yeah but I want it to do differant things for each checkpoint (setting that checkpoint to 0 and the next to 1) :S
Reply
#7

LOL just download one of Checkpoint streamers, and everything is done..
Reply
#8

Quote:
Originally Posted by [TK
Aiva ]
LOL just download one of Checkpoint streamers, and everything is done..
I don't want a checkpoint streamer sir! :P

The end result is that on each checkpoint you get $2. (But I can add that line in later)

EDIT:
Ohh I see

https://sampwiki.blast.hk/wiki/CPS


Ok trying now
Reply
#9

Quote:
Originally Posted by javind0
Quote:
Originally Posted by [TK
Aiva ]
LOL just download one of Checkpoint streamers, and everything is done..
I don't want a checkpoint streamer sir! :P

The end result is that on each checkpoint you get $2. (But I can add that line in later)

EDIT:
Ohh I see

https://sampwiki.blast.hk/wiki/CPS


Ok trying now
so, checkpoint streamer is better than code you have written here..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)