anti cheat error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: anti cheat error (
/showthread.php?tid=558518)
anti cheat error -
lanix - 17.01.2015
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");
}
Re: anti cheat error -
mahdi499 - 17.01.2015
pawn Код:
new Float:Armour[MAX_PLAYERS]
pawn Код:
GetPlayerArmour(playerid, Armour[playerid]);
pawn Код:
if(Armour[playerid] == 99.0)
Re: anti cheat error -
lanix - 17.01.2015
have two errors
1.(9) : error 001: expected token: ";", but found "public"
2.(13) : error 010: invalid function or declaration
Re: anti cheat error -
mahdi499 - 17.01.2015
add a ; At the end of line 9
Re: anti cheat error -
lanix - 17.01.2015
now just 1 error
Код:
if(Armour[playerid] == 99.0)
Re: anti cheat error -
mahdi499 - 17.01.2015
What's the error?
Re: anti cheat error -
lanix - 17.01.2015
Код:
if(Armour[playerid] > 99.0)
(13) : error 010: invalid function or declaration
Re: anti cheat error -
Lynn - 17.01.2015
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;
}
Re: anti cheat error -
lanix - 17.01.2015
thanks
Re: anti cheat error -
Lynn - 17.01.2015
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.