12.07.2010, 14:05
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.
Probably the mistake is in the Dini part, but I can't find it.
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; }