• Страница 1 из 1
  • 1
Модератор форума: admin, TweIk  
Форум » Pawno » Wiki-samp » Создание работы дальнобойщика (*icon-0*)
Создание работы дальнобойщика
Drifter96Дата: Воскресенье, 06.03.2011, 11:30:54 | Сообщение # 1

Группа: Пользователи
Сообщений: 300
Ко всемforward-ам добавляем:

Code
forward IsADalnoboiCar(carid);  

Потом вставляем этот паблик куда вам угодно:

Code
public IsADalnoboiCar(carid)  

{  

new model=GetVehicleModel(carid);  

if(model == 515 || model == 514 || model == 403) //  

{return 1;}  

return 0;  

}  

Где 515,514,403 это ид грузовых машин.

В public OnPlayerStateChange(playerid, newstate, oldstate) вставляем:

Code
if(IsADalnoboiCar(newcar)) {  

if(PlayerInfo[playerid][pJob] != 16 )   

RemovePlayerFromVehicle(playerid);  

SendClientMessage(playerid, COLOR_GREY, "Ты не Дальнобойщик.");  

}  

}  

А сейчас переходим к созданию команды:

Code
if(strcmp(cmd, "/gruz", true) == 0) {  

     carid = GetPlayerVehicleID(playerid);  

    if(PlayerInfo[playerid][pJob] != 16) {  

     format(string, sizeof(string), "  Вы не работаете дальнобойщиком!");  

        SendClientMessage(playerid, COLOR_GRAD1, string); return 1;  

    }  

    if (!IsADalnoboiCar(carid)) {  

           SendClientMessage(playerid, COLOR_GRAD1, "  Вы должны находится в фуре чтобы взять груз!"); return 1;  

    }  

    GetPlayerName(playerid, sendername, sizeof(sendername));  

    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);  

       new listitems[] = "1\tОтвезти груз в ЛС\n2\tОтвезти груз в СФ\n3\tОтвезти груз в ЛВ";  

       ShowPlayerDialog(playerid,123,DIALOG_STYLE_LIST," Портативный Gps Навигатор:",listitems," Подтвердить"," Отмена");  

       return 1;  

   }  

А это команда
чтобы выбрать куда везти груз.

