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