Checkpoints
#1

When I join on my server,and I register,i set up the age,origin and the sex and it spawn me correctly. Ok and then when I goint to the DMV cars I entered it. Then it says to type /takeexam and it shows me the first checkpoint and then the second checkpoint doesn't show me. Why ?
This is the command:
PHP код:
CMD:takeexam(playeridparams[])
{
    if(
PlayerInfo[playerid][pDriveLic] == 1) return SCM(playeridCOLOR_GREY,"You already have Driving License!");
    if(
IsPlayerInVehicle(playeriddmvc) || IsPlayerInVehicle(playeriddmvc1) || IsPlayerInVehicle(playerid,dmvc2))
    {
        
TogglePlayerControllable(playerid1);
        
CheckpointDMV[playerid] = 200;
        
SetPlayerCheckpoint(playerid1421.1475,-1699.3237,13.28884.0);
        
TakingLesson[playerid] = 1;
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"DMV: Please follow the checkpoints and drive safety!");
    }
    else return 
SCM(playeridCOLOR_GREY,"You are not in a DMV car");
    return 
1;

This is the code of checkpoints
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
CheckpointDMV[playerid]==200)//dmv_01
    
{
        if(
IsPlayerInVehicle(playeriddmvc) || IsPlayerInVehicle(playeriddmvc1) || IsPlayerInVehicle(playeriddmvc2))
        {
            
DisablePlayerCheckpoint(playerid);
            
CheckpointDMV[playerid] = 201;
            
SetPlayerCheckpoint(playerid1432.4354,-1658.6343,13.12455.0);
        }
        else
        {
            
SendClientMessage(playeridCOLOR_LIGHTBLUE,"DMV: You are not in the car!");
            
SendClientMessage(playeridCOLOR_LIGHTBLUE,"DMV: You didn't passed the test, please try again!");
            
DisablePlayerCheckpoint(playerid);
            
RemovePlayerFromVehicle(playerid);
              
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
              
TakingLesson[playerid] = 0;
        }
    }
    else if(
CheckpointDMV[playerid]==201)//dmv_02
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 202;
        
SetPlayerCheckpoint(playerid1432.3827,-1588.9227,13.13185.0);
    }
    else if(
CheckpointDMV[playerid]==202)//dmv_03
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 203;
        
SetPlayerCheckpoint(playerid1454.7500,-1480.2014,13.09785.0);
    }
    else if(
CheckpointDMV[playerid]==203)//dmv_04
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 204;
        
SetPlayerCheckpoint(playerid1457.2000,-1439.2382,13.13035.0);
    }
    else if(
CheckpointDMV[playerid]==204)//dmv_05
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 205;
        
SetPlayerCheckpoint(playerid1429.9436,-1437.6150,13.12445.0);
    }
       else if(
CheckpointDMV[playerid]==205)//dmv_06
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 206;
        
SetPlayerCheckpoint(playerid1423.7155,-1398.9248,13.12385.0);
    }
    else if(
CheckpointDMV[playerid]==206)//dmv_07
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 207;
        
SetPlayerCheckpoint(playerid1350.0922,-1393.0492,13.14695.0);
    }
    else if(
CheckpointDMV[playerid]==207)//dmv_08
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 208;
        
SetPlayerCheckpoint(playerid1106.5748,-1397.0431,13.17165.0);
    }
    else if(
CheckpointDMV[playerid]==208)//dmv_09
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 209;
        
SetPlayerCheckpoint(playerid1059.6833,-1419.8898,13.11555.0);
    }
    else if(
CheckpointDMV[playerid]==209)//dmv_10
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 210;
        
SetPlayerCheckpoint(playerid1035.0563,-1571.5737,13.13415.0);
    }
    else if(
CheckpointDMV[playerid]==210)//dmv_11
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 211;
        
SetPlayerCheckpoint(playerid1143.5441,-1574.9717,13.01215.0);
    }
    else if(
CheckpointDMV[playerid]==211)//dmv_12
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 212;
        
SetPlayerCheckpoint(playerid1289.9336,-1574.8125,13.12465.0);
    }
    else if(
CheckpointDMV[playerid]==212)//dmv_13
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 213;
        
SetPlayerCheckpoint(playerid1295.0909,-1659.1091,13.12465.0);
    }
    else if(
CheckpointDMV[playerid]==213)//dmv_14
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 214;
        
SetPlayerCheckpoint(playerid1295.0031,-1704.4797,13.12405.0);
    }
    else if(
CheckpointDMV[playerid]==214)//dmv_15
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 215;
        
SetPlayerCheckpoint(playerid1299.5117,-1817.1479,13.12455.0);
    }
    else if(
CheckpointDMV[playerid]==215)//dmv_16
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 216;
        
SetPlayerCheckpoint(playerid1300.8134,-1855.0059,13.12455.0);
    }
    else if(
CheckpointDMV[playerid]==216)//dmv_17
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 217;
        
SetPlayerCheckpoint(playerid1389.0083,-1874.1768,13.12455.0);
    }
    else if(
CheckpointDMV[playerid]==217)//dmv_18
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 218;
        
