[SF] Need help (compile and edit)

Статус
В этой теме нельзя размещать новые ответы.

Gang83a

Новичок
Автор темы
3
1
First, i dont know russian language sorry... and i use translator is just like an hiv on my screen, doesnt work good.
Two, i looking for someone that can help to compile a SF code, i dont really know how to do that... And looking for someone too that can edit another SF plugin..
The code of the SF plugin that i want to compile (i edit the original one cuz it had an error).
Код:
#include <windows.h>
#include <string>
#include <assert.h>
#include <process.h>
#include "SAMPFUNCS_API.h"
#include "game_api\game_api.h"
SAMPFUNCS *SF = new SAMPFUNCS();
stTextureInfo *pStar;
stTextureInfo *pCrosshairs[4];
stTextureInfo *pCharacter[13];
DWORD dwStartTime = GetTickCount();
bool INI_GetBool(std::string _Section, std::string _Key)
{
    char str[256];
    GetPrivateProfileString(_Section.c_str(), _Key.c_str(), NULL, str, sizeof(str), "SAMPFUNCS\\Head-Up Display\\Head-Up Display.ini");
    if (!strcmp(str, "true"))
        return true;
    else
        return false;
}
int INI_GetInteger(std::string _Section, std::string _Key)
{
    char str[256];
    GetPrivateProfileString(_Section.c_str(), _Key.c_str(), NULL, str, sizeof(str), "SAMPFUNCS\\Head-Up Display\\Head-Up Display.ini");
    return std::stoi(str);
}
float INI_GetFloat(std::string _Section, std::string _Key)
{
    char str[256];
    GetPrivateProfileString(_Section.c_str(), _Key.c_str(), NULL, str, sizeof(str), "SAMPFUNCS\\Head-Up Display\\Head-Up Display.ini");
    return std::stof(str);
}
bool    Components_bRadar = INI_GetBool("Components", "bRadar"),
        Components_bRadarBar = INI_GetBool("Components", "bRadarBar"),
        Components_bMoney = INI_GetBool("Components", "bMoney"),
        Components_bAmmo = INI_GetBool("Components", "bAmmo"),
        Components_bCrosshair = INI_GetBool("Components", "bCrosshair"),
        Components_bStar = INI_GetBool("Components", "bStar");
float    Radar_fX = INI_GetFloat("Radar", "fX"),
        Radar_fY = INI_GetFloat("Radar", "fY");
float    RadarBar_fX = INI_GetFloat("RadarBar", "fX"),
        RadarBar_fY = INI_GetFloat("RadarBar", "fY"),
        RadarBar_fW = INI_GetFloat("RadarBar", "fWidth"),
        RadarBar_fH = INI_GetFloat("RadarBar", "fHeight"),
        RadarBar_fB = INI_GetFloat("RadarBar", "fBorder");
int        RadarBar_iHPColor = D3DCOLOR_ARGB(
        INI_GetInteger("RadarBar", "iHealthColorA"),
        INI_GetInteger("RadarBar", "iHealthColorR"),
        INI_GetInteger("RadarBar", "iHealthColorG"),
        INI_GetInteger("RadarBar", "iHealthColorB")),
        RadarBar_iAPColor = D3DCOLOR_ARGB(
        INI_GetInteger("RadarBar", "iArmorColorA"),
        INI_GetInteger("RadarBar", "iArmorColorR"),
        INI_GetInteger("RadarBar", "iArmorColorG"),
        INI_GetInteger("RadarBar", "iArmorColorB")),
        RadarBar_iOPColor = D3DCOLOR_ARGB(
        INI_GetInteger("RadarBar", "iOxygenColorA"),
        INI_GetInteger("RadarBar", "iOxygenColorR"),
        INI_GetInteger("RadarBar", "iOxygenColorG"),
        INI_GetInteger("RadarBar", "iOxygenColorB")),
        RadarBar_iBorderColor = D3DCOLOR_ARGB(
        INI_GetInteger("RadarBar", "iBorderColorA"),
        INI_GetInteger("RadarBar", "iBorderColorR"),
        INI_GetInteger("RadarBar", "iBorderColorG"),
        INI_GetInteger("RadarBar", "iBorderColorB"));
