A weird bug or mistake - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A weird bug or mistake (
/showthread.php?tid=159190)
A weird bug or mistake -
Jochemd - 12.07.2010
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.
Re: A weird bug or mistake -
MadeMan - 12.07.2010
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;
}