[FilterScript] Anti ESC (it work) Fixed - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Anti ESC (it work) Fixed (
/showthread.php?tid=431841)
Anti ESC (it work) Fixed -
MArkvane092 - 20.04.2013
well, I was looking for a system of anti esc, but I did not find any that were useful to me. For example, I was working with dialog, so I was wondering if the player was in the esc menu, using methods I've seen here, the player had to mess it up if he has put dialog he can not shake and also could not close the dialog is closed by the process would have to finish what he was doing. So I lembreime something that I had read a few days ace this topic
https://sampforum.blast.hk/showthread.php?tid=184118 by Slice (I'm a fan of the Slice) that the functions will be performed in wire and they sometimes can not be implemented until and had a part in that said when we heard the ESC so when he returned al game, then I remembered and made this system. I hope you like it and it will be useful. I tested and it works. I used two public because I was only with a SetPlayerHealth GetPlayerHealth and followed and not changed because life was too fast or there was an exchange of information as stated in
the topic of the slice
PawnCode
Code:
#include <a_samp>
new timeesc[MAX_PLAYERS];
forward veresc(playerid);
forward verfesc(Float:vida,playerid);
public OnPlayerConnect(playerid)
{
timeesc[playerid]=SetTimer("veresc",30000,true,"i",playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(timeesc[playerid]);
return 1;
}
public veresc(playerid)
{
new Float:vida;
GetPlayerHealth(playerid,vida);
SetTimerEx("verfesc",1000,false,"fi",vida,playerid);
SetPlayerHealth(playerid,vida - 1.0);
return 1;
}
public verfesc(Float:vida,playerid)
{
new Float:vidap;
GetPlayerHealth(playerid,vidap);
if(floatcmp(vida,vidap)==0)
{
SetPlayerHealth(playerid,vida);
Kick(playerid);
return 1;
}
SetPlayerHealth(playerid,vida);
return 0;
}
--- Sorry for my bad english... ---
Release by the owner
DartakousLien