SA-MP Forums Archive
Check if player is hacking - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Check if player is hacking (/showthread.php?tid=272324)



Check if player is hacking - Kingunit - 27.07.2011

<fixed>


Re: Check if player is hacking - SpiderWalk - 27.07.2011

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
Hi,

I've made a command to check if a player is hacking (health hacks) it nearly works, but the messages are going wrong.
The messages:
pawn Код:
//Just a part of the code that is sending the message if he hacks or not
        if(health == 100)
        {
            SendClientMessage(playerid,COLOR_YELLOW,"Invulnerability check result : [POSITIVE]");
            checkinv = 0;
        }
        else if(health != 100)
        {
            SendClientMessage(playerid,COLOR_YELLOW,"Invulnerability check result : [NEGATIVE]");
            checkinv = 0;
        }
But there is something wrong, the message is going to the person where I did the hack test.
Not to the Administrator who did the command. By the way, I hope you understand the problem. But I can't find the solution.

` Kingunit
pawn Код:
//Just a part of the code that is sending the message if he hacks or not
        if(health == 1000)
        {
            SendClientMessage(playerid,COLOR_YELLOW,"Invulnerability check result : [POSITIVE]");
            checkinv = 0;
        }
        else if(health != 100)
        {
            SendClientMessage(playerid,COLOR_YELLOW,"Invulnerability check result : [NEGATIVE]");
            checkinv = 1;
        }
Maybe


Re: Check if player is hacking - Kingunit - 27.07.2011

<fixed>


Re: Check if player is hacking - Gamer_Z - 27.07.2011

if the playerid is the player you check the why are you sending the message to playerid and not an adminid or admingroup?


Re: Check if player is hacking - Kingunit - 27.07.2011

<fixed>


Re: Check if player is hacking - iPLEOMAX - 27.07.2011

You should add another parameter "adminid" to your callback.

Like CheckHealthHack(playerid, adminid);
after that, Use SendClientMessage(adminid,......

You are checking "playerid".. if you are sending message to playerid, he will see the message.
I hope you understand what i mean.

pawn Код:
public Explosion(playerid, adminid){
    if(checkinv == 1)
    {
        new Float:health;
        GetPlayerHealth(playerid,health);
        if(health == 100)
        {
            SendClientMessage(adminid,COLOR_YELLOW,"Invulnerability check result : [POSITIVE]");
            checkinv = 0;
        }
        else if(health != 100)
        {
            SendClientMessage(adminid,COLOR_YELLOW,"Invulnerability check result : [NEGATIVE]");
            checkinv = 0;
        }
    }
    return 1;
}

//Example: Admin ID 2 used /check on ID 54.
//Then:
Explosion(54, 2);



Re: Check if player is hacking - Kingunit - 27.07.2011

<fixed>


Re: Check if player is hacking - iPLEOMAX - 27.07.2011

PM Me your Check, Explosion and related codes. I'll do a fix.


Re: Check if player is hacking - Gamer_Z - 27.07.2011

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
I'm so bad with creating a new parameter. If I just copy + paste your new code sure I get a error. Can you help me with creating the new parameter? Via PM or just here, it doens't really matter for me. (If you want / have time)
maybe you should start with variable manipulation befor you get to function calls....
This was even easy for me whe I started learning pawn lol, you seriusly have a problem or you are a bit sleepy.
Ipleomax did everithing right, he explained it well, how could you not understand it? :O