Antihack help - 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: Antihack help (
/showthread.php?tid=386187)
Antihack help -
Gamer_007 - 19.10.2012
PHP код:
//Antihack
#include <a_samp>
#define COLOR_YELLOW "{FFFF00}"
new Text:banmessage;
public OnFilterScriptInit()
{
printf("Anti Minigun By [A]Gamer_007 is loading now");
printf("Anti Minigun By [A]Gamer_007 loaded");
printf("NO WEAPON HACKS IN YOUR SERVER.ENJOY");
banmessage = TextDrawCreate(190,200,"~r~Nice Hacks but Here they are not allowed.~n~~y~You are banned from this server.");
TextDrawFont(banmessage, 2);
TextDrawLetterSize(banmessage, 0.6, 1.0);
TextDrawSetShadow(banmessage, 0);
TextDrawSetOutline(banmessage, 1);
return 1;
}
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
public OnPlayerUpdate(playerid)
{
new string[128],Weapon,Ammo;
GetPlayerWeaponData(playerid, 7, Weapon,Ammo);
if(Weapon == 38 && !IsPlayerAdmin(playerid)) {
format(string,128,"{FF0000}%s[%d] Has Been Banned From Server.[Reason: Minigun Hacking]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
BanEx(playerid, "Lozer_Minigun");
}
GetPlayerWeaponData(playerid, 7, Weapon,Ammo);
if(Weapon == 36 && !IsPlayerAdmin(playerid)) {
format(string,128,"{FF0000}%s[%d] Has Been Banned From Server.[Reason: Heat Saker]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
BanEx(playerid, "Lozer_Minigun");
}
if(Weapon == 35 && !IsPlayerAdmin(playerid)) {
format(string,128,"{FF0000}%s[%d] Has Been Banned From Server.[Reason: Rocket Launcher Hack]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
BanEx(playerid, "Lozer_Minigun");
}
This is my code and when I compile it it gives this
PHP код:
C:\Users\DEVILS\Desktop\Antiminigunnn.pwn(56) : error 030: compound statement not closed at the end of file (started at line 30)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
Re: Antihack help -
Riddick94 - 19.10.2012
Close OnPlayerUpdate callback with closing bracket. Because the last bracket closing if statement, not callback. And you don't need to GetPlayerWeaponData double of times, enough will be single time on the top.
Re: Antihack help -
Danyal - 19.10.2012
PHP код:
//Antihack
#include <a_samp>
#define COLOR_YELLOW "{FFFF00}"
new Text:banmessage;
public OnFilterScriptInit()
{
printf("Anti Minigun By [A]Gamer_007 is loading now");
printf("Anti Minigun By [A]Gamer_007 loaded");
printf("NO WEAPON HACKS IN YOUR SERVER.ENJOY");
banmessage = TextDrawCreate(190,200,"~r~Nice Hacks but Here they are not allowed.~n~~y~You are banned from this server.");
TextDrawFont(banmessage, 2);
TextDrawLetterSize(banmessage, 0.6, 1.0);
TextDrawSetShadow(banmessage, 0);
TextDrawSetOutline(banmessage, 1);
return 1;
}
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
public OnPlayerUpdate(playerid)
{
new string[128],Weapon,Ammo;
GetPlayerWeaponData(playerid, 7, Weapon,Ammo);
if(Weapon == 38 && !IsPlayerAdmin(playerid)) {
format(string,128,"{FF0000}%s[%d] Has Been Banned From Server.[Reason: Minigun Hacking]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
BanEx(playerid, "Lozer_Minigun");
}
GetPlayerWeaponData(playerid, 7, Weapon,Ammo);
if(Weapon == 36 && !IsPlayerAdmin(playerid)) {
format(string,128,"{FF0000}%s[%d] Has Been Banned From Server.[Reason: Heat Saker]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
BanEx(playerid, "Lozer_Minigun");
}
if(Weapon == 35 && !IsPlayerAdmin(playerid)) {
format(string,128,"{FF0000}%s[%d] Has Been Banned From Server.[Reason: Rocket Launcher Hack]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
BanEx(playerid, "Lozer_Minigun");
}
}
Re: Antihack help -
RanSEE - 19.10.2012
You probably did not indent properly.