Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: a1046596108 on August 24, 2013, 07:27:59 am

Title: I need help with kick health hack
Post by: a1046596108 on August 24, 2013, 07:27:59 am
This is public
[pawn]public healthkick(playerid)
{
if (HP >= 99)
   Kick( playerid );
   return 1;
}
[/pawn]

OnPlayerConnect i SetPlayerHealth(playerid,98); OnPlayerSpawn i SetPlayerHealth(playerid,98); OnGameModeInit i SetTimer("healthkick",100,1);

After I compile without error

Is this useful?

Title: Re: I need help with kick health hack
Post by: [AoD]NC on August 24, 2013, 02:50:48 pm
Huh?

What "i"? Is this english or polish :>?
Title: Re: I need help with kick health hack
Post by: NeskWriter on August 25, 2013, 12:03:04 am
This is public
[pawn]public healthkick(playerid)
{
if (HP >= 99)
   Kick( playerid );
   return 1;
}
[/pawn]

OnPlayerConnect i SetPlayerHealth(playerid,98); OnPlayerSpawn i SetPlayerHealth(playerid,98); OnGameModeInit i SetTimer("healthkick",100,1);

After I compile without error

Is this useful?

It may be useful, but u have admitted a mistake. Remove the parameter (I mean playerid) in your public(healthkick I mean), because any variable is set to 0 by definition (for example, "new zero" 's value is 0 after "zero" declared. So this will only check if player with ID 0 is hacker (read note about SetTimer).

Well, if you want to check every player on availability of hacks, you should make a cycle.
Clean the code in ur public and type this:
[pawn]new p; //we declared a new variable called "p"
[/pawn]
Now let's start a cycle. Type this below:
[pawn]for(p = 0; p < MAX_PLAYERS; p++)//the cycle declared, p = 0, p < MAX_PLAYERS, and p + 1
{
new Float:ph; // declaring a new Float called "ph".
GetPlayerHealth(p, ph); // getting p's health (p is now player, bcuz we wanted this, and ph is float to store player's health we got.
if(ph >= 99)//the condition checks if the float "ph"'s value is 99 more
{
    SendClientMessage(p, 0xFF0000AA, "Go use ur shitty healhack on another server, you, little dickhead"); // we ask the "p" to remove hacks
    Kick(p); // we kick Pe
}
}
return 1;
}[/pawn]

lemme check if it works, I will tell u.

Oh, ye. set the interval of SetTimer to 1000, cuz 100 will eat ur memory
Title: Re: I need help with kick health hack
Post by: a1046596108 on September 20, 2013, 05:44:47 am
thank.you very much!! ;D
Title: Re: I need help with kick health hack
Post by: a1046596108 on September 20, 2013, 07:42:37 am
This is public
[pawn]public healthkick(playerid)
{
if (HP >= 99)
   Kick( playerid );
   return 1;
}
[/pawn]

OnPlayerConnect i SetPlayerHealth(playerid,98); OnPlayerSpawn i SetPlayerHealth(playerid,98); OnGameModeInit i SetTimer("healthkick",100,1);

After I compile without error

Is this useful?

It may be useful, but u have admitted a mistake. Remove the parameter (I mean playerid) in your public(healthkick I mean), because any variable is set to 0 by definition (for example, "new zero" 's value is 0 after "zero" declared. So this will only check if player with ID 0 is hacker (read note about SetTimer).

Well, if you want to check every player on availability of hacks, you should make a cycle.
Clean the code in ur public and type this:
[pawn]new p; //we declared a new variable called "p"
[/pawn]
Now let's start a cycle. Type this below:
[pawn]for(p = 0; p < MAX_PLAYERS; p++)//the cycle declared, p = 0, p < MAX_PLAYERS, and p + 1
{
new Float:ph; // declaring a new Float called "ph".
GetPlayerHealth(p, ph); // getting p's health (p is now player, bcuz we wanted this, and ph is float to store player's health we got.
if(ph >= 99)//the condition checks if the float "ph"'s value is 99 more
{
    SendClientMessage(p, 0xFF0000AA, "Go use ur shitty healhack on another server, you, little dickhead"); // we ask the "p" to remove hacks
    Kick(p); // we kick Pe
}
}
return 1;
}[/pawn]

lemme check if it works, I will tell u.

Oh, ye. set the interval of SetTimer to 1000, cuz 100 will eat ur memory
thank you very much!!!!!!! ;)
Title: Re: I need help with kick health hack
Post by: NE.Restricted on October 19, 2013, 12:40:20 pm
This is public
[pawn]public healthkick(playerid)
{
if (HP >= 99)
   Kick( playerid );
   return 1;
}
[/pawn]

OnPlayerConnect i SetPlayerHealth(playerid,98); OnPlayerSpawn i SetPlayerHealth(playerid,98); OnGameModeInit i SetTimer("healthkick",100,1);

After I compile without error

Is this useful?
Is this useful?
No. Most hackers use 2012 trainer. They could do:
/heal 98 1
This set their health to 98 constant. This means, if they receive damage, the health reverts to 98