bool    Money_bMain = true,
        Money_bDiff = false;
int        Money_iMain = 0,
        Money_iDiff = 0,
        Money_iLast = 0;
float    Money_fX = INI_GetFloat("Money", "fX"),
        Money_fY = INI_GetFloat("Money", "fY"),
        Money_fO = INI_GetFloat("Money", "fYOffset"),
        Money_fLetterW = INI_GetFloat("Money", "fLetterWidth"),
        Money_fLetterH = INI_GetFloat("Money", "fLetterHeight"),
        Money_fLetterO = INI_GetFloat("Money", "fLetterOffset");
int        Money_iPositiveColor = D3DCOLOR_ARGB(
        INI_GetInteger("Money", "iPositiveColorA"), INI_GetInteger("Money", "iPositiveColorR"),
        INI_GetInteger("Money", "iPositiveColorG"), INI_GetInteger("Money", "iPositiveColorB")),
        Money_iNegativeColor = D3DCOLOR_ARGB(
        INI_GetInteger("Money", "iNegativeColorA"), INI_GetInteger("Money", "iNegativeColorR"),
        INI_GetInteger("Money", "iNegativeColorG"), INI_GetInteger("Money", "iNegativeColorB"));
bool    Ammo_bTotal = true,
        Ammo_bClip = false;
int        Ammo_iTotal = 0,
        Ammo_iClip = 0;
float    Ammo_fX = INI_GetFloat("Ammo", "fX"),
        Ammo_fY = INI_GetFloat("Ammo", "fY"),
        Ammo_fXO = INI_GetFloat("Ammo", "fXOffset"),
        Ammo_fYO = INI_GetFloat("Ammo", "fYOffset"),
        Ammo_fLetterW = INI_GetFloat("Ammo", "fLetterWidth"),
        Ammo_fLetterH = INI_GetFloat("Ammo", "fLetterHeight"),
        Ammo_fLetterO = INI_GetFloat("Ammo", "fLetterOffset");
int        Ammo_iTotalColor = D3DCOLOR_ARGB(
        INI_GetInteger("Ammo", "iTotalColorA"), INI_GetInteger("Ammo", "iTotalColorR"),
        INI_GetInteger("Ammo", "iTotalColorG"), INI_GetInteger("Ammo", "iTotalColorB")),
        Ammo_iClipColor = D3DCOLOR_ARGB(
        INI_GetInteger("Ammo", "iClipColorA"), INI_GetInteger("Ammo", "iClipColorR"),
        INI_GetInteger("Ammo", "iClipColorG"), INI_GetInteger("Ammo", "iClipColorB"));
float    Crosshair_fX = INI_GetFloat("Crosshair", "fX"),
        Crosshair_fY = INI_GetFloat("Crosshair", "fY"),
        Crosshair_fW = INI_GetFloat("Crosshair", "fWidth"),
        Crosshair_fH = INI_GetFloat("Crosshair", "fHeight");
int        Crosshair_iReadyColor = D3DCOLOR_ARGB(
        INI_GetInteger("Crosshair", "iReadyColorA"), INI_GetInteger("Crosshair", "iReadyColorR"),
        INI_GetInteger("Crosshair", "iReadyColorG"), INI_GetInteger("Crosshair", "iReadyColorB")),
        Crosshair_iReloadColor = D3DCOLOR_ARGB(
        INI_GetInteger("Crosshair", "iReloadColorA"), INI_GetInteger("Crosshair", "iReloadColorR"),
        INI_GetInteger("Crosshair", "iReloadColorG"), INI_GetInteger("Crosshair", "iReloadColorB"));
float    Star_fX = INI_GetFloat("Star", "fX"),
        Star_fY = INI_GetFloat("Star", "fY"),
        Star_fW = INI_GetFloat("Star", "fWidth"),
        Star_fH = INI_GetFloat("Star", "fHeight"),
        Star_fO = INI_GetFloat("Star", "fOffset");
