Anti-Cheat Problem...
#1

So.. I used Stunt Universe gamemode..

The anti cheat is getting a weird error...

It says "cannot read from file 'dini'

the include could not read....

This is the anti cheat script :

Код:
						//////////////////////
						///Anti Money Cheat///
						//////Created by://///
						//////°Fallout°///////
						//////////////////////


#include <a_samp>
#include <Dini>

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//settings//

#define MAX_DIFFERENCE 200

new AntiCheat = 1;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

forward F_OnInit();
forward F_OnPlayerConnect(playerid);
forward CheckMoney();
forward DifferenceDetected(playerid);

public F_OnInit()
{
    if(AntiCheat == 1)
    {
        SetTimer("CheckMoney", 4000, 1);
    }
}

public F_OnPlayerConnect(playerid)
{
    new file[128];
    format(file, sizeof(file), "F_AntiCheat/id_%i.ini", playerid);
    if (!dini_Exists(file))
    {
        dini_Create(file);
    }
    dini_IntSet(file, "Money", 0);
}

public CheckMoney()
{
    for(new i=0; i<GetMaxPlayers(); i++)
    {
        if (IsPlayerConnected(i))
        {
            new file[128];
            format(file, sizeof(file), "F_AntiCheat/id_%i.ini", i);
            new F_Money;
            F_Money = dini_Int(file, "Money");
            new cash = GetPlayerMoney(i);
            if (cash > F_Money)
            {
                if ((cash-F_Money) > MAX_DIFFERENCE)
                {
                    SetTimerEx("DifferenceDetected", 2000, 0, "i", i);
                }
            }
        }
    }
}

public DifferenceDetected(playerid)
{
    new file[128];
    format(file, sizeof(file), "F_AntiCheat/id_%i.ini", playerid);
    new F_Money;
    F_Money = dini_Int(file, "Money");
    new cash = GetPlayerMoney(playerid);
    if (cash > F_Money)
    {
        if ((cash-F_Money) > MAX_DIFFERENCE)
        {
            new hackedmoney;
            hackedmoney = cash - F_Money;
            GivePlayerMoney(playerid, -hackedmoney);
            new kickedstring[128];
            new kickedname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, kickedname, sizeof(kickedname));
            format(kickedstring, sizeof(kickedstring), "%s was auto-kicked for: Money cheat. ($%i)", kickedname, hackedmoney);
            SendClientMessageToAll(0xAFAFAFAA, kickedstring);
            printf("%s was auto-kicked for: Money cheat. ($%i)", kickedname, hackedmoney);
            Kick(playerid);
        }
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

stock F_GivePlayerMoney(playerid, amount)
{
    new file[128];
    format(file, sizeof(file), "F_AntiCheat/id_%i.ini", playerid);
    new F_Money;
    F_Money = dini_Int(file, "Money");
    dini_IntSet(file, "Money", F_Money += amount);
    GivePlayerMoney(playerid, amount);
    return 1;
}

stock F_SetPlayerMoney(playerid, amount)
{
    new file[128];
    format(file, sizeof(file), "F_AntiCheat/id_%i.ini", playerid);
    dini_IntSet(file, "Money", amount);
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, amount);
    return 1;
}

stock F_ResetPlayerMoney(playerid)
{
    new file[128];
    format(file, sizeof(file), "F_AntiCheat/id_%i.ini", playerid);
    dini_IntSet(file, "Money", 0);
    ResetPlayerMoney(playerid);
    return 1;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Anyone ? please help?
Reply
#2

1st of all, do you even have 'Dini' in your includes folder? If so, try this:

https://sampforum.blast.hk/showthread.php?tid=183776

----
Next time use search bar!
Reply
#3

I have dini in my includes folder... Duh !

Both, Anti_Cheat and Dini are in same text files and are in their correct place.
Reply
#4

In the pawno map?
Reply
#5

Look...

The File is in :- Desktop/My Server/Pawno/Includes... isn't that alright?

First of all, I was in my gamemode's pawno file, I compiled it and it said that "cannot read from file 'dini' "

so I went to that file and it says there too, it says "cannot read from file 'dini' " ..
actually, WTF?

The "Dini" script is its on its own file than it can't find dini?.... Someone please help...
Reply
#6

Delete and Download again... (The Dini)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)