Anti hack Help (+rep)
#1

this is my antihack
PHP код:
stock AntiHack(playerid)
{
    
// Setup local variables
    
new Float:Armour;
    
// Skip checking for hacks used by the player if he was reported by the Anti-Hack system already
    
if (APlayerData[playerid][AutoReportTime] > 0)
    {
        
// Reduce the time so the player can be reported again soon if he doesn't stop using hacks
        
APlayerData[playerid][AutoReportTime]--;
        
// Exit the function, this skips the hack-checks until the AutoReportTime has reached 0
        // Otherwise the player is reported every half a second until he stops using hacks
        
return 1;
    }
    
// Check if a filterscript gave some money (or took it) to the player
    
if (GetPVarInt(playerid"PVarMoney") != 0)
    {
        
// Add the money to the players account
        
APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] + GetPVarInt(playerid"PVarMoney");
        
// Clear the PVar
        
SetPVarInt(playerid"PVarMoney"0);
    }
    if (
GetPVarInt(playerid"PVarScore") != 0)
    {
        
// Add the money to the players account
        
APlayerData[playerid][PlayerScore] = APlayerData[playerid][PlayerScore] + GetPVarInt(playerid"PVarScore");
        
// Clear the PVar
        
SetPVarInt(playerid"PVarScore"0);
    }
    
// Reset the player's money and set it to the stored value in the player's account (do the same for scorepoints)
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playeridAPlayerData[playerid][PlayerMoney]);
    
SetPlayerScore(playeridAPlayerData[playerid][PlayerScore]);
    
// Limit the cash that the player can have
    
if (APlayerData[playerid][PlayerMoney] > 999000000)
        
APlayerData[playerid][PlayerMoney] = 999000000;
    
// Limit the cash that the player can have below 0
    
if (APlayerData[playerid][PlayerMoney] < -1000000)
        
APlayerData[playerid][PlayerMoney] = -1000000;
    
// Port anyone out of the area who is not an admin and inside the area 69
    
Player_PortOutAdminZone(playerid106.01805.0, -50.0285.01940.040.015.01732.025.0);
    
// Weapon hacks are also neutralized here, except for police players (if they are allowed to have weapons)
    
if ((PoliceGetsWeapons == true) && (APlayerData[playerid][PlayerClass] == ClassPolice))
    {
        
// Do nothing
    
}
    else
        
ResetPlayerWeapons(playerid); // Remove all weapons from the player
    // Check if the player got any armour (= health-hack)
    
GetPlayerArmour(playeridArmour);
    
// Send an automated report to the admins so they're informed about it and can take action
    
if (Armour 1.0)
        
SendReportToAdmins(playerid"Health-hack"true);
    
// Check if the speed is higher than 300 (kick player if it is)
    // Send an automated report to the admins so they're informed about it and can take action
    
if (APlayerData[playerid][PlayerSpeed] > 300)
        
SendReportToAdmins(playerid"Speed-hack"true);
    
// Check if the player is not allowed to have a jetpack (admins lvl 3 and higher can use /fly, so they will be excluded)
    
if (APlayerData[playerid][PlayerLevel] < 3)
    {
        
// Check if the player is using a jetpack
        // Send an automated report to the admins so they're informed about it and can take action
        
if (GetPlayerSpecialAction(playerid) == 2)
            
SendReportToAdmins(playerid"Jetpack-hack"true);
    }
    
// Detect airbreak hack
    
if (GetPlayerVehicleSeat(playerid) == 0)
    {
        
// Check if the player is nearly standing still
        
if (APlayerData[playerid][PlayerSpeed] < 10)
        {
            
// Check if the player switched interior-id's
            
if (GetPlayerInterior(playerid) != APlayerData[playerid][PreviousInt])
            {
                
// Check if the new interior is the normal world or any mod-shop
                
switch (GetPlayerInterior(playerid))
                {
                    case 
0123// Check interiors 0, 1, 2 and 3 (normal world and all mod-shops)
                    
{
                        
// Store the player's current location and interior-id for the next iteration
                        
GetPlayerPos(playeridAPlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
                        
APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
                        
// Exit the function
                        
return 1;
                    }
                }
            }
            
// Check if the player is still near the same place he was half a second ago
            
if (IsPlayerInRangeOfPoint(playerid7.5APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]))
            {
            }
            else 
// Send an automated report to the admins so they're informed about it and can take action
                
SendReportToAdmins(playerid"Airbreak-hack"true);
        }
    }
    
// Store the player's current location and interior-id for the next iteration
    
GetPlayerPos(playeridAPlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
    
APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
    return 
1;

and it does not give money for the mission that i have in my fs
plz help me
Reply
#2

Bump
Reply
#3

Show us the code where you give the player the money from your mission.
Reply
#4

PHP код:
This functions gives the player the given amount of money and scorepoints
RewardPlayer
(playeridMoneyPoints)
{
    
// Add the given amount of money to the player's account
    
APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] + Money;
    
// Add the given amount of scorepoints to the player's account
    
APlayerData[playerid][PlayerScore] = APlayerData[playerid][PlayerScore] + Points;

Reply
#5

is it k ?
Reply
#6

This is the ppc trucking,and is imposible to not work because all this is in gamemode not in fs .But if you make a fs with a new job i recommend to use the PVar that is in top of this topic.
Reply
#7

Quote:
Originally Posted by Banditul18
Посмотреть сообщение
This is the ppc trucking,and is imposible to not work because all this is in gamemode not in fs .But if you make a fs with a new job i recommend to use the PVar that is in top of this topic.
k so you mean to make a fs with money saving to the gm system ?
Reply
#8

Quote:

and it does not give money for the mission that i have in my fs
You said you have a fs with a job, and yeah to make to give you money from the the fs to the player use the pvars, because that antihack will reset the money you earn from the fs.
Reply
#9

Yeah i understood
but is there a way to get a tuto for me using playervariable ?
Reply
#10

if i save it in same folder will it collide after each step ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)