16.02.2017, 15:20
To set this up
now to our callbacks
search for the type of checkpoints for both dynamic and non-dynamic and know what their usage.
When you make one checkpoint and made it work, you'll get the hang of scripting it and it will be easy.
PHP код:
//add this when you start an event or enter a certain area
CreateDynamicRaceCP(type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_RACE_CP_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1)// use this if you want to add more when you enter the checkpoint then add another one of this on another area to set a checkpoint or finish the race when you enter the checkpoint
SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size) // use this when you just want a one round race like drag races or something like that.
PHP код:
public OnPlayerEnterDynamicRaceCP(playerid, STREAMER_TAG_RACE_CP checkpointid)
{
//add your code here
//use this callback when you are using the CreateDynamicRaceCP
}
public OnPlayerEnterRaceCheckpoint(playerid)//basic one
{
//add code here
//you can use this callback when you are using SetPlayerRaceCheckpoint
}
When you make one checkpoint and made it work, you'll get the hang of scripting it and it will be easy.