[Include] Checkpoint-Include by 'Pawno.
#1

Hello.

Welcome to the thread of my first include ever.
I made this include because i got some problems making checkpoints (for jobs and other) so i make this checkpoint.

Sorry for my bad english, because i live in germany and dont speak english very well!

What can i do with this Include?
With this include you can set checkpoints, and you can return the Checkpoint-ID, which must be defined in your script.
You can also set an checkpoint-type so you can better make systems like truck-systems.
Here's an little example
pawn Код:
#define CHECKPOINT_DRIVINGSCHOOL_1  1
#define CHECKPOINT_DRIVINGSCHOOL_2  2

#define CHECKPOINT_TYPE_DRIVINGSCHOOL 1

public OnPlayerEnterCheckpoint(playerid)
{
    if(GetPlayerCheckpointType(playerid) == CHECKPOINT_TYPE_DRIVINGSCHOOL)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(vehicleid == plSchoolCar[playerid])
        {
            switch(GetPlayerCheckpointID(playerid))
            {
                case CHECKPOINT_DRIVINGSCHOOL_1: SetPlayerCheckpointEx(playerid, 1337.0000, 1337.0000, 1337.0000, 5.0, CHECKPOINT_DRIVINGSCHOOL_2, CHECKPOINT_TYPE_DRIVINGSCHOOL);
                case CHECKPOINT_DRIVINGSCHOOL_2:
                {
                    SendClientMessage(playerid, COLOR_WHITE, "Congratiulations, you have passed the Driving test.");
                }
            }
        }
    }
    return 1;
}
Here are all the functions with the related declarations:
pawn Код:
SetPlayerCheckpointEx(playerid, Float:posX, Float:posY, Float:posZ, Float:cpSize, CheckPointID, CheckPointType);
DisablePlayerCheckpointEx(playerid);
GetPlayerCheckpointID(playerid);
GetPlayerCheckpointType(playerid);
Special!!
Theres an simple bug in SA-MP, so i have included an timer.
If you create an checkpoint with an size of "5.0" and if you create an other checkpoint (size "2.0", before you delete the old,
the new checkpoint gets the size "5.0". The Include fixes that.

I hope you like this include.

Information
I need an good translator from german to english, so i can make an better thread here.
Pls send me an PM.

Pastebin
Click here
Reply
#2

Push ?
Reply
#3

Dont know why no one answers this because this is actually pretty cool and usefull! Nice include!
Reply
#4

Its cool,and usefull !!
NICE !
Reply
#5

Thx
Reply
#6

push^^
Reply
#7

Quote:
Originally Posted by 'Pawno.
Посмотреть сообщение
push^^
What is "push" ? I think you mean "bump" ?
Reply
#8

@lexi
sry, "push" comes from german forums and i dont know it before u say "bump" to me ...
#bump
Reply
#9

would be better if it will make his own ids,like in y_dialog.
pawn Код:
ObtainCheckPointID(Array);
Ex:
pawn Код:
new CPID;
public OnGameModeInit()
{
    ObtainCheckPointID(CPID);
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetPlayerCheckpointType(playerid) == CPID)
    {
    }
}
Reply
#10

Little bump.
anyone use this?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)