Author Topic: Check Cmd  (Read 9890 times)

0 Members and 1 Guest are viewing this topic.

Offline Only a Dude

  • Street Thug
  • *
  • Posts: 19
  • HELLO guys!!
    • View Profile
Check Cmd
« on: February 28, 2010, 07:56:40 pm »
I've done this Check Cmd, it is right?

Code: [Select]
alias vcmp.checkhealth {
  if ($vcmp.health($1, $vcmp.getid($1, $4)) == 100) {
    vcmp.say $1 Status: Cheats Detected!
    vcmp.cheatsdetected $1 $4
  }
  else vcmp.cheatsnotdetected
}
alias vcmp.checkarmour {
  if ($vcmp.armour($1, $vcmp.getid($1, $4)) == 100) {
    vcmp.say $1 Status: Cheats Detected!
    vcmp.cheatsdetected $1 $4
  }
  else vcmp.cheatsnotdetected

}
alias vcmp.cheatsnotdetected {
  vcmp.setlocation $1 $vcmp.getid($1, $4) -871.455, -683.325, 10.250
  vcmp.say $1 No cheats found!
  vcmp.setcontrols $1 $4 1
}
alias vcmp.cheatsdetected {
  vcmp.setlocation $1 $vcmp.getid($1, $4) 391.282, -506.863, 8.415
  vcmp.say $1 Cheats Detected!
  vcmp.say $1 Waiting for admins.
}
on *:SIGNAL:vcmp.player.command:{
  if ($3 == check) {
    if (!$4) vcmp.msg $1 $2 Error - Correct Syntax: ! $+ $3 <id/nick>
    elseif (. isin $4) || (, isin $4) || vcmp.msg $1 $2 Error - No negative or decimal amounts
    elseif ($vcmp.name($1, $vcmp.id($4)) == $vcmp.name($1, $2)) vcmp.msg $1 $2 Error -  You cannot Check Yourself.
    elseif (%check == on) vcmp.msg $1 $2 Checking is already in progress, please try again later.
    else {
      var %check = on
      timer 1 3 vcmp.setlocation $1 $vcmp.getid($1, $4) -968.704, -1455.056, 44.168
      timer 1 3 vcmp.say $1 Checking $vcmp.name($1, $4) ...
      timer 1 3 vcmp.setcontrols $1 $4 0
      timer 1 5 vcmp.sethealth $1 $4 100
      timer 1 5 vcmp.setarmour $1 $4 100
      timer 1 6 vcmp.sethealth $1 $4 75
      timer 1 6 vcmp.setarmour $1 $4 75
      timer 1 7 vcmp.checkarmour $1 $4
      timer 1 7 vcmp.checkhealth $1 $4
    }
  }
}

------------------------------------------------

some oral sex ^^

Offline [AoD]NC

  • VC:MP Beta Tester
  • VC:MP Veteran
  • *
  • Posts: 616
  • AoD forever!
    • View Profile
    • KURWA MAĆ
Re: Check Cmd
« Reply #1 on: February 28, 2010, 08:45:03 pm »
If players HP is 100 == hax? Nononono. Change it to HP > 100.

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Check Cmd
« Reply #2 on: February 28, 2010, 09:54:40 pm »
== 100 would be fine, as he sets the health to 75

Offline Javi

  • VC:MP Beta Tester (inactive)
  • Made Man
  • *
  • Posts: 149
    • View Profile
Re: Check Cmd
« Reply #3 on: February 28, 2010, 10:38:05 pm »
What if the player's hack sets the HP to +100?  :-X

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Check Cmd
« Reply #4 on: March 01, 2010, 12:43:26 am »
ok, change it to

