checkpoint error
#1

trying to make a dmv system,everything works until:if a player starts /exam and gets in the car,the checkpoint is put correctly,but if he goes out,he goes back in the car and types again /exam,he instantly goes to next checkpoint,so you can finish the driving exam without moving,just get out and in the car and the checkpoint goes 1 by 1.
got this: on playerstatechange when entering the exam car

PHP код:
if(VSpecial[playerid] == 100)
        {
            
SetPlayerRaceCheckpoint(playerid0ExamenD1[ExamPoint[playerid]][0], ExamenD1[ExamPoint[playerid]][1], ExamenD1[ExamPoint[playerid]][2], ExamenD1[ExamPoint[playerid] + 1][0], ExamenD1[ExamPoint[playerid] + 1][1], ExamenD1[ExamPoint[playerid] + 1][2], 5.0);
            
EStep[playerid] += 1;
            
ExamPoint[playerid] += 1;
        } 
statechange when exiting the car
PHP код:
        if(VSpecial[playerid] == 100)
        {
        
SendClientMessage(playeridCOLOR_LIGHTBLUE2"*Exam failed,ai coborat din masina de examen.");
        
VSpecial[playerid] = 0;
        
DisablePlayerCheckpoint(playerid);
        
DisablePlayerRaceCheckpoint(playerid);
        
EStep[playerid] = 0;
        
ExamPoint[playerid] = 0;
        } 
Vspecial=100- the dmv cars

onplayerenter checkpoint
PHP код:
if(ExamPoint[playerid] < 6)
        {
            
SetPlayerRaceCheckpoint(playerid0ExamenD1[ExamPoint[playerid]][0], ExamenD1[ExamPoint[playerid]][1], ExamenD1[ExamPoint[playerid]][2], ExamenD1[ExamPoint[playerid] + 1][0], ExamenD1[ExamPoint[playerid] + 1][1], ExamenD1[ExamPoint[playerid] + 1][2], 5.0);
            
ExamPoint[playerid] += 1;
            return 
1;
        }
        else
        {
            if(
ExamPoint[playerid] == 7)
            {
                
//SetVehiclePos(vehicleid, 1857.5712,-2488.9146,13.2383);
                //SetVehicleZAngle(vehicleid, 90.0);
                
SendClientMessage(playeridCOLOR_WHITE"{00FFFF}Driving License: {FFFFFF}Acum vei sustine testul in poligon");
                
EStep[playerid] += 1;
                
ExamPoint[playerid] = 0;
                
DisablePlayerRaceCheckpoint(playerid);
                
SetPlayerRaceCheckpoint(playerid0ExamenD2[ExamPoint[playerid]][0], ExamenD2[ExamPoint[playerid]][1], ExamenD2[ExamPoint[playerid]][2], ExamenD2[ExamPoint[playerid] + 1][0], ExamenD2[ExamPoint[playerid] + 1][1], ExamenD2[ExamPoint[playerid] + 1][2], 1.0);
                return 
1;
            }
            
SetPlayerRaceCheckpoint(playerid1ExamenD1[ExamPoint[playerid]][0], ExamenD1[ExamPoint[playerid]][1], ExamenD1[ExamPoint[playerid]][2], 0.0,0.0,0.05.0);
            
ExamPoint[playerid] += 1;
            return 
1;
        }
    }
    if(
StaticVeh[vehicleid][vSpecial] == 100 && EStep[playerid] == 2)
    {
        if(
ExamPoint[playerid] < 17)
        {
            
SetPlayerRaceCheckpoint(playerid0ExamenD2[ExamPoint[playerid]][0], ExamenD2[ExamPoint[playerid]][1], ExamenD2[ExamPoint[playerid]][2], ExamenD2[ExamPoint[playerid] + 1][0], ExamenD2[ExamPoint[playerid] + 1][1], ExamenD2[ExamPoint[playerid] + 1][2], 1.0);
            
ExamPoint[playerid] += 1;
            return 
1;
        }
        else
        {
            if(
ExamPoint[playerid] == 18)
            {
                
//SetVehiclePos(vehicleid, 1965.2764,-2179.4365,13.2320);
                //SetVehicleZAngle(vehicleid, 0.0);
                 
SendClientMessage(playeridCOLOR_WHITE"{00FFFF}Driving License: {FFFFFF}Ai trecut testul in poligon,mergi inapoi in parcare");
                
EStep[playerid] += 1;
                
ExamPoint[playerid] = 0;
                  
DisablePlayerRaceCheckpoint(playerid);
                  
SetPlayerRaceCheckpoint(playerid0ExamenD3[ExamPoint[playerid]][0], ExamenD3[ExamPoint[playerid]][1], ExamenD3[ExamPoint[playerid]][2], ExamenD3[ExamPoint[playerid] + 1][0], ExamenD3[ExamPoint[playerid] + 1][1], ExamenD3[ExamPoint[playerid] + 1][2], 5.0);
                  return 
1;
            }
            
SetPlayerRaceCheckpoint(playerid1ExamenD2[ExamPoint[playerid]][0], ExamenD2[ExamPoint[playerid]][1], ExamenD2[ExamPoint[playerid]][2], 0.0,0.0,0.01.0);
              
ExamPoint[playerid] += 1;
              return 
1;
        }
    }
    if(
StaticVeh[vehicleid][vSpecial] == 100 && EStep[playerid] == 3)
    {
        if(
ExamPoint[playerid] < 5)
        {
            
SetPlayerRaceCheckpoint(playerid0ExamenD3[ExamPoint[playerid]][0], ExamenD3[ExamPoint[playerid]][1], ExamenD3[ExamPoint[playerid]][2], ExamenD3[ExamPoint[playerid] + 1][0], ExamenD3[ExamPoint[playerid] + 1][1], ExamenD3[ExamPoint[playerid] + 1][2], 5.0);
            
ExamPoint[playerid] += 1;
            return 
1;
        }
        else
        {
            if(
ExamPoint[playerid] == 6)
            {
                
SetVehicleToRespawn(vehicleid);
                  
SendClientMessage(playeridCOLOR_WHITE"{FFFFCC}License: {FFFFFF}Felicitari ! Ai fost admis.");
                if(
PlayerData[playerid][Level] == 1GivePlayerCash(playerid, -50);
                
                
PlayerData[playerid][CarLic] = 10000;
                
VSpecial[playerid] = 0;
                
mysql_format(SQLquery128"UPDATE `users` SET `CarLic`='10000' WHERE `id`='%d' LIMIT 1",PlayerData[playerid][ID]);
                
mysql_tquery(SQLquery"""");
                
DisablePlayerRaceCheckpoint(playerid);
                
EStep[playerid] = 0;
                
ExamPoint[playerid] = 0;
                  return 
1;
            }
            
SetPlayerRaceCheckpoint(playerid1ExamenD3[ExamPoint[playerid]][0], ExamenD3[ExamPoint[playerid]][1], ExamenD3[ExamPoint[playerid]][2], 0.0,0.0,0.05.0);
              
ExamPoint[playerid] += 1;
              return 
1;
        } 
whats wrong?i also reset the estep when he goes out the car,but when he goes back in,it goes to 2 estep,not 1 how it was supposed to work..ty in advance
Reply
#2

No ideas?
Reply
#3

Okay, when he get in the car (after he goes out), he is teletransported to the finish checkpoint? As like if SetPlayer/VehiclePos is used somewhere?
Reply
#4

I solved it,when the player got out of the car i set his dmv step to 0 and i also put a condition when he get in the car to have dmv set to 0,if he has >0 he gets out of the car and the test doesnt start,thank you anyway :P

SOLVED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)