Checkpoint system?? - 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: Checkpoint system?? (
/showthread.php?tid=68471)
Checkpoint system?? -
javind0 - 10.03.2009
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
Re: Checkpoint system?? -
Sandra18[NL] - 10.03.2009
Код:
new checkpoint1 = 1; <<<====
...
if(checkpoint1 == 0) <<====
{
Thats why.
Re: Checkpoint system?? -
Rks25 - 10.03.2009
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.
Re: Checkpoint system?? -
javind0 - 10.03.2009
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.
|
?
Re: Checkpoint system?? -
Rks25 - 10.03.2009
u create one, and suddenly u also do OnPlayerEnterCheckPoint?
But doesnt OnPlayerEnterCheckPoint automatically gets called when entering a checkpoint.
Re: Checkpoint system?? -
javind0 - 10.03.2009
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
Re: Checkpoint system?? -
AiVAMAN - 10.03.2009
LOL just download one of Checkpoint streamers, and everything is done..
Re: Checkpoint system?? -
javind0 - 10.03.2009
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
Re: Checkpoint system?? -
AiVAMAN - 10.03.2009
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..