Mikor beszalok az autoba az elso checkpointot mutassa es a tobbit nem miert??
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(vehicleid == vizsgakocsi)
{
if(vizsgazik[playerid] == true)
{
DisablePlayerCheckpoint(playerid);
CP[playerid] = 0;
SetPlayerCheckpoint(playerid,-1644.6655,854.2914,13.3724,3.0);
vizsgatimer[playerid] = SetTimerEx(\"VizsgaTime\",1000,true,\"i\",playerid);
}
else RemovePlayerFromVehicle(playerid),SendClientMessage(playerid,RED,\"Nem fizetted ki a tanfolyamot ezért nem vizsgázhatsz!\");
}
}
public OnPlayerEnterCheckpoint(playerid)
{
switch(CP[playerid])
{
case 0:
{
SetPlayerCheckpoint(playerid,-1689.9003,853.5403,24.7344,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 1:
{
SetPlayerCheckpoint(playerid,-1710.6167,883.2687,24.7422,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 2:
{
SetPlayerCheckpoint(playerid,-1736.5791,944.0354,24.7422,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 3:
{
SetPlayerCheckpoint(playerid,-1773.3867,943.6154,24.7422,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 4:
{
SetPlayerCheckpoint(playerid,-1794.9808,916.4143,24.7422,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 5:
{
SetPlayerCheckpoint(playerid,-1797.8975,865.3364,24.7500,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 6:
{
SetPlayerCheckpoint(playerid,-1807.9396,824.3468,25.1788,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 7:
{
SetPlayerCheckpoint(playerid,-1808.1145,743.8553,35.2308,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 8:
{
SetPlayerCheckpoint(playerid,-1735.3002,727.7364,26.0094,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 9:
{
SetPlayerCheckpoint(playerid,-1710.8218,771.9761,24.7344,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 10:
{
SetPlayerCheckpoint(playerid,-1710.9835,811.4437,24.7344,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 11:
{
SetPlayerCheckpoint(playerid,-1700.3691,838.5355,24.7344,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 12:
{
SetPlayerCheckpoint(playerid,-1643.0591,837.4599,12.7072,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 13:
{
SetPlayerCheckpoint(playerid,-1575.7928,842.1969,7.1520,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 14:
{
SetPlayerCheckpoint(playerid,-1578.8510,854.2066,7.2372,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 15:
{
SetPlayerCheckpoint(playerid,-1604.9236,855.4888,7.5391,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 16:
{
SetPlayerCheckpoint(playerid,-1616.2781,859.9451,7.6875,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 17:
{
SetPlayerCheckpoint(playerid,-1629.9691,875.8057,8.7322,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 18:
{
SetPlayerCheckpoint(playerid,-1629.9691,875.8057,8.7322,3.0);
DisablePlayerCheckpoint(playerid);
CP[playerid]++;
}
case 19:
{
new Float:VHealth;
GetVehicleHealth(GetPlayerVehicleID(playerid),VHealth);
if(VHealth >= 998)
{
new year,month,day,hour,minute,sec;
getdate(year,month,day);
gettime(hour,minute,sec);
SendClientMessage(playerid,ORANGE,\"Sikeresen Átmentél a vizsgán!\");
CP[playerid] = -1;
DisablePlayerCheckpoint(playerid);
dini_IntSet(file,\"Jogsi\", PlayerInfo[playerid][Jogsi] = 1);
vizsgazik[playerid] = false;
SetVehicleToRespawn(vizsgakocsi);
KillTimer(vizsgatimer[playerid]);
vizsgatimer[playerid] = -1;
if(!fexist(file)){
dini_Create(file);
format(str,sizeof(str),\"%d,%02d,%02d %02d:%02d:%02d\",year,month,day,hour,minute,sec);
dini_Set(file,\"Név\",pName(playerid));
dini_Set(file,\"Megkapta\",str);
}
}
else
{
SendClientMessage(playerid,RED,\"Megbuktál!\");
CP[playerid] = -1;
vizsgazik[playerid] = false;
SetVehicleToRespawn(vizsgakocsi);
DisablePlayerCheckpoint(playerid);
KillTimer(vizsgatimer[playerid]);
vizsgatimer[playerid] = -1;
dini_IntSet(file,\"Jogsi\", PlayerInfo[playerid][Jogsi] = 0);
}
}
}
}