30.11.2013, 22:51
Hey guys I want to make my own anti weapon hack, for start I searched a bit but there are only simple hack to ban players with minigun, granades and so on... than I saw few really complicated scripts that I don't like.. so I decided to make my own anti weapon hack system.. so what I want to make is.. there are shops where I can buy weapons (few locations with pickups and there is possible to write /buygun to buy weapon) so I want to detect if player buy weapon there will be all cool, if he didn't bought it he will be kicked / banned from server..
this is what I tried - I tried with commands cuz I didn't create pickups yet it should be same effect:
The problem is when It resets the veriable it auto resets my weapons (I figured out why but I don't know how to change it so it can work ^^) .. and so on, can someone explain me a bit how can I make it and give me some tips maybe example? Thank you very much in advance
this is what I tried - I tried with commands cuz I didn't create pickups yet it should be same effect:
pawn Код:
public OnPlayerUpdate(playerid)
{
if(GetPlayerWeapon(playerid) == 1 && Check[playerid] == 0 || GetPlayerWeapon(playerid) == 2 && Check[playerid] == 0 || GetPlayerWeapon(playerid) == 5 || GetPlayerWeapon(playerid) == 6 || GetPlayerWeapon(playerid) == 7 || GetPlayerWeapon(playerid) == 8 || GetPlayerWeapon(playerid) == 10 || GetPlayerWeapon(playerid) == 11 || GetPlayerWeapon(playerid) == 12 || GetPlayerWeapon(playerid) == 13 ) //Put here the IDs of weapons you want, I'll post link after pawn.
{
ResetPlayerWeapons(playerid);
SendClientMessage(playerid,-1,"Hacking");
return 1;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/weap", true))
{
GivePlayerWeapon(playerid, 1,1);
Check[playerid] = 1;
SetTimerEx("Check1", 2000, false, "i", playerid);
return 1;
}
if(!strcmp(cmdtext, "/weapa", true))
{
GivePlayerWeapon(playerid, 2,1);
return 1;
}
return 0;
}
public Check1(playerid)
{
Check[playerid] = 0;
return 1;
}
public OnPlayerConnect(playerid)
{
Check[playerid] = 0;
return 1;
}