Code
if(strcmp(cmd, "/ungruz", true) == 0)  

   {  

       if(IsPlayerConnected(playerid))  

    {  

        if(PlayerInfo[playerid][pJob] != 16)  

     {  

      SendClientMessage(playerid, COLOR_GREY, " Вы не дальнобойщик!");  

         return 1;  

          }  

       new carid = GetPlayerVehicleID(playerid);  

       new gTrailer = GetVehicleTrailer(carid);  

           if(!IsTrailerAttachedToVehicle(carid))  

        {  

      SendClientMessage(playerid, COLOR_GREY, "Вы приехали без груза!!!");  

        return 1;  

     }  

              new x_nr[256];  

     x_nr = strtok(cmdtext, idx);  

     if(!strlen(x_nr))  

     {  

         SendClientMessage(playerid, COLOR_WHITE, "Используйте: /upgruz название взависимости от локации");  

         SendClientMessage(playerid, COLOR_WHITE, "Доступные Названия: ls, sf, lv.");  

      return 1;  

     }  

        if(strcmp(x_nr,"ls",true) == 0)  

     {  

      if(PlayerToPoint(3.0,playerid,2519.7297,-2440.3740,13.3399))  

      {  

       format(string, sizeof(string), "|____________________________|");  

       SendClientMessage(playerid, COLOR_RED1, string);  

        format(string, sizeof(string), "Вы доставили груз!");  

       SendClientMessage(playerid, COLOR_LG, string);  

       format(string, sizeof(string), "И получили премию в размере 7000$");  

       SendClientMessage(playerid, COLOR_LG, string);  

       format(string, sizeof(string), "|____________________________|");  

       SendClientMessage(playerid, COLOR_RED1, string);  

       GivePlayerMoney(playerid, 7000);  

       SetVehicleToRespawn(gTrailer);  

       DisablePlayerCheckpoint(playerid);  

       SendClientMessage(playerid, COLOR_RED1,"|Фура разгружена,отправляйтесь на базу|");  

       return 1;  

      }  

      else  

      {  

         SendClientMessage(playerid, COLOR_GREY, "   Вы не на складе.");  

       return 1;  

      }  

     }  

     else if(strcmp(x_nr,"sf",true) == 0)  

     {  

     if(PlayerToPoint(3.0,playerid,-2688.5688,234.7379,4.0589))  

      {  

      format(string, sizeof(string), "|____________________________|");  

      SendClientMessage(playerid, COLOR_RED1, string);  

       format(string, sizeof(string), "Вы доставили груз в Сан Фиеро!");  

      SendClientMessage(playerid, COLOR_LG, string);  

      format(string, sizeof(string), "И вы получили премию в размере 14000$");  

      SendClientMessage(playerid, COLOR_LG, string);  

      format(string, sizeof(string), "|____________________________|");  

      SendClientMessage(playerid, COLOR_RED1, string);  

      GivePlayerMoney(playerid, 14000);  

      SetVehicleToRespawn(gTrailer);  

      DisablePlayerCheckpoint(playerid);  

      SendClientMessage(playerid, COLOR_RED1,"|Фура разгружена,отправляйтесь на базу|");  

         return 1;  

     }  

     else  

     {  

         SendClientMessage(playerid, COLOR_GREY, "   Вы не на складе.");  

       return 1;  

      }  

     }  

     else if(strcmp(x_nr,"lv",true) == 0)  

     {  

     if(PlayerToPoint(3.0,playerid,-367.9283,1583.2257,75.9362))  

      {  

      format(string, sizeof(string), "|____________________________|");  

      SendClientMessage(playerid, COLOR_RED1, string);  

       format(string, sizeof(string), "Вы доставили груз!");  

      SendClientMessage(playerid, COLOR_LG, string);  

      format(string, sizeof(string), "И вы получили премию в размере 25000$");  

      SendClientMessage(playerid, COLOR_LG, string);  

      format(string, sizeof(string), "|____________________________|");  

      SendClientMessage(playerid, COLOR_RED1, string);  

      GivePlayerMoney(playerid, 25000);  

      SetVehicleToRespawn(gTrailer);  

      DisablePlayerCheckpoint(playerid);  

      SendClientMessage(playerid, COLOR_RED1,"|Фура разгружена,отправляйтесь на базу|");  

         return 1;  

     }  

     else  

     {  

         SendClientMessage(playerid, COLOR_GREY, "   Вы не на складе.");  

       return 1;  

      }  

     }  

    }  

      }  

Это команда чтобы сдать груз когда будешь стоять на ЧП.

И последний штрих добавляем в public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]):