if ($vcmp.health($1, $vcmp.getid($1, $4)) > 75) {

Offline Only a Dude

  • Street Thug
  • *
  • Posts: 19
  • HELLO guys!!
    • View Profile
Re: Check Cmd
« Reply #5 on: March 01, 2010, 03:40:28 pm »
thx thijn,

I changed it to

Code: [Select]
alias vcmp.checkhealth {
  if ($vcmp.health($1, $vcmp.getid($1, $4)) > 75) {
    vcmp.say $1 Status: Cheats Detected!
    vcmp.cheatsdetected $1 $4
  }
  else vcmp.cheatsnotdetected
}
alias vcmp.checkarmour {
  if ($vcmp.armour($1, $vcmp.getid($1, $4)) > 75) {
    vcmp.say $1 Status: Cheats Detected!
    vcmp.cheatsdetected $1 $4
  }
  else vcmp.cheatsnotdetected

}
alias vcmp.cheatsnotdetected {
  vcmp.setlocation $1 $vcmp.getid($1, $4) -871.455 -683.325 10.250
  vcmp.say $1 No cheats found!
  vcmp.setcontrols $1 $4 1
  var %check = off
  vcmp.setarmour $1 $4 0
  vcmp.sethealth $1 $4 100
}
alias vcmp.cheatsdetected {
  vcmp.setlocation $1 $vcmp.getid($1, $4) 391.282 -506.863 8.415
  vcmp.say $1 Cheats Detected!
  vcmp.say $1 Waiting for admins.  
  var %check = off
}
on *:SIGNAL:vcmp.player.command:{
  if ($3 == check) {
    if (!$4) vcmp.msg $1 $2 Error - Correct Syntax: ! $+ $3 <id/nick>
    elseif (. isin $4) || (, isin $4) || vcmp.msg $1 $2 Error - Invalid ID
    elseif ($vcmp.name($1, $vcmp.id($4)) == $vcmp.name($1, $2)) vcmp.msg $1 $2 Error -  You cannot Check Yourself.
    elseif (%check == on) vcmp.msg $1 $2 Checking is already in progress, please try again later.    
    else {
      var %check = on
      timer 1 3 vcmp.setlocation $1 $vcmp.getid($1, $4) -968.704, -1455.056, 44.168
      timer 1 3 vcmp.say $1 Checking $vcmp.name($1, $4) ...
      timer 1 3 vcmp.setcontrols $1 $4 0
      timer 1 5 vcmp.sethealth $1 $4 100
      timer 1 5 vcmp.setarmour $1 $4 100
      timer 1 8 vcmp.sethealth $1 $4 75
      timer 1 8 vcmp.setarmour $1 $4 75
      timer 1 10 vcmp.checkarmour $1 $4
      timer 1 10 vcmp.checkhealth $1 $4
    }
  }
}

But I am not sure for the working of %check
« Last Edit: March 01, 2010, 03:49:57 pm by Only a Dude »

------------------------------------------------

some oral sex ^^

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Check Cmd
« Reply #6 on: March 01, 2010, 05:28:54 pm »
ye indeed, it has to be set %check

Offline Only a Dude

  • Street Thug
  • *
  • Posts: 19
  • HELLO guys!!
    • View Profile
Re: Check Cmd
« Reply #7 on: March 01, 2010, 05:51:55 pm »
thanks thijn, you are the best!

:P

the correct source:
Code: [Select]
alias vcmp.checkhealth {
  if ($vcmp.health($1, $vcmp.getid($1, $4)) > 75) {
    vcmp.say $1 Status: Cheats Detected!
    vcmp.cheatsdetected $1 $4
  }
  else vcmp.cheatsnotdetected
}
alias vcmp.checkarmour {
  if ($vcmp.armour($1, $vcmp.getid($1, $4)) > 75) {
    vcmp.say $1 Status: Cheats Detected!
    vcmp.cheatsdetected $1 $4
  }
  else vcmp.cheatsnotdetected

}
alias vcmp.cheatsnotdetected {
  vcmp.setlocation $1 $vcmp.getid($1, $4) -871.455 -683.325 10.250
  vcmp.say $1 No cheats found!
  vcmp.setcontrols $1 $4 1
  set %check = off
  vcmp.setarmour $1 $4 0
  vcmp.sethealth $1 $4 100
}
alias vcmp.cheatsdetected {
  vcmp.setlocation $1 $vcmp.getid($1, $4) 391.282 -506.863 8.415
  vcmp.say $1 Cheats Detected!
  vcmp.say $1 Waiting for admins. 
  set %check = off
}
on *:SIGNAL:vcmp.player.command:{
  if ($3 == check) {
    if (!$4) vcmp.msg $1 $2 Error - Correct Syntax: ! $+ $3 <id/nick>
    elseif (. isin $4) || (, isin $4) || vcmp.msg $1 $2 Error - Invalid ID
    elseif ($vcmp.name($1, $vcmp.id($4)) == $vcmp.name($1, $2)) vcmp.msg $1 $2 Error -  You cannot Check Yourself.
    elseif (%check == on) vcmp.msg $1 $2 Checking is already in progress, please try again later.   
    else {
      set %check = on
      timer 1 3 vcmp.setlocation $1 $vcmp.getid($1, $4) -968.704, -1455.056, 44.168
      timer 1 3 vcmp.say $1 Checking $vcmp.name($1, $4) ...
      timer 1 3 vcmp.setcontrols $1 $4 0
      timer 1 5 vcmp.sethealth $1 $4 100
      timer 1 5 vcmp.setarmour $1 $4 100
      timer 1 8 vcmp.sethealth $1 $4 75
      timer 1 8 vcmp.setarmour $1 $4 75
      timer 1 10 vcmp.checkarmour $1 $4
      timer 1 10 vcmp.checkhealth $1 $4
    }
  }
}

------------------------------------------------

some oral sex ^^

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Check Cmd
« Reply #8 on: March 01, 2010, 06:09:34 pm »
the difference between set and var is that the var needs an =, set doesn't.

so, this should work:
Code: [Select]
alias vcmp.checkhealth {
  if ($vcmp.health($1, $vcmp.getid($1, $4)) > 75) {
    vcmp.say $1 Status: Cheats Detected!
    vcmp.cheatsdetected $1 $4
  }
  else vcmp.cheatsnotdetected
}
alias vcmp.checkarmour {
  if ($vcmp.armour($1, $vcmp.getid($1, $4)) > 75) {
    vcmp.say $1 Status: Cheats Detected!
    vcmp.cheatsdetected $1 $4
  }
  else vcmp.cheatsnotdetected

}
alias vcmp.cheatsnotdetected {
  vcmp.setlocation $1 $vcmp.getid($1, $4) -871.455 -683.325 10.250
  vcmp.say $1 No cheats found!
  vcmp.setcontrols $1 $4 1
  set %check off
  vcmp.setarmour $1 $4 0
  vcmp.sethealth $1 $4 100
}
alias vcmp.cheatsdetected {
  vcmp.setlocation $1 $vcmp.getid($1, $4) 391.282 -506.863 8.415
  vcmp.say $1 Cheats Detected!
  vcmp.say $1 Waiting for admins. 
  set %check off
}
on *:SIGNAL:vcmp.player.command:{
  if ($3 == check) {
    if (!$4) vcmp.msg $1 $2 Error - Correct Syntax: ! $+ $3 <id/nick>
    elseif (. isin $4) || (, isin $4) || vcmp.msg $1 $2 Error - Invalid ID
    elseif ($vcmp.name($1, $vcmp.id($4)) == $vcmp.name($1, $2)) vcmp.msg $1 $2 Error -  You cannot Check Yourself.
    elseif (%check == on) vcmp.msg $1 $2 Checking is already in progress, please try again later.   
    else {
      set %check on
      timer 1 3 vcmp.setlocation $1 $vcmp.getid($1, $4) -968.704, -1455.056, 44.168
      timer 1 3 vcmp.say $1 Checking $vcmp.name($1, $4) ...
      timer 1 3 vcmp.setcontrols $1 $4 0
      timer 1 5 vcmp.sethealth $1 $4 100
      timer 1 5 vcmp.setarmour $1 $4 100
      timer 1 8 vcmp.sethealth $1 $4 75
      timer 1 8 vcmp.setarmour $1 $4 75
      timer 1 10 vcmp.checkarmour $1 $4
      timer 1 10 vcmp.checkhealth $1 $4
    }
  }
}

Offline Only a Dude

  • Street Thug
  • *
  • Posts: 19
  • HELLO guys!!
    • View Profile
Re: Check Cmd
« Reply #9 on: March 01, 2010, 10:19:40 pm »
thanks thijn, you are the best!
again thanks!!!

------------------------------------------------

some oral sex ^^

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Check Cmd
« Reply #10 on: March 02, 2010, 12:39:11 am »
No problem ;)

