Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined _CheckPointAnd_included
- #endinput
- #endif
- #define _CheckPointAnd_included
- #include <a_samp>
- /*
- native OnPlayerInCheckpoint(playerid, checkpointid);
- native OnPlayerOutCheckpoint(playerid, checkpointid);
- native ShowPlayerCheckpoint(playerid, checkpointid, Float:x, Float:y, Float:z, Float:size); checkpointid can't be '0'
- native IsPlayerInCP(playerid, checkpointid);
- */
- forward ShowPlayerCheckpoint(playerid, checkpointid, Float:x, Float:y, Float:z, Float:size);
- forward (playerid, checkpointid);
- new checkpointid1[MAX_PLAYERS];
- new InCp[MAX_PLAYERS];
- public OnPlayerEnterCheckpoint(playerid) // From SA:MP
- {
- new cpid = checkpointid1[playerid];
- CallLocalFunction("OnPlayerInCheckpoint", "dd", playerid, cpid);
- InCp[playerid] = 1;
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid) // From SA:MP
- {
- new cpid = checkpointid1[playerid];
- CallLocalFunction("OnPlayerOutCheckpoint", "dd", playerid, cpid);
- InCp[playerid] = 0;
- checkpointid1[playerid] = 0;
- return 1;
- }
- //By Me
- public ShowPlayerCheckpoint(playerid, checkpointid, Float:x, Float:y, Float:z, Float:size)
- {
- DisablePlayerCheckpoint(playerid);
- checkpointid1[playerid] = checkpointid;
- SetPlayerCheckpoint(playerid, x, y, z, size);
- return 1;
- }
- public IsPlayerInCP(playerid, checkpointid)
- {
- if(InCp[playerid] == 0) return 0;
- new cpid = checkpointid1[playerid];
- if(checkpointid != cpid) return 0;
- return 1;
- }
- forward OnPlayerInCheckpoint(playerid, checkpointid);
- forward OnPlayerOutCheckpoint(playerid, checkpointid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement