[Ajuda] Anti Hacker de vida - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Anti Hacker de vida (
/showthread.php?tid=483771)
Anti Hacker de vida -
IGp - 27.12.2013
Bom gente, fiz esse mini sistema, adicionei a forward e a public no final do gamemode, sу no final.
pawn Код:
forward CaradeHack(playerid);
public CaradeHack(playerid)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health > 150.0)
{
SetPlayerHealth(playerid, 100);
Kick(playerid);
return 1;
}
return 1;
}
O codigo й esse, meu Gm й em base do god father, que quando vocк digita /beber (bebida) ele sobe a vida, vai subindo atй 250.0. E queria que quando passasse de 150 o player й kickado. Se alguem estiver disposto a ajudar, agredeзo muito \o/
Re: Anti Hacker de vida -
iDreak - 27.12.2013
pawn Код:
public OnPlayerConnect(playerid) {
SetTimerEx("CaradeHack", 5000, true, "f", playerid);
return true;
}
forward CaradeHack(playerid);
public CaradeHack(playerid) {
new Float:health;
GetPlayerHealth(playerid,health);
if(health > 150.0) {
SetPlayerHealth(playerid, 100);
Kick(playerid);
return 1;
}
return 1;
}
nem testei mais vк ai se nгo der avise
Re: Anti Hacker de vida -
IGp - 27.12.2013
Deu certo, porйm quando um administrador loga, ele fica de godmode, e automaticamente й kickado..
Consegue esssa?
@EDIT
Fiz isso:
pawn Код:
forward CaradeHack(playerid);
public CaradeHack(playerid)
{
if(PlayerInfo[playerid][pAdmin] <= 1)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health > 150.0)
{
SetPlayerHealth(playerid, 100);
Kick(playerid);
}
}
return 1;
}
Deu certo aqui, coloquei o PlayerInfo.
Obrigado ! +REP