SA-MP Forums Archive
[HELP]AntiHack - 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: [HELP]AntiHack (/showthread.php?tid=352706)



[HELP]AntiHack - Orhun_Kaya - 20.06.2012

Hello guys I create basic antihack system but only work id 0 here code help please

pawn Код:
//==================================[ANTIHACK]==================================
public AntiHackTimer()
{
  SetTimer("AntiHack", 1000, true);
}

forward AntiHack(playerid);
public AntiHack(playerid)
{
    if(!(PlayerInfo[playerid][pAdmin] <= 4)) return GivePlayerCash(playerid,0);
    else if(GetPlayerWeapon(playerid) == 39) SendClientMessage(playerid, COLOR_WHITE,"SERVER: Serverdan atildiniz.Sebep: Satchel Charge"),ANTI_SILAH(playerid);//Satchel Charge
    else if(GetPlayerWeapon(playerid) == 38) SendClientMessage(playerid, COLOR_WHITE,"SERVER: Serverdan atildiniz.Sebep: Minigun"),ANTI_SILAH(playerid);//Minigun
    else if(GetPlayerWeapon(playerid) == 37) SendClientMessage(playerid, COLOR_WHITE,"SERVER: Serverdan atildiniz.Sebep: Flamethrower"),ANTI_SILAH(playerid);//Flamethrower
    else if(GetPlayerWeapon(playerid) == 36) SendClientMessage(playerid, COLOR_WHITE,"SERVER: Serverdan atildiniz.Sebep: HS Rocket"),ANTI_SILAH(playerid);//HS Rocket
    else if(GetPlayerWeapon(playerid) == 35) SendClientMessage(playerid, COLOR_WHITE,"SERVER: Serverdan atildiniz.Sebep: RPG Launcer"),ANTI_SILAH(playerid);//RPG Launcer
    else if(GetPlayerCash(playerid)   >= PARA_LIMIT) SendClientMessage(playerid, COLOR_WHITE,"SERVER: Paraniz sifirlandi.Sebep: Server para limitini gecti."), ANTI_PARA(playerid);//Anti-Para
    return 1;
}



Respuesta: [HELP]AntiHack - Chris1337 - 20.06.2012

i think you should use : SetTimerEx


Re: [HELP]AntiHack - Kindred - 20.06.2012

In-case you do not know how to use SetTimerEx:

pawn Код:
SetTimerEx("AntiHack",1000,true,"d",playerid);
Your previous code didn't have a playerid parameter.


Re: [HELP]AntiHack - Orhun_Kaya - 21.06.2012

Quote:
Originally Posted by Kindred
Посмотреть сообщение
In-case you do not know how to use SetTimerEx:

pawn Код:
SetTimerEx("AntiHack",1000,true,"d",playerid);
Your previous code didn't have a playerid parameter.
thanks