21.10.2012, 04:45
Guys here is my antihack script.Now see wht is wrong in it.
PHP код:
//Antihack
#include <a_samp>
#define COLOR_YELLOW "{FFFF00}"
new Text:banmessage;
new dm[MAX_PLAYERS];
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;
}
CMD:dm(playerid,parms[])
{
dm(playerid) = 1;//set a palyer dm value to 1
//My tele co ordinate here
return 1;
}
public OnPlayerUpdate(playerid)
{
if(dm(playerid) == 1){
return 1;
}
else
{
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 Hack]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
Ban(playerid);
}
if(Weapon == 36 && !IsPlayerAdmin(playerid)) {
format(string,128,"{FF0000}%s[%d] Has Been Banned From Server.[Reason: Heat Saker Hack]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
Ban(playerid);
}
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);
Ban(playerid);
}
return 1;
}