Offline chn batista

  • Wiseguy
  • **
  • Posts: 66
  • nothing
    • View Profile
Re: Check Cmd
« Reply #11 on: March 02, 2010, 03:47:46 pm »
i want to use it on pawno server thijn can you help me? thanks ;)

Offline Ettans

  • VC:MP Beta Tester
  • Wiseguy
  • *
  • Posts: 56
    • View Profile
Re: Check Cmd
« Reply #12 on: March 02, 2010, 03:57:16 pm »
I did an automatic HP/Armour check for you. It runs every minute and checks if the players HP or Armour is over 75.

Code: [Select]
/* Add to the top of your gamemode */
forward AntiCheat(playerid);

/* Add to OnGameModeInit callback */
SetTimer("AntiCheat",60000,1);

/* Add anywhere in your script */
public AntiCheat(playerid)
{
    for(new i = 0; i < 50; i++)
    {
        if(IsPlayerConnected(i))
{
    new Float:hp,
Float:armour;

    if(GetPlayerHealth(i,hp) > 75)
    {
        /* HP over 75, do your stuff here */
    }
    else if(GetPlayerArmour(i,armour) > 75)
    {
        /* Armour over 75, do your stuff here */
    }
        }
    }
    return 1;
}

Pastebin link: http://pastebin.com/BkRanF2a

Offline chn batista

  • Wiseguy
  • **
  • Posts: 66
  • nothing
    • View Profile
Re: Check Cmd
« Reply #13 on: March 02, 2010, 04:24:37 pm »
I did an automatic HP/Armour check for you. It runs every minute and checks if the players HP or Armour is over 75.

Code: [Select]
/* Add to the top of your gamemode */
forward AntiCheat(playerid);

/* Add to OnGameModeInit callback */
SetTimer("AntiCheat",60000,1);

/* Add anywhere in your script */
public AntiCheat(playerid)
{
    for(new i = 0; i < 50; i++)
    {
        if(IsPlayerConnected(i))
{
    new Float:hp,
Float:armour;

    if(GetPlayerHealth(i,hp) > 75)
    {
        /* HP over 75, do your stuff here */
    }
    else if(GetPlayerArmour(i,armour) > 75)
    {
        /* Armour over 75, do your stuff here */
    }
        }
    }
    return 1;
}

Pastebin link: http://pastebin.com/BkRanF2a
thank you very much! :)

Offline chn batista

  • Wiseguy
  • **
  • Posts: 66
  • nothing
    • View Profile
Re: Check Cmd
« Reply #14 on: March 02, 2010, 04:36:47 pm »
forward AntiCheat(playerid);
where i add that? top of gamemode? where?