[ New Updates · Members · Rules · Search · RSS ]
Page 1 of 11
Forum » DevCen (Developer Center) » AMX Mod X » Code & Snippets » Targa Sight With Victoria Native
Targa Sight With Victoria Native
DavidJrDate: Thursday, 27 Nov 2014, 8:50 PM | Message # 1
CEO
Group: Executive Team
Messages: 471
Awards: 0
Reputation: 224
Status: Offline
Code
/* Plugin generated by AMXX-Studio */

#include <acg>
#include <amxmodx>
#include <amxmisc>
#include <victoria_native>

#define PLUGIN "VTR Sight"
#define VERSION "1.0"
#define AUTHOR "DavidJr"

public plugin_init()
{
       register_plugin(PLUGIN, VERSION, AUTHOR);
          
       register_event("SetFOV", "Event_SetFOV", "b");
}

public Event_SetFOV(iIndex)
{
       new iFov = read_data(1);
          
     if (iFov > 40)
     {
         acg_removedrawnimage(iIndex, 3, 1);
         return;
     }

       new szModel[33];
       VTR_Get_WeaponName(iIndex, szModel, sizeof (szModel) - 1);
       VTR_Get_SightTarga(szModel, sizeof (szModel) - 1);
          
       acg_drawtga(iIndex, szModel, 255, 255, 255, 255, 0.5, 0.5, 1, 0, 0.0, 0.0, 0.0, 0.0, 1, 0, 1);
}

VTR_Get_SightTarga(szModel[], iLen)
{
       new szText[33];
          
       new szConfigDir[256];
       get_configsdir(szConfigDir, sizeof szConfigDir - 1);
          
       new szFile[256];
       format(szFile, sizeof (szFile) - 1,  "%s/vtr_sight.ini", szConfigDir);
          
       new szTarga[33];
       format(szTarga, sizeof (szTarga) - 1, "%s%s", szModel, " ");
          
       new szBuffer[256], iLength, iLine;
          
       new ReadFile = read_file(szFile, iLine++, szBuffer, sizeof szBuffer - 1, iLength);
          
       while (ReadFile)
       {
           if ((szBuffer[0]== ';') || !iLength) continue;
              
           if (containi(szModel, szBuffer) > -1)
           {
               replace_all(szText, 127, szBuffer, "");
               return format(szTarga, iLen - 1, "gfx/sight/%s.tga", szText);
           }
       }
       return 0;
}

vtr_sight.ini
Code
ak47_ext ak47_sight
m4a1_ext m4a1_sight


Auto Aim Bot Detector: http://youtu.be/NiKY0rG7cNg
 
Nouris_Hamada_103Date: Thursday, 27 Nov 2014, 9:28 PM | Message # 2
Junior Member
Group: Developer
Messages: 51
Awards: 0
Reputation: 0
Status: Offline
Izin Read grin2

CJDWTEAM.BLOGSPOT.COM
 
callmetoto2008Date: Thursday, 04 Dec 2014, 1:26 PM | Message # 3
New Member
Group: Member
Messages: 5
Awards: 0
Reputation: 0
Status: Offline
[Ask]Bang david, di Victoria Native 1.1.0.0 build 1007 [victoria_native.inc] kok gag ada baris yang seperti ini?
Code
VTR_Get_SightTarga


Seorang pemula yang mencoba belajar dengan berbagai keterbasannya. :)

Message edited by callmetoto2008 - Thursday, 04 Dec 2014, 1:29 PM
 
DavidJrDate: Friday, 05 Dec 2014, 1:54 PM | Message # 4
CEO
Group: Executive Team
Messages: 471
Awards: 0
Reputation: 224
Status: Offline
Toto, itu bukan native plugin, tp itu native stock. Simpan di paling bawah source code.

Code
VTR_Get_SightTarga(szModel[], iLen)
{
        new szText[33];
            
        new szConfigDir[256];
        get_configsdir(szConfigDir, sizeof szConfigDir - 1);
            
        new szFile[256];
        format(szFile, sizeof (szFile) - 1,  "%s/vtr_sight.ini", szConfigDir);
            
        new szTarga[33];
        format(szTarga, sizeof (szTarga) - 1, "%s%s", szModel, " ");
            
        new szBuffer[256], iLength, iLine;
            
        new ReadFile = read_file(szFile, iLine++, szBuffer, sizeof szBuffer - 1, iLength);
            
        while (ReadFile)
        {
            if ((szBuffer[0]== ';') || !iLength) continue;
                
            if (containi(szModel, szBuffer) > -1)
            {
                replace_all(szText, 127, szBuffer, "");
                return format(szTarga, iLen - 1, "gfx/sight/%s.tga", szText);
            }
        }
        return 0;
}


Auto Aim Bot Detector: http://youtu.be/NiKY0rG7cNg
 
Forum » DevCen (Developer Center) » AMX Mod X » Code & Snippets » Targa Sight With Victoria Native
Page 1 of 11
Search:

Create a free website with uCoz