Четверг, 25.02.2021, 05:33
Logo site
  • Главная
  • Форум
  • Мы в Контакте
  • Pwn-Zone.Ru
[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Форум » SA-MP » Wiki-The-Samp » [Tutorial] Лазер на оружие
[Tutorial] Лазер на оружие
НазарДата: Воскресенье, 18.12.2011, 09:39 | Сообщение # 1
Гл. Администратор
Группа: Пользователь
Сообщений: 125
Награды: 7
Замечания: 0%
В public OnPlayerConnect(playerid):
Code
SetPVarInt(playerid, "laser", 0);   
SetPVarInt(playerid, "color", 18643);


В public OnGameModeInit():
Code
new p = GetMaxPlayers();   
for(new i=0; i < p; i++)   
      {   
          SetPVarInt(i, "laser", 0);   
          SetPVarInt(i, "color", 18643);   
      }


В public OnPlayerCommandText(playerid, cmdtext[]):
Code
if(strcmp(cmd, "/laser", true) == 0)   
      {   
          if(IsACop(playerid) || PlayerInfo[playerid][pAdminka] >0 || PlayerInfo[playerid][pMember] == 8||PlayerInfo[playerid][pLeader] ==8)   
          {   
              ShowPlayerDialog(playerid,132,DIALOG_STYLE_LIST,"Лазер","Включить\nВыключить\nЦвет","Enter","Exit");   
              return 1;   
          }   
      }


В public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]):
Code
if(dialogid == 132)   
      {   
          if(response)   
          {   
              if(listitem == 0)   
              {   
                  SetPVarInt(playerid, "laser", 1);   
                  SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));   
              }   
              if(listitem == 1)   
              {   
                  SetPVarInt(playerid, "laser", 0);   
                  RemovePlayerAttachedObject(playerid, 0);   
              }   
              if(listitem == 2)   
              {   
                  ShowPlayerDialog(playerid,133,DIALOG_STYLE_LIST,"Цвета","{FF3300}Красный\n{0033CC}Синий\n{33FF00}Зелёный\n{FFFF00}Желтый\n{ FEBFEF}Розовый\nО ранжевый","Enter","Exit");   
              }   
          }   
          return 1;   
      }   
      if(dialogid == 133)   
      {   
          if(response)   
          {   
              if(listitem == 0)   
              {   
                  SetPVarInt(playerid, "color", 18643);   
              }   
              if(listitem == 1)   
              {   
                  SetPVarInt(playerid, "color", 19080);   
              }   
              if(listitem == 2)   
              {   
                  SetPVarInt(playerid, "color", 19083);   
              }   
              if(listitem == 3)   
              {   
                  SetPVarInt(playerid, "color", 19084);   
              }   
              if(listitem == 4)   
              {   
                  SetPVarInt(playerid, "color", 19081);   
              }   
              if(listitem == 5)   
              {   
                  SetPVarInt(playerid, "color", 19082);   
              }   
          }   
          return 1;   
      }


Продолжение ниже!


По всем вопросам обращайтесь на форум :)
 
НазарДата: Воскресенье, 18.12.2011, 09:39 | Сообщение # 2
Гл. Администратор
Группа: Пользователь
Сообщений: 125
Награды: 7
Замечания: 0%
В public OnPlayerUpdate(playerid):
Code
if(GetPVarInt(playerid, "laser"))  
         {  
             RemovePlayerAttachedObject(playerid, 0);  
             if(IsPlayerInAnyVehicle(playerid)) return 1;  
             switch (GetPlayerWeapon(playerid))  
             {  
             case 22:  
                 {  
                     if(IsPlayerAiming(playerid))  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);  
                         }  
                     }  
                     else  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);  
                         }  
                     }  
                 }  
             case 23:  
                 {  
                     if(IsPlayerAiming(playerid))  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);  
                         }  
                     }  
                     else  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);  
                         }  
                     }  
                 }  
             case 27:  
                 {  
                     if(IsPlayerAiming(playerid))  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.588246, -0.022766, 0.138052, -11.531745, 347.712585, 352.784271);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.588246, -0.022766, 0.138052, 1.468254, 350.712585, 352.784271);  
                         }  
                     }  
                     else  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);  
                         }  
                     }  
                 }  
             case 30:  
                 {  
                     if(IsPlayerAiming(playerid))  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.628249, -0.027766, 0.078052, -6.621746, 352.552642, 355.084289);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.628249, -0.027766, 0.078052, -1.621746, 356.202667, 355.084289);  
                         }  
                     }  
                     else  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);  
                         }  
                     }  
                 }  
             case 31:  
                 {  
                     if(IsPlayerAiming(playerid))  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);  
                         }  
                     }  
                     else  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);  
                         }  
                     }  
                 }  
             case 34:  
                 {  
                     if(IsPlayerAiming(playerid))  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);  
                         }  
                         return 1;  
                     }  
                     else  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);  
                         }  
                     }  
                 }  
             case 29:  
                 {  
                     if(IsPlayerAiming(playerid))  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.298249, -0.02776, 0.158052, -11.631746, 359.302673, 357.584259);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.298249, -0.02776, 0.158052, 8.368253, 358.302673, 352.584259);  
                         }  
                     }  
                     else  
                     {  
                         if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);  
                         }  
                         else  
                         {  
                             SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);  
                         }  
                     }  
                 }  
             }  
         }


