Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- #define FILTERSCRIPT
- #include <a_samp>
- #include <dudb>
- #include <dutils>
- #include <core>
- #include <float>
- #include <time>
- #include <file>
- #include <Dini>
- #define GUN_LICENSE_PRICE 500
- #define DRIVING_LICENSE_PRICE 800
- #define FLYING_LICENSE_PRICE 2000
- #define FIRST_CHECKPOINT 1
- #define SECOND_CHECKPOINT 2
- #define THIRD_CHECKPOINT 3
- #define FORTH_CHECKPOINT 4
- #define FIVTH_CHECKPOINT 5
- #define SIXTH_CHECKPOINT 6
- #define SEVENTH_CHECKPOINT 7
- #define EIGHT_CHECKPOINT 8
- #define NINTH_CHECKPOINT 9
- #define TENTH_CHECKPOINT 10
- #define ELEVENTH_CHECKPOINT 11
- #define TWELVTH_CHECKPOINT 12
- #define THERTYTH_CHECKPOINT 13
- #define FORTHYTH_CHECKPOINT 14
- #define FIVTYTH_CHECKPOINT 15
- #define FIRSTS_CHECKPOINT 16
- #define SECONDS_CHECKPOINT 17
- #define THIRDS_CHECKPOINT 18
- #define FORTHS_CHECKPOINT 19
- #define FIVTHS_CHECKPOINT 20
- #define SIXTHS_CHECKPOINT 21
- #define SEVENTHS_CHECKPOINT 22
- #define EIGHTS_CHECKPOINT 23
- #define NINTHS_CHECKPOINT 24
- #define TENTHS_CHECKPOINT 25
- #define ELEVENTHS_CHECKPOINT 26
- #define TWELVTHS_CHECKPOINT 27
- #define THERTYTHS_CHECKPOINT 28
- #define grey 0xCECECEFF
- #define yellow 0xFFFF00FF
- #define aquablue 0x00FFFFAA
- enum Info
- {
- DrivingLicense,
- FlyingLicense,
- GunLicense,
- DrivingTest,
- FlyingTest,
- };
- new PlayerInfo[MAX_PLAYERS][Info];
- new Club1;
- new Club2;
- new Club3;
- new Shamal1;
- new Shamal2;
- new Shamal3;
- new gPlayerDrivingCheckpoints[MAX_PLAYERS];
- new gPlayerFlyingCheckpoints[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- Club1 = AddStaticVehicle(589,-2063.9539,-82.2557,34.8221,180.2107,1,1); // Club
- Club2 = AddStaticVehicle(589,-2068.3794,-82.2090,34.8230,179.5051,1,1); // Club
- Club3 = AddStaticVehicle(589,-2072.4880,-82.2655,34.8234,180.5852,1,1); // Club
- Shamal1 = AddStaticVehicle(519,-1371.1809,-232.4000,15.0783,315.6083,1,1); // Shamal
- Shamal2 = AddStaticVehicle(519,-1341.1012,-254.3704,15.0840,321.6337,1,1); // Shamal
- Shamal3 = AddStaticVehicle(519,-1206.2556,-146.5825,15.0670,134.1345,1,1); // Shamal
- print("\n--------------------------------------");
- print(" Advance License System by DJ_Justin Loaded With succes.");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Advance License System by DJ_Justin UnLoaded With succes.");
- print("----------------------------------\n");
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- SetPlayerCheckpoint(playerid,5.0,-2031.7733,-116.9298,1035.1719,3.0); // De checkpoint voor de license
- SetPlayerMapIcon(playerid,0,-2026.6221,-99.6382,35.1641,55,0);
- new formatZ[256];
- format(formatZ,sizeof(formatZ),"%s.Account.txt",PlayerName(playerid));
- if(!udb_Exists(formatZ))
- {
- udb_Create(formatZ,"209010");
- }
- PlayerInfo[playerid][DrivingLicense] = dUserINT(formatZ).("CarLicense");
- PlayerInfo[playerid][FlyingLicense] = dUserINT(formatZ).("FlyLicense");
- PlayerInfo[playerid][GunLicense] = dUserINT(formatZ).("GunLicense");
- PlayerInfo[playerid][DrivingTest] = 0;PlayerInfo[playerid][FlyingTest] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new formatZ2[256];
- format(formatZ2,sizeof(formatZ2),"%s.Account.txt",PlayerName(playerid));
- dUserSetINT(formatZ2).("CarLicense",PlayerInfo[playerid][DrivingLicense]);
- dUserSetINT(formatZ2).("FlyLicense",PlayerInfo[playerid][FlyingLicense]);
- dUserSetINT(formatZ2).("GunLicense",PlayerInfo[playerid][GunLicense]);
- PlayerInfo[playerid][DrivingTest] = 0;PlayerInfo[playerid][FlyingTest] = 0;
- return 1;
- }
- stock PlayerName(playerid)
- {
- new name[255];
- GetPlayerName(playerid, name, 255);
- return name;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName,sizeof(pName));
- new string[248];
- if (strcmp("/licenses", cmdtext, true, 10) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid,5.0,-2031.7733,-116.9298,1035.1719))
- {
- new dtests[] = "1\tDriving License - 800$\n2\tFlying License - 2000$\n3\tGun License - 500$";
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Licenses, Chose One:",dtests,"Test","Exit");
- return 1;
- }
- else if(!IsPlayerInRangeOfPoint(playerid,5.0,-2031.7733,-116.9298,1035.1719))
- {
- SendClientMessage(playerid,grey,"--> This command is only used at the SanFiero School.");
- }
- return 1;
- }
- if (strcmp("/sl", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid,grey," Use: /sl [driving/flying/gun].");
- return 1;
- }
- if (strcmp("/sl driving", cmdtext, true, 10) == 0)
- {
- if(PlayerInfo[playerid][DrivingLicense] == 0)
- {
- format(string,sizeof(string)," %s doesnt have a valid Driving License",pName);
- SendClientMessageToAll(aquablue,string);
- }
- else if(PlayerInfo[playerid][DrivingLicense] == 1)
- {
- format(string,sizeof(string)," %s shows a legit Driving License.",pName);
- SendClientMessageToAll(aquablue,string);
- }
- return 1;
- }
- if (strcmp("/sl flying", cmdtext, true, 10) == 0)
- {
- if(PlayerInfo[playerid][FlyingLicense] == 0)
- {
- format(string,sizeof(string)," %s doesn't have a valid Flying License",pName);
- SendClientMessageToAll(aquablue,string);
- }
- else if(PlayerInfo[playerid][FlyingLicense] == 1)
- {
- format(string,sizeof(string)," %s shows a legit Flying License.",pName);
- SendClientMessageToAll(aquablue,string);
- }
- }
- if (strcmp("/sl gun", cmdtext, true, 10) == 0)
- {
- if(PlayerInfo[playerid][GunLicense] == 0)
- {
- format(string,sizeof(string)," %s doesn't have a valid Gun License",pName);
- SendClientMessageToAll(aquablue,string);
- }
- else if(PlayerInfo[playerid][GunLicense] == 1)
- {
- format(string,sizeof(string)," %s shows a legit Gun License.",pName);
- SendClientMessageToAll(aquablue,string);
- }
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- if(vehicleid == Club1 && PlayerInfo[playerid][DrivingTest] == 1)
- {
- GameTextForPlayer(playerid," ~y~ Test ~r~ Failed ~n~ ~w~ Because you have left the car.~n~ Visit the license center to try again.",4000,3);
- new testcar;
- testcar = GetPlayerVehicleID(playerid);
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawn(testcar);
- PlayerInfo[playerid][DrivingTest] = 0;
- DisablePlayerRaceCheckpoint(playerid);
- }
- else if(vehicleid == Club2 && PlayerInfo[playerid][DrivingTest] == 1)
- {
- GameTextForPlayer(playerid," ~y~ Test ~r~ Failed ~n~ ~w~ Because you have left the car.~n~ Visit the license center to try again.",4000,3);
- new testcar;
- testcar = GetPlayerVehicleID(playerid);
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawn(testcar);
- PlayerInfo[playerid][DrivingTest] = 0;
- DisablePlayerRaceCheckpoint(playerid);
- }
- else if(vehicleid == Club3 && PlayerInfo[playerid][DrivingTest] == 1)
- {
- GameTextForPlayer(playerid," ~y~ Test ~r~ Failed ~n~ ~w~ Because you have left the car.~n~ Visit the license center to try again.",4000,3);
- new testcar;
- testcar = GetPlayerVehicleID(playerid);
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawn(testcar);
- PlayerInfo[playerid][DrivingTest] = 0;
- DisablePlayerRaceCheckpoint(playerid);
- }
- else if(vehicleid == Shamal1 && PlayerInfo[playerid][FlyingTest] == 1)
- {
- GameTextForPlayer(playerid," ~y~ Test ~r~ Failed ~n~ ~w~ Because you have left the plane.~n~ Visit the license center to try again.",4000,3);
- new testcar;
- testcar = GetPlayerVehicleID(playerid);
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawn(testcar);
- PlayerInfo[playerid][FlyingTest] = 0;
- DisablePlayerRaceCheckpoint(playerid);
- }
- else if(vehicleid == Shamal2 && PlayerInfo[playerid][FlyingTest] == 1)
- {
- GameTextForPlayer(playerid," ~y~ Test ~r~ Failed ~n~ ~w~ Because you have left the plane.~n~ Visit the license center to try again.",4000,3);
- new testcar;
- testcar = GetPlayerVehicleID(playerid);
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawn(testcar);
- PlayerInfo[playerid][FlyingTest] = 0;
- DisablePlayerRaceCheckpoint(playerid);
- }
- else if(vehicleid == Shamal3 && PlayerInfo[playerid][FlyingTest] == 1)
- {
- GameTextForPlayer(playerid," ~y~ Test ~r~ Failed ~n~ ~w~ Because you have left the plane.~n~ Visit the license center to try again.",4000,3);
- new testcar;
- testcar = GetPlayerVehicleID(playerid);
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawn(testcar);
- PlayerInfo[playerid][FlyingTest] = 0;
- DisablePlayerRaceCheckpoint(playerid);
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(vehicleid == Club1)
- {
- if(PlayerInfo[playerid][DrivingTest] == 0)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid,grey," You don't have the keys from this!");
- }
- else if(PlayerInfo[playerid][DrivingTest] == 1)
- {
- SetPlayerRaceCheckpoint(playerid,0,-2046.1495,-72.4681,34.8926,-2007.3123,-73.4380,34.8973,4.0);
- GameTextForPlayer(playerid," ~y~ Follow the ~r~ Checkpoints.~n~~y~ Don't ~r~ Damange ~y~ The Car.",4000,4);
- gPlayerDrivingCheckpoints[playerid] = FIRST_CHECKPOINT;
- }
- }
- else if(vehicleid == Club2)
- {
- if(PlayerInfo[playerid][DrivingTest] == 0)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid,grey," You don't have the keys from this!");
- }
- else if(PlayerInfo[playerid][DrivingTest] == 1)
- {
- SetPlayerRaceCheckpoint(playerid,0,-2046.1495,-72.4681,34.8926,-2007.3123,-73.4380,34.8973,4.0);
- GameTextForPlayer(playerid," ~y~ Follow the ~r~ Checkpoints.~n~~y~ Don't ~r~ Damange ~y~ The Car.",4000,4);
- gPlayerDrivingCheckpoints[playerid] = FIRST_CHECKPOINT;
- }
- }
- else if(vehicleid == Club3)
- {
- if(PlayerInfo[playerid][DrivingTest] == 0)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid,grey," You don't have the keys from this!");
- }
- else if(PlayerInfo[playerid][DrivingTest] == 1)
- {
- SetPlayerRaceCheckpoint(playerid,0,-2046.1495,-72.4681,34.8926,-2007.3123,-73.4380,34.8973,4.0);
- GameTextForPlayer(playerid," ~y~ Follow the ~r~ Checkpoints.~n~~y~ Don't ~r~ Damange ~y~ The Car.",4000,4);
- gPlayerDrivingCheckpoints[playerid] = FIRST_CHECKPOINT;
- }
- }
- else if(vehicleid == Shamal1)
- {
- if(PlayerInfo[playerid][FlyingTest] == 0)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid,grey," You don't have the keys from this!");
- }
- else if(PlayerInfo[playerid][FlyingTest] == 1)
- {
- SetPlayerRaceCheckpoint(playerid,3,-1628.0454,-134.6547,15.0706,-1444.2026,53.7472,22.4049,7.0);
- GameTextForPlayer(playerid," ~y~ Follow the ~r~ Checkpoints.~n~~y~ Don't ~r~ Damange ~y~ The Plane.",4000,4);
- gPlayerFlyingCheckpoints[playerid] = FIRSTS_CHECKPOINT;
- }
- }
- else if(vehicleid == Shamal2)
- {
- if(PlayerInfo[playerid][FlyingTest] == 0)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid,grey," You don't have the keys from this!");
- }
- else if(PlayerInfo[playerid][FlyingTest] == 1)
- {
- SetPlayerRaceCheckpoint(playerid,3,-1628.0454,-134.6547,15.0706,-1444.2026,53.7472,22.4049,7.0);
- GameTextForPlayer(playerid," ~y~ Follow the ~r~ Checkpoints.~n~~y~ Don't ~r~ Damange ~y~ The Plane.",4000,4);
- gPlayerFlyingCheckpoints[playerid] = FIRSTS_CHECKPOINT;
- }
- }
- else if(vehicleid == Shamal3)
- {
- if(PlayerInfo[playerid][FlyingTest] == 0)
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid,grey," You don't have the keys from this!");
- }
- else if(PlayerInfo[playerid][FlyingTest] == 1)
- {
- SetPlayerRaceCheckpoint(playerid,3,-1628.0454,-134.6547,15.0706,-1444.2026,53.7472,22.4049,7.0);
- GameTextForPlayer(playerid," ~y~ Follow the ~r~ Checkpoints.~n~~y~ Don't ~r~ Damange ~y~ The Plane.",4000,4);
- gPlayerFlyingCheckpoints[playerid] = FIRSTS_CHECKPOINT;
- }
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid,5.0,-2031.7733,-116.9298,1035.1719))
- {
- new dtests[] = "1\tDriving License - 800$\n2\tFlying License - 2000$\n3\tGun License - 500$";
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Licenses, Chose One:",dtests,"Test","Exit");
- return 1;
- }
- else if(!IsPlayerInRangeOfPoint(playerid,5.0,-2031.7733,-116.9298,1035.1719))
- {
- SendClientMessage(playerid,grey,"--> This command is only used at the SanFiero School.");
- }
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- new string[248];
- if(PlayerInfo[playerid][DrivingTest] == 1)
- {
- switch (gPlayerDrivingCheckpoints[playerid])
- {
- case FIRST_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2007.3123,-73.4380,34.8973,-2004.6874,11.4355,33.0038,4.0);
- gPlayerDrivingCheckpoints[playerid] = SECOND_CHECKPOINT;
- }
- case SECOND_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2004.6874,11.4355,33.0038,-2004.5037,200.9804,27.2662,4.0);
- gPlayerDrivingCheckpoints[playerid] = THIRD_CHECKPOINT;
- }
- case THIRD_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2004.5037,200.9804,27.2662,-1999.3391,373.2607,34.7428,4.0);
- gPlayerDrivingCheckpoints[playerid] = FORTH_CHECKPOINT;
- }
- case FORTH_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-1999.3391,373.2607,34.7428,-1999.9409,503.2410,34.7427,4.0);
- gPlayerDrivingCheckpoints[playerid] = FIVTH_CHECKPOINT;
- }
- case FIVTH_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-1999.9409,503.2410,34.7427,-2036.7159,506.7357,34.7392,4.0);
- gPlayerDrivingCheckpoints[playerid] = SIXTH_CHECKPOINT;
- }
- case SIXTH_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2036.7159,506.7357,34.7392,-2161.7175,508.6079,34.7427,4.0);
- gPlayerDrivingCheckpoints[playerid] = SEVENTH_CHECKPOINT;
- }
- case SEVENTH_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2161.7175,508.6079,34.7427,-2225.7688,510.7361,34.7486,4.0);
- gPlayerDrivingCheckpoints[playerid] = EIGHT_CHECKPOINT;
- }
- case EIGHT_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2225.7688,510.7361,34.7486,-2229.8179,457.5234,34.7393,4.0);
- gPlayerDrivingCheckpoints[playerid] = NINTH_CHECKPOINT;
- }
- case NINTH_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2229.8179,457.5234,34.7393,-2281.7944,393.8773,34.5240,4.0);
- gPlayerDrivingCheckpoints[playerid] = TENTH_CHECKPOINT;
- }
- case TENTH_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2281.7944,393.8773,34.5240,-2254.8110,320.7537,34.8988,4.0);
- gPlayerDrivingCheckpoints[playerid] = ELEVENTH_CHECKPOINT;
- }
- case ELEVENTH_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2255.3540,205.3027,34.8991,-2261.0242,-70.2846,34.8990,4.0);
- gPlayerDrivingCheckpoints[playerid] = TWELVTH_CHECKPOINT;
- }
- case TWELVTH_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2261.0242,-70.2846,34.8990,-2209.7490,-72.7662,34.8990,4.0);
- gPlayerDrivingCheckpoints[playerid] = THERTYTH_CHECKPOINT;
- }
- case THERTYTH_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,0,-2209.7490,-72.7662,34.8990,-2047.0022,-90.0552,34.8949,4.0);
- gPlayerDrivingCheckpoints[playerid] = FORTHYTH_CHECKPOINT;
- }
- case FORTHYTH_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,1,-2047.0022,-90.0552,34.8949,-2047.5490,-87.0332,35.1641,4.0);
- gPlayerDrivingCheckpoints[playerid] = FIVTYTH_CHECKPOINT;
- }
- case FIVTYTH_CHECKPOINT:
- {
- if(vehicleid == Club1 || vehicleid == Club2 || vehicleid == Club3)
- {
- new Float:Health;
- new testcar;
- testcar = GetPlayerVehicleID(playerid);
- GetVehicleHealth(testcar,Health);
- if(Health < 1000.0)
- {
- format(string,sizeof(string)," You have fail the test because you have damange the car. Visit the License Center to do it again.");
- SendClientMessage(playerid,yellow,string);
- DisablePlayerRaceCheckpoint(playerid);
- GameTextForPlayer(playerid," ~w~Test Completed. Check your results.",3000,3);
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawn(testcar);
- PlayerInfo[playerid][DrivingTest] = 0;
- return 1;
- }
- else if(Health >= 999.0)
- {
- DisablePlayerRaceCheckpoint(playerid);
- GameTextForPlayer(playerid," ~w~Test Completed. Check your results.",3000,3);
- format(string,sizeof(string)," You have pass the Test. Here is your legit driving license. Use /sl to show it.");
- SendClientMessage(playerid,yellow,string);
- PlayerInfo[playerid][DrivingLicense] = 1;
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawn(testcar);
- PlayerInfo[playerid][DrivingTest] = 0;
- return 1;
- }
- }
- }
- }
- }
- else if(PlayerInfo[playerid][FlyingTest] == 1)
- {
- switch (gPlayerFlyingCheckpoints[playerid])
- {
- case FIRSTS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,-1444.2026,53.7472,22.4049,-1133.9303,333.3353,59.9484,7.0);
- gPlayerDrivingCheckpoints[playerid] = SECONDS_CHECKPOINT;
- }
- case SECONDS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,-1133.9303,333.3353,61.9484,-784.5469,437.4159,70.0663,7.0);
- gPlayerDrivingCheckpoints[playerid] = THIRDS_CHECKPOINT;
- }
- case THIRDS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,-784.5469,437.4159,70.0663,-441.9236,571.4546,86.6628,7.0);
- gPlayerDrivingCheckpoints[playerid] = FORTHS_CHECKPOINT;
- }
- case FORTHS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,-441.9236,571.4546,86.6628,-94.3545,814.2031,83.5022,7.0);
- gPlayerDrivingCheckpoints[playerid] = FIVTHS_CHECKPOINT;
- }
- case FIVTHS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,-94.3545,814.2031,83.5022,206.8825,1103.8097,79.5797,7.0);
- gPlayerDrivingCheckpoints[playerid] = SIXTHS_CHECKPOINT;
- }
- case SIXTHS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,206.8825,1103.8097,79.5797,360.8752,1433.6638,84.1947,7.0);
- gPlayerDrivingCheckpoints[playerid] = SEVENTHS_CHECKPOINT;
- }
- case SEVENTHS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,237.0898,1716.8671,99.5659,-248.8507,1823.7936,109.7424,7.0);
- gPlayerDrivingCheckpoints[playerid] = EIGHTS_CHECKPOINT;
- }
- case EIGHTS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,-248.8507,1823.7936,109.7424,-575.5409,1712.1396,132.7493,7.0);
- gPlayerDrivingCheckpoints[playerid] = NINTHS_CHECKPOINT;
- }
- case NINTHS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,-575.5409,1712.1396,132.7493,-864.1115,1465.8033,93.3561,7.0);
- gPlayerDrivingCheckpoints[playerid] = TENTHS_CHECKPOINT;
- }
- case TENTHS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,-864.1115,1465.8033,93.3561,-947.1935,1092.1521,79.0029,7.0);
- gPlayerDrivingCheckpoints[playerid] = ELEVENTHS_CHECKPOINT;
- }
- case ELEVENTHS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,3,-947.1935,1092.1521,79.0029,-1172.3732,333.8894,47.6421,7.0);
- gPlayerDrivingCheckpoints[playerid] = TWELVTHS_CHECKPOINT;
- }
- case TWELVTHS_CHECKPOINT:
- {
- SetPlayerRaceCheckpoint(playerid,4,-1172.3732,333.8894,47.6421,-1533.0518,-36.5082,15.1076,7.0);
- gPlayerDrivingCheckpoints[playerid] = THERTYTH_CHECKPOINT;
- }
- case THERTYTHS_CHECKPOINT:
- {
- if(vehicleid == Shamal1 || vehicleid == Shamal2 || vehicleid == Shamal3)
- {
- new Float:Health;
- new testcar;
- testcar = GetPlayerVehicleID(playerid);
- GetVehicleHealth(testcar,Health);
- if(Health < 1000.0)
- {
- format(string,sizeof(string)," You have fail the test because you have damange the plane. Visit the License Center to do it again.");
- SendClientMessage(playerid,yellow,string);
- DisablePlayerRaceCheckpoint(playerid);
- GameTextForPlayer(playerid," ~w~Test Completed. Check your results.",3000,3);
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawn(testcar);
- PlayerInfo[playerid][FlyingTest] = 0;
- return 1;
- }
- else if(Health >= 999.0)
- {
- DisablePlayerRaceCheckpoint(playerid);
- GameTextForPlayer(playerid," ~w~Test Completed. Check your results.",3000,3);
- format(string,sizeof(string)," You have pass the Test. Here is your legit Flying license. Use /sl to show it.");
- SendClientMessage(playerid,yellow,string);
- PlayerInfo[playerid][FlyingLicense] = 1;
- RemovePlayerFromVehicle(playerid);
- SetVehicleToRespawn(testcar);
- PlayerInfo[playerid][FlyingTest] = 0;
- return 1;
- }
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerMoney(playerid) < DRIVING_LICENSE_PRICE)
- {
- SendClientMessage(playerid,yellow," You don't have enough money.");
- new dtests[] = "1\tDriving License - 800$\n2\tFlying License - 2000$\n3\tGun License - 1200$";
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Licenses, Chose One:",dtests,"Test","Exit");
- }
- else if(GetPlayerMoney(playerid) >= DRIVING_LICENSE_PRICE)
- {
- GivePlayerMoney(playerid,-DRIVING_LICENSE_PRICE);
- SendClientMessage(playerid,yellow," Hint: Get a car from the park to start the test.");
- PlayerInfo[playerid][DrivingTest] = 1;
- }
- }
- else if(listitem == 1)
- {
- if(GetPlayerMoney(playerid) < FLYING_LICENSE_PRICE)
- {
- SendClientMessage(playerid,yellow," You don't have enough money.");
- new dtests[] = "1\tDriving License - 800$\n2\tFlying License - 2000$\n3\tGun License - 1200$";
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Licenses, Chose One:",dtests,"Test","Exit");
- }
- else if(GetPlayerMoney(playerid) >= FLYING_LICENSE_PRICE)
- {
- GivePlayerMoney(playerid,-FLYING_LICENSE_PRICE);
- SendClientMessage(playerid,yellow," Hint: Get a shamal from the San Fiero Airport to start the test.");
- PlayerInfo[playerid][FlyingTest] = 1;
- }
- }
- else if(listitem == 2)
- {
- if(GetPlayerMoney(playerid) < GUN_LICENSE_PRICE)
- {
- SendClientMessage(playerid,yellow," You don't have enough money.");
- new dtests[] = "1\tDriving License - 800$\n2\tFlying License - 2000$\n3\tGun License - 1200$";
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Licenses, Chose One:",dtests,"Test","Exit");
- }
- else if(GetPlayerMoney(playerid) >= GUN_LICENSE_PRICE)
- {
- GivePlayerMoney(playerid,-FLYING_LICENSE_PRICE);
- SendClientMessage(playerid,yellow," You have bought the gun license.Type /sl to show it!");
- PlayerInfo[playerid][GunLicense] = 1;
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement