[Include] [INC]Checkpoint manager
#1

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
Reply
#2

good very good! Are you the best scripter italian?
Reply
#3

yeah!!!!!!
Reply
#4

What can you do with this?
Reply
#5

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
Reply
#6

nice!!
Reply
#7

thanks!
suggestions??
Reply
#8

nice!

Reply
#9

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.
Reply
#10

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)