Code
else if(dialogid == 123)  

   {  

     if(!response) return 0;  

    else  

    {  

     gPlayerCheckpointStatus[playerid] = CHECKPOINT_GPS;  

     switch (listitem)  

     {  

        case 0:  

        {  

       SetPlayerCheckpoint(playerid,2519.7297,-2440.3740,13.3399,5.0);  

      SendClientMessage(playerid, COLOR_LIGHTRED, "Склад на котрый требуется доствить груз отмечен на радаре!");  

      }  

        case 1:  

      {  

      SetPlayerCheckpoint(playerid,-2688.5688,234.7379,4.0589,5.0);  

      SendClientMessage(playerid, COLOR_LIGHTRED, "Склад на котрый требуется доствить груз отмечен на радаре!");  

Автор: R@W
Урок: Drifter96


Samp-Pawno.Ru forever
 
СообщениеКо всемforward-ам добавляем:

Code
forward IsADalnoboiCar(carid);  

Потом вставляем этот паблик куда вам угодно:

Code
public IsADalnoboiCar(carid)  

{  

new model=GetVehicleModel(carid);  

if(model == 515 || model == 514 || model == 403) //  

{return 1;}  

return 0;  

}  

Где 515,514,403 это ид грузовых машин.

В public OnPlayerStateChange(playerid, newstate, oldstate) вставляем:

Code
if(IsADalnoboiCar(newcar)) {  

if(PlayerInfo[playerid][pJob] != 16 )   

RemovePlayerFromVehicle(playerid);  

SendClientMessage(playerid, COLOR_GREY, "Ты не Дальнобойщик.");  

}  

}  

А сейчас переходим к созданию команды:

Code
if(strcmp(cmd, "/gruz", true) == 0) {  

     carid = GetPlayerVehicleID(playerid);  

    if(PlayerInfo[playerid][pJob] != 16) {  

     format(string, sizeof(string), "  Вы не работаете дальнобойщиком!");  

        SendClientMessage(playerid, COLOR_GRAD1, string); return 1;  

    }  

    if (!IsADalnoboiCar(carid)) {  

           SendClientMessage(playerid, COLOR_GRAD1, "  Вы должны находится в фуре чтобы взять груз!"); return 1;  

    }  

    GetPlayerName(playerid, sendername, sizeof(sendername));  

    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);  

       new listitems[] = "1\tОтвезти груз в ЛС\n2\tОтвезти груз в СФ\n3\tОтвезти груз в ЛВ";  

       ShowPlayerDialog(playerid,123,DIALOG_STYLE_LIST," Портативный Gps Навигатор:",listitems," Подтвердить"," Отмена");  

       return 1;  

   }  

А это команда
чтобы выбрать куда везти груз.

Code
if(strcmp(cmd, "/ungruz", true) == 0)  

   {  

       if(IsPlayerConnected(playerid))  

    {  

        if(PlayerInfo[playerid][pJob] != 16)  

     {  

      SendClientMessage(playerid, COLOR_GREY, " Вы не дальнобойщик!");  

         return 1;  

          }  

       new carid = GetPlayerVehicleID(playerid);  

       new gTrailer = GetVehicleTrailer(carid);  

           if(!IsTrailerAttachedToVehicle(carid))  

        {  

      SendClientMessage(playerid, COLOR_GREY, "Вы приехали без груза!!!");  

        return 1;  

     }  

              new x_nr[256];  

     x_nr = strtok(cmdtext, idx);  

     if(!strlen(x_nr))  

     {  

         SendClientMessage(playerid, COLOR_WHITE, "Используйте: /upgruz название взависимости от локации");  

         SendClientMessage(playerid, COLOR_WHITE, "Доступные Названия: ls, sf, lv.");  

      return 1;  

     }  

        if(strcmp(x_nr,"ls",true) == 0)  

     {  

      if(PlayerToPoint(3.0,playerid,2519.7297,-2440.3740,13.3399))  

      {  

       format(string, sizeof(string), "|____________________________|");  

       SendClientMessage(playerid, COLOR_RED1, string);  

        format(string, sizeof(string), "Вы доставили груз!");  

       SendClientMessage(playerid, COLOR_LG, string);  

       format(string, sizeof(string), "И получили премию в размере 7000$");  

       SendClientMessage(playerid, COLOR_LG, string);  

       format(string, sizeof(string), "|____________________________|");  

       SendClientMessage(playerid, COLOR_RED1, string);  

       GivePlayerMoney(playerid, 7000);  

       SetVehicleToRespawn(gTrailer);  

       DisablePlayerCheckpoint(playerid);  

       SendClientMessage(playerid, COLOR_RED1,"|Фура разгружена,отправляйтесь на базу|");  

       return 1;  

      }  

      else  

      {  

         SendClientMessage(playerid, COLOR_GREY, "   Вы не на складе.");  

       return 1;  

      }  

     }  

     else if(strcmp(x_nr,"sf",true) == 0)  

     {  

     if(PlayerToPoint(3.0,playerid,-2688.5688,234.7379,4.0589))  

      {  

      format(string, sizeof(string), "|____________________________|");  

      SendClientMessage(playerid, COLOR_RED1, string);  

       format(string, sizeof(string), "Вы доставили груз в Сан Фиеро!");  

      SendClientMessage(playerid, COLOR_LG, string);  

      format(string, sizeof(string), "И вы получили премию в размере 14000$");  

      SendClientMessage(playerid, COLOR_LG, string);  

      format(string, sizeof(string), "|____________________________|");  

      SendClientMessage(playerid, COLOR_RED1, string);  

      GivePlayerMoney(playerid, 14000);  

      SetVehicleToRespawn(gTrailer);  

      DisablePlayerCheckpoint(playerid);  

      SendClientMessage(playerid, COLOR_RED1,"|Фура разгружена,отправляйтесь на базу|");  

         return 1;  

     }  

     else  

     {  

         SendClientMessage(playerid, COLOR_GREY, "   Вы не на складе.");  

       return 1;  

      }  

     }  

     else if(strcmp(x_nr,"lv",true) == 0)  

     {  

     if(PlayerToPoint(3.0,playerid,-367.9283,1583.2257,75.9362))  

      {  

      format(string, sizeof(string), "|____________________________|");  

      SendClientMessage(playerid, COLOR_RED1, string);  

       format(string, sizeof(string), "Вы доставили груз!");  

      SendClientMessage(playerid, COLOR_LG, string);  

      format(string, sizeof(string), "И вы получили премию в размере 25000$");  

      SendClientMessage(playerid, COLOR_LG, string);  

      format(string, sizeof(string), "|____________________________|");  

      SendClientMessage(playerid, COLOR_RED1, string);  

      GivePlayerMoney(playerid, 25000);  

      SetVehicleToRespawn(gTrailer);  

      DisablePlayerCheckpoint(playerid);  

      SendClientMessage(playerid, COLOR_RED1,"|Фура разгружена,отправляйтесь на базу|");  

         return 1;  

     }  

     else  

     {  

         SendClientMessage(playerid, COLOR_GREY, "   Вы не на складе.");  

       return 1;  

      }  

     }  

    }  

      }  

Это команда чтобы сдать груз когда будешь стоять на ЧП.

И последний штрих добавляем в public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]):

