Check if player is hacking
#1

<fixed>
Reply
#2

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
Reply
#3

<fixed>
Reply
#4

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

<fixed>
Reply
#6

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);
Reply
#7

<fixed>
Reply
#8

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)