anti cheat error
#1

can someone tell me where is mistake,error is at 20 line!! error 010: invalid function or declaration
Код:
#include <a_samp>
#include <foreach>
#define BELA            "{FFFFFF}"
#define CRVENA          "{F81414}"

new Float:Armour;

public OnFilterScriptInit()
{
    SetTimer("AntiHack", 1000, true);
    return 1;
}

public OnPlayerUpdate(playerid)

    GetPlayerArmour(playerid, Armour);
	if(Armour == 99.0) ////////////////////////////////////20 line
    {
    ShowPlayerDialog(playerid,-1,DIALOG_STYLE_MSGBOX,""SVETLOCRVENA"[Anti-Cheat]"BELA" Kikovan si zbog koriscenja Armour Hack-a"); TogglePlayerControllable(playerid, false);
   	SetPlayerPos(playerid, 1941.1534,-1100.2391,-23.7885);
    ShowPlayerDialog(playerid,PRAVILA,DIALOG_STYLE_MSGBOX,"{FFCC00}[Anticheat]"BELA"Kikovani ste sa servera\nRazlog kick-a:"CRVENA" Armour Hack","Ok","");
	BanEx(playerid, "Armour Hack");
    }
Reply
#2

pawn Код:
new Float:Armour[MAX_PLAYERS]
pawn Код:
GetPlayerArmour(playerid, Armour[playerid]);
pawn Код:
if(Armour[playerid] == 99.0)
Reply
#3

have two errors
1.(9) : error 001: expected token: ";", but found "public"
2.(13) : error 010: invalid function or declaration
Reply
#4

add a ; At the end of line 9
Reply
#5

now just 1 error

Код:
if(Armour[playerid] == 99.0)
Reply
#6

What's the error?
Reply
#7

Код:
	if(Armour[playerid] > 99.0)
(13) : error 010: invalid function or declaration
Reply
#8

pawn Код:
#include <a_samp>
#include <foreach>
#define BELA       "{FFFFFF}"
#define CRVENA     "{F81414}"

#define MAX_ARMOUR (99.0) // Max Armour allowed for a player is 99.0
#define DIALOG_PRAVILA (1000) // 1000 = DIALOG ID

public OnFilterScriptInit()
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    new Float:Armour;
    GetPlayerArmour(playerid, Armour);
    #if defined MAX_ARMOUR
    if(Armour == MAX_ARMOUR) ////////////////////////////////////20 line
    {
        TogglePlayerControllable(playerid, false);
        SetPlayerPos(playerid, 1941.1534,-1100.2391,-23.7885);
        ShowPlayerDialog(playerid, DIALOG_PRAVILA,DIALOG_STYLE_MSGBOX,"Anti-Hack", "{FFCC00}[Anticheat]"BELA"Kikovani ste sa servera\nRazlog kick-a:"CRVENA" Armour Hack","Ok","");
        BanEx(playerid, "Armour Hack");
    }
    #endif
    return 1;
}
Reply
#9

thanks
Reply
#10

pawn Код:
ShowPlayerDialog(playerid, DIALOG_PRAVILA,DIALOG_STYLE_MSGBOX,"Anti-Hack", "{FFCC00}[Anticheat]"BELA"Kikovani ste sa servera\nRazlog kick-a:"CRVENA" Armour Hack","Ok","");
Replace the current one with that, I messed up on the arguments on my first post.

You shouldn't be using OnPlayerUpdate(playerid) for a anticheat however.
Actually you should almost never use it, Have it go through a Timer or something instead
When the player connects.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)