По всем вопросам обращайтесь на форум :)
 
НазарДата: Воскресенье, 18.12.2011, 09:40 | Сообщение # 3
Гл. Администратор
Группа: Пользователь
Сообщений: 125
Награды: 7
Замечания: 0%
В public OnPlayerUpdate(playerid):
Code
if(GetPVarInt(playerid, "laser"))          {              RemovePlayerAttachedObject(playerid, 0);              if(IsPlayerInAnyVehicle(playerid)) return 1;              switch (GetPlayerWeapon(playerid))              {              case 22:                  {                      if(IsPlayerAiming(playerid))                      {                          if(GetPlayerSpecial Action(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);                          }                      }                      else                      {                          if(GetPlayerSpe cialAction(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);                          }                      }                  }              case 23:                  {                      if(IsPlayerAiming(playerid))                      {                          if(GetPlayerSpecial Action(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);                          }                      }                      else                      {                          if(GetPlayerSpe cialAction(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);                          }                      }                  }              case 27:                  {                      if(IsPlayerAiming(playerid))                      {                          if(GetPlayerSpecial Action(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.588246, -0.022766, 0.138052, -11.531745, 347.712585, 352.784271);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.588246, -0.022766, 0.138052, 1.468254, 350.712585, 352.784271);                          }                      }                      else                      {                          if(GetPlayerSpe cialAction(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);                          }                      }                  }              case 30:                  {                      if(IsPlayerAiming(playerid))                      {                          if(GetPlayerSpecial Action(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.628249, -0.027766, 0.078052, -6.621746, 352.552642, 355.084289);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.628249, -0.027766, 0.078052, -1.621746, 356.202667, 355.084289);                          }                      }                      else                      {                          if(GetPlayerSpe cialAction(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);                          }                      }                  }              case 31:                  {                      if(IsPlayerAiming(playerid))                      {                          if(GetPlayerSpecial Action(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);                          }                      }                      else                      {                          if(GetPlayerSpe cialAction(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);                          }                      }                  }              case 34:                  {                      if(IsPlayerAiming(playerid))                      {                          if(GetPlayerSpecial Action(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);                          }                          return 1;                      }                      else                      {                          if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);                          }                      }                  }              case 29:                  {                      if(IsPlayerAiming(playerid))                      {                          if(GetPlayerSpecial Action(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.298249, -0.02776, 0.158052, -11.631746, 359.302673, 357.584259);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.298249, -0.02776, 0.158052, 8.368253, 358.302673, 352.584259);                          }                      }                      else                      {                          if(GetPlayerSpe cialAction(playerid) != SPECIAL_ACTION_DUCK)                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);                          }                          else                          {                    SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);                          }                      }                  }              }          }
 
Форум » SA-MP » Wiki-The-Samp » [Tutorial] Лазер на оружие
  • Страница 1 из 1
  • 1
Поиск:

Лучшая рип студия!

Проследить за всеми новостями мы не можем, так как новости берутся из открытых источников. Если вы считаете, что новость нарушает ваши права на авторство или дизайн, то обратитесь к администрации данного ресурса. | Хостинг от uCoz