SetPlayerCheckpoint(playerid1523.0303,-1874.8875,13.12665.0);
    }
    else if(
CheckpointDMV[playerid]==218)//dmv_19
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 219;
        
SetPlayerCheckpoint(playerid1571.1161,-1872.5188,13.12525.0);
    }
    else if(
CheckpointDMV[playerid]==219)//dmv_20
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 220;
        
SetPlayerCheckpoint(playerid1572.3271,-1733.9789,13.12695.0);
    }
    else if(
CheckpointDMV[playerid]==220)//dmv_21
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 221;
        
SetPlayerCheckpoint(playerid1531.4258,-1730.1346,13.12455.0);
    }
    else if(
CheckpointDMV[playerid]==221)//dmv_22
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 222;
        
SetPlayerCheckpoint(playerid1437.5671,-1730.2736,13.12545.0);
    }
    else if(
CheckpointDMV[playerid]==222)//dmv_23
    
{
        
DisablePlayerCheckpoint(playerid);
        
CheckpointDMV[playerid] = 223;
        
SetPlayerCheckpoint(playerid1424.2367,-1694.3533,13.20305.0);
    }
    if(
CheckpointDMV[playerid] == 223)//dmv_Final
    
{
        new 
pName[24];
        new 
str[128];
        
GetPlayerName(playeridpName24);
        
pName[strfind(pName,"_")] = ' ';
        
GivePlayerCash(playerid, -500);
         
format(str128,"DMV: Congratulations %s! You passed the test."pName);
         
SendClientMessage(playeridCOLOR_LIGHTBLUEstr);
         
RemovePlayerFromVehicle(playerid);
          
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
          
TakingLesson[playerid] = 0;
        
PlayerInfo[playerid][pDriveLic] = 1;
        
DisablePlayerCheckpoint(playerid);
    }
    else
    {
        
DisablePlayerCheckpoint(playerid);
    }
    return 
1;

Reply
#2

I give rep+ for who help me
Reply
#3

"Checkpoints are asynchronous, meaning only one can be shown at a time. To 'stream' checkpoints (only show them when players are close enough), use a checkpoint streamer."

https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint

Is that what you need help with?
Reply
#4

Actually you cannot simultaneously use DisablePlayerCheckpoint and SetPlayerCheckpoint.
Just simply remove DisablePlayerCheckpoint when you are setting/updating a new CP position.

Example:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(CheckpointDMV[playerid]==200)//dmv_01
    {
        if(IsPlayerInVehicle(playerid, dmvc) || IsPlayerInVehicle(playerid, dmvc1) || IsPlayerInVehicle(playerid, dmvc2))
        {
            CheckpointDMV[playerid] = 201;
            SetPlayerCheckpoint(playerid, 1432.4354,-1658.6343,13.1245, 5.0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE,"DMV: You are not in the car!");
            SendClientMessage(playerid, COLOR_LIGHTBLUE,"DMV: You didn't passed the test, please try again!");
            RemovePlayerFromVehicle(playerid);
              SetVehicleToRespawn(GetPlayerVehicleID(playerid));
              TakingLesson[playerid] = 0;
        }
    }
    else if(CheckpointDMV[playerid]==201)//dmv_02
    {
        CheckpointDMV[playerid] = 202;
        SetPlayerCheckpoint(playerid, 1432.3827,-1588.9227,13.1318, 5.0);
    }
Reply
#5

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Actually you cannot simultaneously use DisablePlayerCheckpoint and SetPlayerCheckpoint.
Just simply remove DisablePlayerCheckpoint when you are setting/updating a new CP position.

Example:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(CheckpointDMV[playerid]==200)//dmv_01
    {
        if(IsPlayerInVehicle(playerid, dmvc) || IsPlayerInVehicle(playerid, dmvc1) || IsPlayerInVehicle(playerid, dmvc2))
        {
            CheckpointDMV[playerid] = 201;
            SetPlayerCheckpoint(playerid, 1432.4354,-1658.6343,13.1245, 5.0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE,"DMV: You are not in the car!");
            SendClientMessage(playerid, COLOR_LIGHTBLUE,"DMV: You didn't passed the test, please try again!");
            RemovePlayerFromVehicle(playerid);
              SetVehicleToRespawn(GetPlayerVehicleID(playerid));
              TakingLesson[playerid] = 0;
        }
    }
    else if(CheckpointDMV[playerid]==201)//dmv_02
    {
        CheckpointDMV[playerid] = 202;
        SetPlayerCheckpoint(playerid, 1432.3827,-1588.9227,13.1318, 5.0);
    }
Quote:
Originally Posted by FreAkeD
Посмотреть сообщение
"Checkpoints are asynchronous, meaning only one can be shown at a time. To 'stream' checkpoints (only show them when players are close enough), use a checkpoint streamer."

https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint

Is that what you need help with?
still doesn't work..
Reply
#6

bump
Reply
#7

dude, use CreateDynamicCP instead of createcheckpoint and disablecheckpoint,,,

Example this

pawn Код:
SetPlayerCheckpoint(playerid, 1432.4354,-1658.6343,13.1245, 5.0);
should be
pawn Код:
CreateDynamicCP(1432.4354,-1658.6343,13.1245,5.0 -1,-1,-1,100.0);
Now get to work :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)