Help with dmv system
#8

Script now compiles fine but you do the command /driverslic and then when you drive though the first checkpoint the second one does not show


The command.
pawn Код:
CMD:driverslic(playerid, params[])
{
        if(PlayerInfo[playerid][pCarLic] == 1) return SendClientMessage(playerid, COLOR_GREY,"You already have Driving License!");
        if(IsPlayerInVehicle(playerid, dmv1) || IsPlayerInVehicle(playerid, dmv2) || IsPlayerInVehicle(playerid,dmv3) || IsPlayerInVehicle(playerid,dmv4) || IsPlayerInVehicle(playerid,dmv5))
        {
            TogglePlayerControllable(playerid, 1);
            DCP[playerid] = 200;
            SetPlayerCheckpoint(playerid, 2073.780029,-1912.620361,13.244957, 4.0);
            TakingLesson[playerid] = 1;
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Driver Instructor says: Please follow the checkpoints and drive safety!");
        }
        else return SendClientMessage(playerid, COLOR_GREY,"You are not in a DMV car");
        return 1;
}

The code
pawn Код:
if(DCP[playerid]==200)
    {
        if(IsPlayerInVehicle(playerid, dmv1) || IsPlayerInVehicle(playerid, dmv2) || IsPlayerInVehicle(playerid, dmv3) || IsPlayerInVehicle(playerid, dmv4) || IsPlayerInVehicle(playerid, dmv5))
        {
            DisablePlayerCheckpoint(playerid);
            DCP[playerid] = 201;
            SetPlayerCheckpoint(playerid, 2073.780029,-1912.620361,13.244957, 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!");
            DisablePlayerCheckpoint(playerid);
            RemovePlayerFromVehicle(playerid);
            SetVehicleToRespawn(GetPlayerVehicleID(playerid));
            TakingLesson[playerid] = 0;
        }
    }
    else if(DCP[playerid]==201)
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Driver Instructor says: Always drive on the Right side of the road!");
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 202;
        SetPlayerCheckpoint(playerid, 2079.123291,-1871.586303,13.048537, 5.0);
    }
    else if(DCP[playerid]==202)
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Driver Instructor says: Never drink and drive!");
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 203;
        SetPlayerCheckpoint(playerid, 2079.742431,-1802.388427,13.081876, 5.0);
    }
    else if(DCP[playerid]==203)
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Driver Instructor says: Pedestrians always have the right of way!");
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 204;
        SetPlayerCheckpoint(playerid, 2087.171142,-1763.789306,13.093797, 5.0);
    }
    else if(DCP[playerid]==204)
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Driver Instructor says: Pull over to the side of the road for emergency vehicles!");
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 205;
        SetPlayerCheckpoint(playerid,2107.624023,-1750.020996,13.089978, 5.0);
    }
    else if(DCP[playerid]==205)
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Driver Instructor says: Never use your phone while driving!");
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 206;
        SetPlayerCheckpoint(playerid, 2152.177490,-1750.022827,13.082652, 5.0);
    }
    else if(DCP[playerid]==206)
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Driver Instructor says: National speed limit is 97 km/h (60 mph)!");
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 207;
        SetPlayerCheckpoint(playerid, 2182.246826,-1718.454956,13.037333, 5.0);
    }
    else if(DCP[playerid]==207)
    {
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 208;
        SetPlayerCheckpoint(playerid, 2196.131347,-1639.325927,15.037650, 5.0);
    }
    else if(DCP[playerid]==208)
    {
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 209;
        SetPlayerCheckpoint(playerid, 2210.470458,-1516.888671,23.5245725, 5.0);
    }
    else if(DCP[playerid]==209)
    {
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 210;
        SetPlayerCheckpoint(playerid, 2210.367919,-1396.513427,23.513124, 5.0);
    }
    else if(DCP[playerid]==210)
    {
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 211;
        SetPlayerCheckpoint(playerid, 2189.148681,-1387.298950,23.506103, 5.0);
    }
    else if(DCP[playerid]==211)
    {
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 212;
        SetPlayerCheckpoint(playerid,2125.980468,-1386.713378,23.509986, 5.0);
    }
    else if(DCP[playerid]==212)
    {
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 213;
        SetPlayerCheckpoint(playerid, 2115.220947,-1404.61699,23.521949, 5.0);
    }
    else if(DCP[playerid]==213)
    {
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 214;
        SetPlayerCheckpoint(playerid, 2115.123779,-1505.220458,23.473100, 5.0);
    }
    else if(DCP[playerid]==214)
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Driver Instructor says: Never get distracted while driving!");
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 215;
        SetPlayerCheckpoint(playerid,2114.831298,-1676.845214,13.123315, 5.0);
    }
    else if(DCP[playerid]==215)
    {
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 217;
        SetPlayerCheckpoint(playerid, 2098.753906,-1739.837768,13.085525, 5.0);
    }
    else if(DCP[playerid]==217)
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Driver Instructor says: Stop at intersections for atleast 3s!");
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 218;
        SetPlayerCheckpoint(playerid,2084.242431,-1822.566650,13.074979 , 5.0);
    }
    else if(DCP[playerid]==218)
    {
        DisablePlayerCheckpoint(playerid);
        DCP[playerid] = 219;
        SetPlayerCheckpoint(playerid, 2084.016845,-1890.064941,13.066734, 5.0);
    }
    else if(DCP[playerid]==219)
    {
        new pName[24];
        new str[128];
        GetPlayerName(playerid, pName, 24);
        pName[strfind(pName,"_")] = ' ';
        GivePlayerCash(playerid, -500);
        format(str, 128,"DMV: Congratulations %s! You passed the test.", pName);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
        RemovePlayerFromVehicle(playerid);
        SetVehicleToRespawn(GetPlayerVehicleID(playerid));
        TakingLesson[playerid] = 0;
        PlayerInfo[playerid][pCarLic] = 1;
        DisablePlayerCheckpoint(playerid);
    }
Reply


Messages In This Thread
Help with dmv system - by JessThompson - 05.08.2014, 21:51
Re: Help with dmv system - by DarkZeroX - 05.08.2014, 22:07
Re: Help with dmv system - by JessThompson - 05.08.2014, 22:24
Re: Help with dmv system - by JessThompson - 05.08.2014, 22:46
Re: Help with dmv system - by DarkZeroX - 05.08.2014, 22:57
Re: Help with dmv system - by JessThompson - 05.08.2014, 23:09
Re: Help with dmv system - by DarkZeroX - 05.08.2014, 23:31
Re: Help with dmv system - by JessThompson - 06.08.2014, 20:18
Re: Help with dmv system - by JessThompson - 06.08.2014, 21:06
Re: Help with dmv system - by JessThompson - 06.08.2014, 21:35

Forum Jump:


Users browsing this thread: 3 Guest(s)