27.04.2011, 09:44
(
Последний раз редактировалось Ash.; 24.12.2011 в 21:24.
)
Checkpoint Management (v2)
Good Morning all,Manage checkpoints with ease!
I'd like to present you with "Checkpoint Management".
The Brief
It allows you to manage your checkpoints accordingly with their position, size, whether a player is in someone else's checkpoint, and allows you to make a player checkpoint the same as someone else's. I made it after reading this thread. And thought it would be good to make it. However, i'm not sure it would be good for much else!
The Functions
Okay, so there's eight functions, all using the same data, as otherwise they could just be any old function. Anyway, here i will explain what they are and do.
pawn Код:
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size)
/*
Returns 1, always.
The original function, documented on the SAMP Wiki, stated that the original returned no specific value.
*/
pawn Код:
DisablePlayerCheckpoint(playerid)
/*
Returns 1, always.
The original document information, states that the original function did not return any specific value.
*/
pawn Код:
GetPlayerCheckpointPos(playerid, &Float:__x, &Float:__y, &Float:__z)
/*
Returns
0 if the players checkpoint is disabled / non-existant.
1 otherwise.
This is a new function.
*/
pawn Код:
GetPlayerCheckpointSize(playerid, &Float:__size)
/*
Returns
0 if the players checkpoint is disabled / non-existant.
1 otherwise
This is a new function.
*/
pawn Код:
IsPlayerInRangeOfCheckpoint(playerid, Float:range)
/*
Returns
-1 if the players checkpoint does not exist
0 if they are not in range of their checkpoint
1 if they are in range of their checkpoint
This is a new function
*/
pawn Код:
IsPlayerInOthersCheckpoint(playerid, playerid2)
/*
Returns
-1 if playerid2's checkpoint does not exist
1 if playerid is in playerid2's checkpoint
0 if they are not
This is a new function
*/
pawn Код:
SetPlayerCPAsPlayerCP(playerid, setplayerid)
/*
Returns
0 if playerid's checkpoint does not exist
1 otherwise.
This is a new function
*/
pawn Код:
CreateCheckpointHere(playerid, Float:size)
/*
Returns
1, always.
This is a new function
*/
pawn Код:
Float:GetDistanceToPlayerCheckpoint(playerid)
/*
Returns:
-1 if the checkpoint is inactive.
otherwise, the distance to the checkpoint.
*/
The Download Link
http://pastebin.com/iKhkhE2k
You can download the include from the download link above. (This is the updated version).
The old version: http://solidfiles.com/d/fff55/
Installation
It's simple, to begin using it just put CP.inc (or whatever you called it) in your include directory (folder), and include CP at the top of your script (but BELOW a_samp), like so:
pawn Код:
#include <a_samp>
#include <cp>
Bugs?
If you find a bug, which is highly unlikely due to this includes simplicity, post it in this thread! I'll keep checking! When i have my website set up, i will setting up a bug report section, for both my server and anything i release here - and so you will be able to post any bugs about any scripts there too soon.
Closing Message
Well, after my failure when i began to right this topic (as in, pressing post instead of preview) i think my typing skills are finally paying off. If i couldn't type as fast as i can, you'd be waiting in suspense for a lot longer than this. As i said many times above, i still have no clue what this could be used for, or if it's useful at all.
Also, i'm sorry if there are any errors in this post at all, I've been typing rather quickly in order to get this post out to you, as my failure before was rather embarrassing, shall we say?
Thank You to whichever moderator / beta tester / administrator who deleted my first post, it was most appreciated
I will consider updating this script with some more functions, as i have just thought of a few.
Oh, and a quick NOTE: (Big note) - This include will not work with a checkpoint streamer, all it will do is create the checkpoint using the native system UNLESS you are using a checkpoint streamer with the same function name. In which case it may still not work due to the fact it has not been setup for use with a streamer. If you would like me to ATTEMPT to make it work with a streamer, tell me, and tell me which streamer too.
Enjoy!
Thanks, Ash.
(Also, i think that was my longest ever post!)