Code
else if(dialogid == 123)  

   {  

     if(!response) return 0;  

    else  

    {  

     gPlayerCheckpointStatus[playerid] = CHECKPOINT_GPS;  

     switch (listitem)  

     {  

        case 0:  

        {  

       SetPlayerCheckpoint(playerid,2519.7297,-2440.3740,13.3399,5.0);  

      SendClientMessage(playerid, COLOR_LIGHTRED, "Склад на котрый требуется доствить груз отмечен на радаре!");  

      }  

        case 1:  

      {  

      SetPlayerCheckpoint(playerid,-2688.5688,234.7379,4.0589,5.0);  

      SendClientMessage(playerid, COLOR_LIGHTRED, "Склад на котрый требуется доствить груз отмечен на радаре!");  

Автор: R@W
Урок: Drifter96


Автор - Drifter96
Дата добавления - 06.03.2011 в 11:30:54
50Ment_r@p_AndreyДата: Понедельник, 25.07.2011, 15:53:28 | Сообщение # 2

Группа: Пользователи
Сообщений: 19
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(451) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(453) : error 017: undefined symbol "carid"
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : warning 217: loose indentation
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

6 Errors.
Это мои Ошибки Можешь помочь?


Наш Сайт Все Для SAMP GameMode Filterscripts: www.sa-mp-rus.ucoz.ru
Мой skype: andrey_rap_50ment
Взялся за разработку ДМ мода: LS/SF/LV_[DM] v.1.0 ( готовность - 8% )

Пишу моды на заказ и сайты на заказ делаю все качественно,быстро! и очень дешево!
 
СообщениеC:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(451) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(453) : error 017: undefined symbol "carid"
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : warning 217: loose indentation
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

6 Errors.
Это мои Ошибки Можешь помочь?

Автор - 50Ment_r@p_Andrey
Дата добавления - 25.07.2011 в 15:53:28
adminДата: Среда, 27.07.2011, 08:46:05 | Сообщение # 3

Группа: Администраторы
Сообщений: 3869
Quote (50Ment_r@p_Andrey)
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(453) : error 017: undefined symbol "carid"

чуть выше этого ошибки вставь:
Code
[/code]new carid = GetPlayerVehicleID(playerid);  [quote=50Ment_r@p_Andrey]C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(451) : error 017: undefined symbol "cmd" [/quote]
вставь переменную [code]new cmd[256];
Quote (50Ment_r@p_Andrey)
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : error 017: undefined symbol "PlayerInfo"

тоже самое что отвечал в другой теме ищи переменную которая отвечает за регистрацию ну верней форма входа!)/login и заменяй на свою ))


zm-jail.ru

Разработка сайта samp-pawno.ru


 
Сообщение
Quote (50Ment_r@p_Andrey)
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(453) : error 017: undefined symbol "carid"

чуть выше этого ошибки вставь:
Code
[/code]new carid = GetPlayerVehicleID(playerid);  [quote=50Ment_r@p_Andrey]C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(451) : error 017: undefined symbol "cmd" [/quote]
вставь переменную [code]new cmd[256];
Quote (50Ment_r@p_Andrey)
C:\Documents and Settings\Admin\Рабочий стол\Самп сервер 0.3с\gamemodes\newRAMS.pwn(455) : error 017: undefined symbol "PlayerInfo"

тоже самое что отвечал в другой теме ищи переменную которая отвечает за регистрацию ну верней форма входа!)/login и заменяй на свою ))

