if(GetPVarInt(playerid, "LicenseCP") != 0)
{
new cnt = GetPVarInt(playerid, "LicenseCP");
if(DriveCP[cnt][3] == 23)
{
new Float:Health;
GetVehicleHealth(GetPlayerVehicleID(playerid), Health);
if(Health > 700)
{
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SetPVarInt(playerid, "LicenseCP",0);
DisablePlayerCheckpoint(playerid);
PlayerInfo[playerid][driverlic]=1;
SendClientInfo(playerid, "Congratulations, you passed the driving test.");
}
else if(Health < 699)
{
DisablePlayerCheckpoint(playerid);
SetPVarInt(playerid, "LicenseCP",0);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientInfo(playerid, "You have damaged your vehicle, therefore you failed the driving test.");
}
}
cnt++;
SetPVarInt(playerid, "LicenseCP", cnt);
KillTimer(CPTimer[playerid]);
DisablePlayerCheckpoint(playerid);
CPTimer[playerid] = SetTimerEx("SetCP", 200, true, "dffff", playerid, DriveCP[cnt][0],DriveCP[cnt][1],DriveCP[cnt][2], 5.0);
return 1;
}
Print something for debugging. If it doesn't print anything that part of code is not getting called at all
|
if(DriveCP[cnt][3] == 23)
OnPlayerEnterCheckpoint works only with checkpointid. So, that his whole code will not be called(even debug will not show anything) since he is using pvars. Hence, he cam move to OnPlayerEnterRaceCheckpoint which works with only playerid.
|
if(GetPVarInt(playerid, "LicenseCP") != 0)
{
new cnt = GetPVarInt(playerid, "LicenseCP");
if(GetPVarInt(playerid, "LicenseCP") <= 23)
{
new Float:Health;
GetVehicleHealth(GetPlayerVehicleID(playerid), Health);
if(Health > 700)
{
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SetPVarInt(playerid, "LicenseCP",0);
DisablePlayerCheckpoint(playerid);
PlayerInfo[playerid][driverlic]=1;
SendClientInfo(playerid, "Congratulations, you passed the driving test.");
}
else if(Health < 699)
{
DisablePlayerCheckpoint(playerid);
SetPVarInt(playerid, "LicenseCP",0);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SendClientInfo(playerid, "You have damaged your vehicle, therefore you failed the driving test.");
}
}
cnt++;
SetPVarInt(playerid, "LicenseCP", cnt);
KillTimer(CPTimer[playerid]);
DisablePlayerCheckpoint(playerid);
CPTimer[playerid] = SetTimerEx("SetCP", 200, true, "dffff", playerid, DriveCP[cnt][0],DriveCP[cnt][1],DriveCP[cnt][2], 5.0);
return 1;
}
How the hell does it change anything? Except for shape yes.
whats this? Код:
if(DriveCP[cnt][3] == 23) |
new cnt = GetPVarInt(playerid, "LicenseCP");
PHP код:
|
if(GetPVarInt(playerid, "LicenseCP") <= 23)
cnt stands for this
PHP код:
PHP код:
|