checkpoint error -
PepsiCola23 - 17.11.2016
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(playerid, 0, ExamenD1[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(playerid, COLOR_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(playerid, 0, ExamenD1[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(playerid, COLOR_WHITE, "{00FFFF}Driving License: {FFFFFF}Acum vei sustine testul in poligon");
EStep[playerid] += 1;
ExamPoint[playerid] = 0;
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, ExamenD2[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(playerid, 1, ExamenD1[ExamPoint[playerid]][0], ExamenD1[ExamPoint[playerid]][1], ExamenD1[ExamPoint[playerid]][2], 0.0,0.0,0.0, 5.0);
ExamPoint[playerid] += 1;
return 1;
}
}
if(StaticVeh[vehicleid][vSpecial] == 100 && EStep[playerid] == 2)
{
if(ExamPoint[playerid] < 17)
{
SetPlayerRaceCheckpoint(playerid, 0, ExamenD2[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(playerid, COLOR_WHITE, "{00FFFF}Driving License: {FFFFFF}Ai trecut testul in poligon,mergi inapoi in parcare");
EStep[playerid] += 1;
ExamPoint[playerid] = 0;
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, ExamenD3[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(playerid, 1, ExamenD2[ExamPoint[playerid]][0], ExamenD2[ExamPoint[playerid]][1], ExamenD2[ExamPoint[playerid]][2], 0.0,0.0,0.0, 1.0);
ExamPoint[playerid] += 1;
return 1;
}
}
if(StaticVeh[vehicleid][vSpecial] == 100 && EStep[playerid] == 3)
{
if(ExamPoint[playerid] < 5)
{
SetPlayerRaceCheckpoint(playerid, 0, ExamenD3[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(playerid, COLOR_WHITE, "{FFFFCC}License: {FFFFFF}Felicitari ! Ai fost admis.");
if(PlayerData[playerid][Level] == 1) GivePlayerCash(playerid, -50);
PlayerData[playerid][CarLic] = 10000;
VSpecial[playerid] = 0;
mysql_format(SQL, query, 128, "UPDATE `users` SET `CarLic`='10000' WHERE `id`='%d' LIMIT 1",PlayerData[playerid][ID]);
mysql_tquery(SQL, query, "", "");
DisablePlayerRaceCheckpoint(playerid);
EStep[playerid] = 0;
ExamPoint[playerid] = 0;
return 1;
}
SetPlayerRaceCheckpoint(playerid, 1, ExamenD3[ExamPoint[playerid]][0], ExamenD3[ExamPoint[playerid]][1], ExamenD3[ExamPoint[playerid]][2], 0.0,0.0,0.0, 5.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
Re: checkpoint error -
PepsiCola23 - 18.11.2016
No ideas?
Respuesta: checkpoint error -
Swedky - 18.11.2016
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?
Re: checkpoint error -
PepsiCola23 - 18.11.2016
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