Автор - admin
Дата добавления - 27.07.2011 в 08:46:05
Форум » Pawno » Wiki-samp » Создание работы дальнобойщика (*icon-0*)
  • Страница 1 из 1
  • 1
Поиск:
Загрузка страницы, займет меньше минуты...
Загрузка...

Статистика Форума
Последнии темы Читаемые темы Лучшие пользователи Новые пользователи
Система телефонов поломалась
Не в себе
фильм скалайн
Трансформеры 3
форсаж 6
Ищу [FS]Для админок на сервер
нужны координаты карты для отметки зон...
Помогите найти мод
pawno урок автоматические ворота
обращение к скриптерам.
Вопросы по скриптингу
Ваши ошибки при компиляции GM/FS

Вопросы по скриптингу

(1081)

Считаем до 1000

(274)

Ваши ошибки при компиляция gm

(260)

Набор в команду

(80)

Ваши ошибки при компиляции GM/FS

(71)

вопроосы по скриптингу от 22.04.2013

(64)

Баннеробмен

(64)

несколько команд на samp 0.3 c

(64)

Оценки сайта samp-pawno.ru

(55)

Заказ хостинга

(51)

Набор в команду(форум)

(45)

Урок №61 по созданию системы авто для GodFather

(45)

admin

(3869)

[east_side]_trane

(443)

TWiX

(316)

valych

(501)

drifter-dron

(477)

danik_rok

(317)

Dimka_71rus

(360)

Drifter96

(300)

MaNb9K

(220)

[MTA]MaPeR5518

(181)

Dima_Tkach

(107)

Nik_Ull

(184)

system32xzxz

(Четверг 09:25:24)

torbin169

(Суббота 23:09:29)

kuchuk_00

(Суббота 17:10:14)

artem_boyko_3

(Суббота 15:57:37)

greggelbak

(Среда 18:29:37)

vladisvlavs

(Среда 13:51:57)

add02102002

(Понедельник 22:37:15)

Диман221

(Понедельник 18:12:45)

almas051004

(Воскресенье 11:05:32)

megasuccessms

(Суббота 14:15:36)

nawe

(Пятница 22:25:23)

swoysb

(Пятница 14:55:29)

Вверх
13:43:01
ОбновитьСмайлыУправление мини-чатом
ЧАТ-PAWNO
2010-2024

vkontakte :samp-pawno.ru: