27.06.2012, 06:58
When player finishing the lesson before 10 seconds he is completing but if he finishing after 15 seconds he failed..
how can i remove it?
here is all the code:
Handling of checkpoints and end.
[SPOILER]
[/SPOILER]
the timer:
[SPOILER]
I want to make if the vehicle damage is in the half or something.
how can i remove it?
here is all the code:
Handling of checkpoints and end.
[SPOILER]
Код:
if(LCP[playerid] == 1) { LCP[playerid] = 2; DisablePlayerCheckpoint(playerid); lesstimer[playerid] = SetTimerEx("CountLess",50000,1,"d",playerid); CountLesson(playerid); SetPlayerCheckpoint(playerid,1048.2941,-1569.6752,13.3897,4.0); return 1; } else if(LCP[playerid] == 2) { LCP[playerid] = 3; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid ,1052.4055,-1497.7384,13.3906,4.0); return 1; } else if(LCP[playerid] == 3) { LCP[playerid] = 4; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid ,926.8358,-1486.8878,13.3692 ,4.0); return 1; } else if(LCP[playerid] == 4) { LCP[playerid] = 5; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid ,914.9916,-1583.5110,13.3828,4.0); return 1; } else if(LCP[playerid] == 5) { LCP[playerid] = 6; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid ,914.8621,-1764.9849,13.3828,4.0); return 1; } else if(LCP[playerid] == 6) { LCP[playerid] = 7; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid ,812.6445,-1752.9608,13.3878,4.0); return 1; } else if(LCP[playerid] == 7) { LCP[playerid] = 8; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid ,909.1068,-1574.6654,13.3828,4.0); return 1; } else if(LCP[playerid] == 8) { LCP[playerid] = 9; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid ,1025.4343,-1574.8568,13.3828,4.0); return 1; } else if(LCP[playerid] == 9) { LCP[playerid] = 10; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid ,1269.6488,-1574.7537,13.3828,4.0); return 1; } else if(LCP[playerid] == 10) { LCP[playerid] = 0; DisablePlayerCheckpoint(playerid); new Float:health; new vid = GetPlayerVehicleID(playerid); GetVehicleHealth(vid, health); if(lessons[playerid]==1 && health >= 950) { if(GetCash(playerid) >= DrivingTestCash) { GameTextForPlayer(playerid, "~r~-$3000", 5000, 1); PlayerInfo[playerid][pCarLic] = 1; SendClientMessage(playerid, COLOR_WHITE, "Enjoy your license, and dont forget drive carefully!"); GiveCash(playerid, -DrivingTestCash); } else return SendClientMessage(playerid, COLOR_WHITE, "You have complete your driving license but you don`t have the money for the license"); } else { SendClientMessage(playerid, COLOR_WHITE, "You failed!"); KillTimer(lessontimer[playerid]); lseconds[playerid]=60; } KillTimer(lesstimer[playerid]); KillTimer(lessontimer[playerid]); lseconds[playerid]=60; new carid = GetPlayerVehicleID(playerid); SetVehicleToRespawn(carid); return 1; } DisablePlayerCheckpoint(playerid); return 1; }
the timer:
[SPOILER]
Код:
forward CountLesson(playerid); public CountLesson(playerid) { new string[256]; format(string, sizeof(string), "~w~%d", lseconds[playerid]); GameTextForPlayer(playerid, string, 1200, 3); if(lseconds[playerid] != 0) { lseconds[playerid]--; KillTimer(lessontimer[playerid]); lessontimer[playerid] = SetTimerEx("CountLesson",1000,1,"d",playerid); } else { KillTimer(lessontimer[playerid]); lessons[playerid]=0; lseconds[playerid]=60; SendClientMessage(playerid, COLOR_WHITE, "You failed!"); KillTimer(lesstimer[playerid]); DisablePlayerCheckpoint(playerid); SetVehicleToRespawn(GetPlayerVehicleID(playerid)); } } [/SPOILER]