Главный редактор форума: Doc-John | Текущая дата: 30.11.2024, 06:36
  • Страница 1 из 1
  • 1
[Урок] Делаем сдачу на права
Оффлайн
Суббота, 19.07.2014, 15:45 | Сообщение # 1
Сообщений:
12
2
Здравствуйте, уважаемые форумчане! 
В этой теме я научу Вас, как сделать сдачу на права. 
Урок опубликован для SAMP-Портала: ISAMP.3DN.RU. 
Автор темы: ARTEM_SKOROBAGACH

В паблике OnPlayerEnterCheckpoint находим:


Код
switch (gPlayerCheckpointStatus[playerid])   
       {

и добавляем:

Код
case CHECKPOINT_DRIVETEST:   
           {   
               if(DriverTest [playerid]> 0)   
               {   
                   gPlayerCheckpointStatus [playerid]= CHECKPOINT_DRIVETEST;   
                   DriverTest [playerid]+= 1;   
                   if(DriverTest [playerid]!= 14)   
                   {   
                       SendClientMessage(playerid,COLOR_WHITE,"Hint: | Head to the next checkpoint.");   
                   }   
                   if(DriverTest [playerid]== 2) { SetPlayerCheckpoint(playerid,-2392.3738,2341.4717,4.4034,5.0); } // driving test 3   
                   else if(DriverTest [playerid]== 3) { SetPlayerCheckpoint(playerid,-2333.9165,2379.5198,5.2924,5.0); } // driving test 4   
                   else if(DriverTest [playerid]== 4) { SetPlayerCheckpoint(playerid,-2373.0110,2423.9888,7.9117,5.0); } // driving test 5   
                   else if(DriverTest [playerid]== 5) { SetPlayerCheckpoint(playerid,-2494.7043,2428.8662,16.0640,5.0); } // driving test 6   
                   else if(DriverTest [playerid]== 6) { SetPlayerCheckpoint(playerid,-2684.2231,2453.9392,45.3832,5.0); } // driving test 7   
                   else if(DriverTest [playerid]== 7) { SetPlayerCheckpoint(playerid,-2726.3936,2362.6997,71.4079,5.0); } // driving test 8   
                   else if(DriverTest [playerid]== 8) { SetPlayerCheckpoint(playerid,-2758.4304,2357.0708,74.0613,5.0); } // driving test 9   
                   else if(DriverTest [playerid]== 9) { SetPlayerCheckpoint(playerid,-2744.5264,2346.7864,71.8290,5.0); } // driving test 10   
                   else if(DriverTest [playerid]== 10) { SetPlayerCheckpoint(playerid,-2615.4590,2498.2751,26.1342,5.0); } // driving test 11   
                   else if(DriverTest [playerid]== 11) { SetPlayerCheckpoint(playerid,-2512.8772,2428.1533,16.1784,5.0); } // driving test 12   
                   else if(DriverTest [playerid]== 12) { SetPlayerCheckpoint(playerid,-2469.5779,2343.6399,4.6053,5.0); } // driving test 13   
                   else if(DriverTest [playerid]== 13) { SetPlayerCheckpoint(playerid,-2466.2939,2246.5210,4.3785,5.0); } // driving test 14   
                   else if(DriverTest [playerid]== 14)   
                   {   
                       SendClientMessage(playerid,COLOR_WHITE,"Info: | You have completed your Driving Test and bought your driving license for hundred dollar.");   
                       GivePlayerMoney(playerid,-100);   
                       PlayerInfo [playerid][pCarLic]= 1;   
                       DriverTest [playerid]= 0;   
                       DisablePlayerCheckpoint(playerid);   
                       gPlayerCheckpointStatus [playerid]= CHECKPOINT_NONE;   
                       SetVehicleToRespawn(GetPlayerVehicleID(playerid));   
                       GameDrawForPlayer(playerid,"~w~Mission ~g~Passed ~n~~y~  -100$",3500);   
                   }   
               }   
           }

Далее находим:

Код
if(newstate == PLAYER_STATE_ONFOOT)

И вставляем:

Код
if(DriverTest [playerid]> 0)   
           {   
               DisablePlayerCheckpoint(playerid);   
               gPlayerCheckpointStatus [playerid]= CHECKPOINT_NONE;   
               DriverTest [playerid]= 0;   
               SendClientMessage(playerid,COLOR_WHITE,"Info: | You left your car, so you failed the test.");   
           }

Нужно найти привязку наших авто к лицензерам. После того как нашли, всё, что там есть, заменяем на:

Код
if(DriverTest [playerid]== 0)   
               {   
                   SendClientMessage(playerid,COLOR_GREY,"You are not at a driving test.");   
                   RemovePlayerFromVehicle(playerid);   
                   TogglePlayerControllable(playerid,true);   
               }   
               else if(DriverTest [playerid]== 1)   
               {   
                   SetPlayerCheckpoint(playerid,-2464.2534,2306.3140,4.4034,5.0);   
                   SendClientMessage(playerid,COLOR_WHITE,"Hint: | Head to the first checkpoint.");   
                   gPlayerCheckpointStatus [playerid]= CHECKPOINT_DRIVETEST;   
               }   
           }

Далее ко все #define добавляем:

Код
#define CHECKPOINT_DRIVETEST 6

Теперь ко всем new добавляем:

Код
new DriverTest[MAX_PLAYERS];
Оффлайн
Воскресенье, 01.02.2015, 02:28 | Сообщение # 2
Сообщений:
3
0
то что иска
  • Страница 1 из 1
  • 1
Поиск: