SA-MP Forums Archive
[Include] [INC]Checkpoint manager - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC]Checkpoint manager (/showthread.php?tid=12816)



[INC]Checkpoint manager - roby65 - 18.09.2007

This inc is to create checkpoints in the easiest way:

you define the area where the checkpoint has to appear, it's position, and when OnPlayerEnterCheckpoint is called, you can know in what checkpoint he entered!

first, the link: http://rapidshare.com/files/56568239/CM.rar

now, let's explain how to "install" it

first, you have to copy the CM.inc into the include folder

then, it's time to code!

put this in OnGameModeInit:
Code:
SetTimer("CMCheck",500,1);
then, to add an "area" and a checkpoint for this area, just do this:
Code:
new areaid = CMAdd(minx, miny, maxx, maxy,check_x, check_y,check_z,check_radius);
the last thing, now.
put this in OnPlayerEnterCheckpoint to know the checkpoint id:
Code:
new id=CMGetCheckID(playerid);
for example:
Code:
public OnPlayerEnterCheckpoint(playerid)
{
	new id=CMGetCheckID(playerid);
	new string[50];
	format(string,50,"OnPlayerEnterCheckpoint(%d,%d)",playerid,id);
	SendClientMessageToAll(0xAA0000FF,string);
	return 1;
}
enjoy, and tell me if there are bugs or you have suggestions

Roby65


Re: [INC]Checkpoint manager - ciola90 - 18.09.2007

good very good! Are you the best scripter italian?


Re: [INC]Checkpoint manager - roby65 - 18.09.2007

yeah!!!!!!


Re: [INC]Checkpoint manager - Hiphop - 18.09.2007

What can you do with this?


Re: [INC]Checkpoint manager - roby65 - 18.09.2007

you can add multiple checkpoints with few commands, and checkpoints will be automatically activated when the player enters checkpoint area.
and if the player enter in a checkpoint, you can know what is the checkpoint's id so you can do different things with many checkpoints


Re: [INC]Checkpoint manager - Alejandro - 19.09.2007

nice!!


Re: [INC]Checkpoint manager - roby65 - 19.09.2007

thanks!
suggestions??


Re: [INC]Checkpoint manager - bossapro - 07.10.2007

nice!




Re: [INC]Checkpoint manager - chris23 - 28.10.2007

hi!

i have problems to compile the CM_test.pwn, it tells me:

CM_test.pwn(1 : warning 204: symbol is assigned a value that is never used: "ch2"
CM_test.pwn(17) : warning 204: symbol is assigned a value that is never used: "ch1"

how to get it started?

regards, chris.


Re: [INC]Checkpoint manager - TheSh@rk - 28.10.2007

chris23:
It's just an warning...
If you can't find a way to use the strings just remove them (if you don't need them)
Or you can type at the end of the script:
pawn Code:
#pragma unused ch1, ch2
roby65:
Nice!