int        Star_iFullColor = D3DCOLOR_ARGB(
        INI_GetInteger("Star", "iFullColorA"), INI_GetInteger("Star", "iFullColorR"),
        INI_GetInteger("Star", "iFullColorG"), INI_GetInteger("Star", "iFullColorB")),
        Star_iEmptyColor = D3DCOLOR_ARGB(
        INI_GetInteger("Star", "iEmptyColorA"), INI_GetInteger("Star", "iEmptyColorR"),
        INI_GetInteger("Star", "iEmptyColorG"), INI_GetInteger("Star", "iEmptyColorB"));
int GetNumberLength(int _Number)
{
    if (_Number == 0)
        return 1;
    if (_Number < 0)
        _Number *= -1;
    int _Count = 0;
    for (; _Number >= 1; _Count++, _Number /= 10);
    return _Count;
}
float GetHealth()
{
    if (PEDSELF->GetHealth() > 100)
        return 100;
    else
        return PEDSELF->GetHealth();
}
float GetArmor()
{
    if (PEDSELF->GetArmor() > 100)
        return 100;
    else
        return PEDSELF->GetArmor();
}
float GetOxygen()
{
    if (PEDSELF->GetOxygenLevel() / 39.97 > 100)
        return 100;
    else
        return PEDSELF->GetOxygenLevel() / 39.97;
}
int GetWeaponID()
{
    CWeapon *Weapon = PEDSELF->GetWeapon(PEDSELF->GetCurrentWeaponSlot());
    return Weapon->GetType();
}
eWeaponState GetWeaponState()
{
    CWeapon *Weapon = PEDSELF->GetWeapon(PEDSELF->GetCurrentWeaponSlot());
    return Weapon->GetState();
}
int GetAmmoInClip()
{
    CWeapon *Weapon = PEDSELF->GetWeapon(PEDSELF->GetCurrentWeaponSlot());
    return Weapon->GetAmmoInClip();
}
int GetAmmoTotal()
{
    CWeapon *Weapon = PEDSELF->GetWeapon(PEDSELF->GetCurrentWeaponSlot());
    return Weapon->GetAmmoTotal();
}
int GetWantedLevel()
{
    return *(DWORD*)0x58DB60;
}
int ConvertX(float X)
{
    int ScreenResolution[2];
    SF->getGame()->getScreenResolution(&ScreenResolution[0], &ScreenResolution[1]);
    return (ScreenResolution[0] / 640.0) * X + 0.5;
}
int ConvertY(float Y)
{
    int ScreenResolution[2];
    SF->getGame()->getScreenResolution(&ScreenResolution[0], &ScreenResolution[1]);
    return (ScreenResolution[1] / 448.0) * Y + 0.5;
}
void SetRadarSettings()
{
    *(float*)0x716642 = 40.0;
    *(DWORD*)0x718D14 = (DWORD)0x716642;
    *(float*)0x858A10 = Radar_fX;
    *(float*)0x866B70 = Radar_fY;
    return;
}
void SetHUDComponents()
{
    GAME->GetHud()->SetComponentVisible(HUD_HEALTH, INI_GetBool("Standart", "bHP"));
    GAME->GetHud()->SetComponentVisible(HUD_ARMOUR, INI_GetBool("Standart", "bAP"));
    GAME->GetHud()->SetComponentVisible(HUD_BREATH, INI_GetBool("Standart", "bOP"));
    GAME->GetHud()->SetComponentVisible(HUD_RADAR, INI_GetBool("Standart", "bRadar"));
    GAME->GetHud()->SetComponentVisible(HUD_RADIO, INI_GetBool("Standart", "bRadio"));
    GAME->GetHud()->SetComponentVisible(HUD_VITAL_STATS, INI_GetBool("Standart", "bStats"));
    GAME->GetHud()->SetComponentVisible(HUD_MONEY, INI_GetBool("Standart", "bMoney"));
    GAME->GetHud()->SetComponentVisible(HUD_AMMO, INI_GetBool("Standart", "bAmmo"));
    GAME->GetHud()->SetComponentVisible(HUD_WEAPON, INI_GetBool("Standart", "bWeapon"));
    GAME->GetHud()->SetComponentVisible(HUD_WANTED, INI_GetBool("Standart", "bWanted"));
    GAME->GetHud()->SetComponentVisible(HUD_CLOCK, INI_GetBool("Standart", "bClock"));
    GAME->GetHud()->SetComponentVisible(HUD_CROSSHAIR, INI_GetBool("Standart", "bCrosshair"));
    GAME->GetHud()->SetComponentVisible(HUD_VEHICLE_NAME, INI_GetBool("Standart", "bVehicleName"));
    GAME->GetHud()->SetComponentVisible(HUD_AREA_NAME, INI_GetBool("Standart", "bAreaName"));
    GAME->GetHud()->SetComponentVisible(HUD_HELP_TEXT, INI_GetBool("Standart", "bHelpText"));
    return;
}
void LoadTextures()
{
    pStar = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\star\\star.png");
    pCrosshairs[0] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\crosshairs\\pistol.png");
    pCrosshairs[1] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\crosshairs\\shotgun.png");
    pCrosshairs[2] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\crosshairs\\smg.png");
    pCrosshairs[3] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\crosshairs\\assault.png");
    pCrosshairs[4] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\crosshairs\\sniper.png");
    pCharacter[0] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\0.png");
    pCharacter[1] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\1.png");
    pCharacter[2] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\2.png");
    pCharacter[3] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\3.png");
    pCharacter[4] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\4.png");
    pCharacter[5] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\5.png");
    pCharacter[6] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\6.png");
    pCharacter[7] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\7.png");
    pCharacter[8] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\8.png");
    pCharacter[9] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\9.png");
    pCharacter[10] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\dollar.png");
    pCharacter[11] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\+.png");
    pCharacter[12] = SF->getRender()->LoadTextureFromFile("SAMPFUNCS\\Head-Up Display\\characters\\-.png");
}
void UpdateMoney()
{
    if (GAME->GetPlayerInfo()->GetPlayerMoney() != Money_iMain)
    {
        Money_iMain += (GAME->GetPlayerInfo()->GetPlayerMoney() - Money_iMain) / 150;
        if (Money_iMain < GAME->GetPlayerInfo()->GetPlayerMoney())
            Money_iMain += 1;
        else
            Money_iMain -= 1;
    }
    if (GAME->GetPlayerInfo()->GetPlayerMoney() - Money_iLast != 0)
    {
        Money_iDiff = GAME->GetPlayerInfo()->GetPlayerMoney() - Money_iLast;
        Money_bDiff = true;
        dwStartTime = GetTickCount();
    }
 
    if (GetTickCount() - dwStartTime > 4000)
        Money_bDiff = false;
    Money_iLast = GAME->GetPlayerInfo()->GetPlayerMoney();
    return;
}
void UpdateAmmo()
{
    if (PEDSELF->GetCurrentWeaponSlot() >= 2 && PEDSELF->GetCurrentWeaponSlot() <= 9)
    {
        if (PEDSELF->GetCurrentWeaponSlot() == 6 || PEDSELF->GetCurrentWeaponSlot() == 8 || GetWeaponID() == 25 || GetWeaponID() == 35 || GetWeaponID() == 36)
        {
            Ammo_iTotal = GetAmmoTotal();
            Ammo_bTotal = true;
            Ammo_bClip = false;
        }
        else
        {
            Ammo_iTotal = GetAmmoTotal() - GetAmmoInClip();
            Ammo_iClip = GetAmmoInClip();
            Ammo_bTotal = true;
            Ammo_bClip = true;
        }
    }
    else
    {
        Ammo_bTotal = false;
        Ammo_bClip = false;
    }
    return;
}
bool CALLBACK RENDER(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
    if (!SF->getRender()->CanDraw() || !SF->getSAMP()->getChat()->iChatWindowMode || SF->getGame()->isGTAMenuActive())
        return true;
    SF->getRender()->BeginRender();
    if (Components_bRadarBar)
    {
        SF->getRender()->DrawBox(ConvertX(RadarBar_fX), ConvertY(RadarBar_fY), ConvertX(RadarBar_fW), ConvertY(RadarBar_fH), RadarBar_iBorderColor);
        if (!PEDSELF->GetArmor() && !PEDSELF->IsInWater())
        {
            SF->getRender()->DrawBox(ConvertX(RadarBar_fX), ConvertY(RadarBar_fY) + ConvertY(RadarBar_fB), ConvertX(RadarBar_fW), ConvertY(RadarBar_fH) - ConvertY(RadarBar_fB) * 2, RadarBar_iHPColor - 0xBB000000);
            SF->getRender()->DrawBox(ConvertX(RadarBar_fX), ConvertY(RadarBar_fY) + ConvertY(RadarBar_fB), ConvertX(RadarBar_fW / 100 * GetHealth()), ConvertY(RadarBar_fH) - ConvertY(RadarBar_fB) * 2, RadarBar_iHPColor);
        }
        else
        {
            SF->getRender()->DrawBox(ConvertX(RadarBar_fX), ConvertY(RadarBar_fY) + ConvertY(RadarBar_fB), ConvertX(RadarBar_fW) / 2 - ConvertY(RadarBar_fB) / 2, ConvertY(RadarBar_fH) - ConvertY(RadarBar_fB) * 2, RadarBar_iHPColor - 0xBB000000);
            SF->getRender()->DrawBox(ConvertX(RadarBar_fX), ConvertY(RadarBar_fY) + ConvertY(RadarBar_fB), ConvertX(RadarBar_fW / 100 * GetHealth()) / 2 - ConvertY(RadarBar_fB) / 2, ConvertY(RadarBar_fH) - ConvertY(RadarBar_fB) * 2, RadarBar_iHPColor);
            
            if (!PEDSELF->IsInWater())
            {
                SF->getRender()->DrawBox(ConvertX(RadarBar_fX) + ConvertX(RadarBar_fW) - ConvertX(RadarBar_fW) / 2 + ConvertY(RadarBar_fB) / 2, ConvertY(RadarBar_fY) + ConvertY(RadarBar_fB), ConvertX(RadarBar_fW) / 2 - ConvertY(RadarBar_fB) / 2, ConvertY(RadarBar_fH) - ConvertY(RadarBar_fB) * 2, RadarBar_iAPColor - 0xBB000000);
                SF->getRender()->DrawBox(ConvertX(RadarBar_fX) + ConvertX(RadarBar_fW) - ConvertX(RadarBar_fW) / 2 + ConvertY(RadarBar_fB) / 2, ConvertY(RadarBar_fY) + ConvertY(RadarBar_fB), ConvertX(RadarBar_fW / 100 * GetArmor()) / 2 - ConvertY(RadarBar_fB) / 2, ConvertY(RadarBar_fH) - ConvertY(RadarBar_fB) * 2, RadarBar_iAPColor);
            }
            else
            {
                SF->getRender()->DrawBox(ConvertX(RadarBar_fX) + ConvertX(RadarBar_fW) - ConvertX(RadarBar_fW) / 2 + ConvertY(RadarBar_fB) / 2, ConvertY(RadarBar_fY) + ConvertY(RadarBar_fB), ConvertX(RadarBar_fW) / 2 - ConvertY(RadarBar_fB) / 2, ConvertY(RadarBar_fH) - ConvertY(RadarBar_fB) * 2, RadarBar_iOPColor - 0xBB000000);
                SF->getRender()->DrawBox(ConvertX(RadarBar_fX) + ConvertX(RadarBar_fW) - ConvertX(RadarBar_fW) / 2 + ConvertY(RadarBar_fB) / 2, ConvertY(RadarBar_fY) + ConvertY(RadarBar_fB), ConvertX(RadarBar_fW / 100 * GetOxygen()) / 2 - ConvertY(RadarBar_fB) / 2, ConvertY(RadarBar_fH) - ConvertY(RadarBar_fB) * 2, RadarBar_iOPColor);
            }
        }
    }
    if (Components_bMoney)
    {
        if (Money_bMain)
        {
            int iNumber = Money_iMain,
                iX = ConvertX(Money_fX) - ConvertX(Money_fLetterW) * Money_fLetterO;
            if (iNumber < 0)
            {
                iNumber *= -1;
                for (int i = 1, iLength = GetNumberLength(iNumber); i <= iLength; i++, iNumber /= 10, iX -= ConvertX(Money_fLetterW) * Money_fLetterO)
                    SF->getRender()->DrawTexture(pCharacter[iNumber % 10], iX, ConvertY(Money_fY), ConvertX(Money_fLetterW), ConvertY(Money_fLetterH), 0, Money_iNegativeColor);
            
                SF->getRender()->DrawTexture(pCharacter[10], iX, ConvertY(Money_fY), ConvertX(Money_fLetterW), ConvertY(Money_fLetterH), 0, Money_iNegativeColor);
                SF->getRender()->DrawTexture(pCharacter[12], iX - ConvertX(Money_fLetterW) * Money_fLetterO, ConvertY(Money_fY), ConvertX(Money_fLetterW), ConvertY(Money_fLetterH), 0, Money_iNegativeColor);
            }
            else
            {
                for (int i = 1, iLength = GetNumberLength(iNumber); i <= iLength; i++, iNumber /= 10, iX -= ConvertX(Money_fLetterW) * Money_fLetterO)
                    SF->getRender()->DrawTexture(pCharacter[iNumber % 10], iX, ConvertY(Money_fY), ConvertX(Money_fLetterW), ConvertY(Money_fLetterH), 0, Money_iPositiveColor);
            
                SF->getRender()->DrawTexture(pCharacter[10], iX, ConvertY(Money_fY), ConvertX(Money_fLetterW), ConvertY(Money_fLetterH), 0, Money_iPositiveColor);
            }
        }
        if (Money_bDiff)
        {
            int iNumber = Money_iDiff,
                iX = ConvertX(Money_fX) - ConvertX(Money_fLetterW) * Money_fLetterO;
            if (iNumber < 0)
            {
                iNumber *= -1;
                for (int i = 1, iLength = GetNumberLength(iNumber); i <= iLength;  i++, iNumber /= 10, iX -= ConvertX(Money_fLetterW) * Money_fLetterO)
                    SF->getRender()->DrawTexture(pCharacter[iNumber % 10], iX, ConvertY(Money_fY) + ConvertY(Money_fO), ConvertX(Money_fLetterW), ConvertY(Money_fLetterH), 0, Money_iNegativeColor);
                SF->getRender()->DrawTexture(pCharacter[12], iX, ConvertY(Money_fY) + ConvertY(Money_fO), ConvertX(Money_fLetterW), ConvertY(Money_fLetterH), 0, Money_iNegativeColor);
            }
            else
            {
                for (int i = 1, iLength = GetNumberLength(iNumber); i <= iLength; i++, iNumber /= 10, iX -= ConvertX(Money_fLetterW) * Money_fLetterO)
                    SF->getRender()->DrawTexture(pCharacter[iNumber % 10], iX, ConvertY(Money_fY) + ConvertY(Money_fO), ConvertX(Money_fLetterW), ConvertY(Money_fLetterH), 0, Money_iPositiveColor);
                SF->getRender()->DrawTexture(pCharacter[11], iX, ConvertY(Money_fY) + ConvertY(Money_fO), ConvertX(Money_fLetterW), ConvertY(Money_fLetterH), 0, Money_iPositiveColor);
            }
        }
    }
    if (Components_bAmmo)
    {
        int iX = ConvertX(Ammo_fX) - ConvertX(Ammo_fLetterW) * Ammo_fLetterO,
            iY = ConvertY(Ammo_fY);
    
        if (Money_bDiff)
            iY += ConvertY(Ammo_fYO);
        if (Ammo_bTotal)
            for (int iTotal = Ammo_iTotal, iLength = GetNumberLength(iTotal), i = 1; i <= iLength; i++, iTotal /= 10, iX -= ConvertX(Ammo_fLetterW) * Ammo_fLetterO)
                SF->getRender()->DrawTexture(pCharacter[iTotal % 10], iX, iY, ConvertX(Ammo_fLetterW), ConvertY(Ammo_fLetterH), 0, Ammo_iTotalColor);
        iX -= ConvertX(Ammo_fXO);
        if (Ammo_bClip)
            for (int iClip = Ammo_iClip, iLength = GetNumberLength(iClip), i = 1; i <= iLength; i++, iClip /= 10, iX -= ConvertX(Ammo_fLetterW) * Ammo_fLetterO)
                SF->getRender()->DrawTexture(pCharacter[iClip % 10], iX, iY, ConvertX(Ammo_fLetterW), ConvertY(Ammo_fLetterH), 0, Ammo_iClipColor);
    }
    if (Components_bCrosshair && SF->getGame()->isKeyDown(0x02))
    {
        if (PEDSELF->GetCurrentWeaponSlot() == 2 || PEDSELF->GetCurrentWeaponSlot() == 3 || PEDSELF->GetCurrentWeaponSlot() == 4 || PEDSELF->GetCurrentWeaponSlot() == 5 || GetWeaponID() == 33 || GetWeaponID() == 38)
        {
            int iCrosshair, iColor;
            if (GetWeaponState() == WEAPONSTATE_RELOADING || GetWeaponState() == WEAPONSTATE_OUT_OF_AMMO)
                iColor = Crosshair_iReloadColor;
            else
                iColor = Crosshair_iReadyColor;
            switch (PEDSELF->GetCurrentWeaponSlot())
            {
            case 2: iCrosshair = 0; break;
            case 3: iCrosshair = 1; break;
            case 4: iCrosshair = 2; break;
            case 5: iCrosshair = 3; break;
            default:
                if (GetWeaponID() == 33) iCrosshair = 0;
                if (GetWeaponID() == 38) iCrosshair = 3;
                if (GetWeaponID() == 34) iCrosshair = 4;
                break;
            }
            SF->getRender()->DrawTexture(pCrosshairs[iCrosshair], ConvertX(Crosshair_fX) - ConvertX(Crosshair_fW) / 2, ConvertY(Crosshair_fY) - ConvertY(Crosshair_fH) / 2, ConvertX(Crosshair_fW), ConvertY(Crosshair_fH), 0.0, iColor);
        }
    }
    if (Components_bStar && GetWantedLevel() >= 1)
    {
        int iX = ConvertX(Star_fX) - ConvertX(Star_fW);
        for (int i = 0; i < GetWantedLevel(); i++, iX -= ConvertX(Star_fW) + ConvertX(Star_fO))
            SF->getRender()->DrawTexture(pStar, iX, ConvertY(Star_fY), ConvertX(Star_fW), ConvertY(Star_fH), 0.0, Star_iFullColor);
        for (int iCounter = GetWantedLevel(); iCounter < 6; iCounter++, iX -= ConvertX(Star_fW) + ConvertX(Star_fO))
            SF->getRender()->DrawTexture(pStar, iX, ConvertY(Star_fY), ConvertX(Star_fW), ConvertY(Star_fH), 0.0, Star_iEmptyColor);
    }
    
    SF->getRender()->EndRender();
    return true;
}
void CALLBACK mainloop()
{
    static bool init = false;
    if (!init)
    {
        if (GAME == nullptr)
            return;
        if (GAME->GetSystemState() != eSystemState::GS_PLAYING_GAME)
            return;
        if (!SF->getSAMP()->IsInitialized())
            return;
        SetRadarSettings();
        SetHUDComponents();
        LoadTextures();
        SF->getRender()->registerD3DCallback(eDirect3DDeviceMethods::D3DMETHOD_PRESENT, RENDER);
        SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(255, 255, 255), "Plugin {AA5555}'Head-Up Display' {FFFFFF}was loaded! Author: {AA5555}AWRage");
        init = true;
    }
    if (Components_bMoney)
        UpdateMoney();
    if (Components_bAmmo)
        UpdateAmmo();
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved)
{
    if (dwReasonForCall == DLL_PROCESS_ATTACH)
        SF->initPlugin(mainloop, hModule);
    return true;
}

And this is the sf plugin that i want to edit (I CANT DO NO ANIMATIONS BECAUSE IT HAS AN ANTIFREEZE OR SOMETHING I THINK, CAN SOMEONE DELETE THAT SHIT FROM IT?)
 

Вложения

  • GB_Project.sf
    186.5 KB · Просмотры: 12
Статус
В этой теме нельзя размещать новые ответы.