A weird bug or mistake
#1

Hello,

I created a Car license system. Now it isn't saving anymore, when a player completed the test. I show you the piece of code where it is all about.

Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
	if(DrivingLicenseTest[playerid] == 2)
	{
		DisablePlayerRaceCheckpoint(playerid);
        SetPlayerRaceCheckpoint(playerid,1,-2047.3228,-84.0272,34.9371,0,0,0,10);
        DrivingLicenseTest[playerid] = 3;
	}
	else if(DrivingLicenseTest[playerid] == 3)
	{
	    new Float:Health, folder[128];
	    GetVehicleHealth(DL_Car,Health);
	    if(Health >= 950)
		{
		    SendClientMessage(playerid,COLOR_GREEN,"Congratulations, you got your Driving License. Type /licenses to check!");
			new Playername[MAX_PLAYER_NAME];
   			GetPlayerName(playerid, Playername, MAX_PLAYER_NAME);
            if(!dini_Exists(DlInfo)) dini_Create(DlInfo);
   			format(folder, sizeof(folder), "Licenses/%s.ini", Playername);
            dini_IntSet(folder, "DrivingLicense",1);
			RemovePlayerFromVehicle(playerid);
            SetVehicleToRespawn(DL_Car);
            DisablePlayerRaceCheckpoint(playerid);
            KillTimer(DlTimer);
            DrivingLicenseTest[playerid] = 0;
		}
		else
		{
			SendClientMessage(playerid,COLOR_RED,"The car is damaged, so you failed the Driving Test!");
			SetVehicleToRespawn(DL_Car);
			KillTimer(DlTimer);
			DrivingLicenseTest[playerid] = 0;
		}
	}
	return 1;
}
Probably the mistake is in the Dini part, but I can't find it.
Reply
#2

pawn Код:
if(Health >= 950)
{
    SendClientMessage(playerid,COLOR_GREEN,"Congratulations, you got your Driving License. Type /licenses to check!");
    new Playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Playername, MAX_PLAYER_NAME);
    format(folder, sizeof(folder), "Licenses/%s.ini", Playername);
    if(!dini_Exists(folder)) dini_Create(folder);
    dini_IntSet(folder, "DrivingLicense",1);
    RemovePlayerFromVehicle(playerid);
    SetVehicleToRespawn(DL_Car);
    DisablePlayerRaceCheckpoint(playerid);
    KillTimer(DlTimer);
    DrivingLicenseTest[playerid] = 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)