[Help] /hhcheck
#1

So, I've took some time to make the following stock for a /hhcheck command.

pawn Код:
stock HealthHackCheck(playerid)
{
    new Float:x,Float:y,Float:z;
    new Float:healthbeforecheck;
    new Float:healthaftercheck;
    new string[128];
   
    new GetHHCheckVW = GetPlayerVirtualWorld(playerid);
    new GetHHCheckInt = GetPlayerInterior(playerid);
   
    GetPlayerPos(playerid, x, y, z);
    Player[playerid][HHCheckVW] = GetHHCheckVW;
    Player[playerid][HHCheckInt] = GetHHCheckInt;
    GetPlayerHealth(playerid, healthbeforecheck);

    new Float:x,Float:y,Float:z;
    SetPlayerInterior(playerid, 10);
    SetPlayerVirtualWorld(playerid, 50);
    SetPlayerPos(playerid, 0, 0, 0);
    GetPlayerPos(playerid, x, y, z);
    CreateExplosion(x, y, z, 10, 100.0);
   
    GetPlayerHealth(playerid, healthaftercheck);
   
    format(string, sizeof(string), "%s was just Health Hack Checked. Health before check: %s. Health after check: %s", GetName(playerid), GetPlayerHealth(playerid, healthbeforecheck), GetPlayerHealth(playerid, healthaftercheck));
    SendToAdmins(ADMINORANGE, string, 0);
    SendToAdmins(ADMINORANGE, "If their health dropped, he/she may not be hacking. If it stayed the same, he/she may be hacking, or desynced. Make sure before banning them.", 0);
   
    SetPlayerHealth(playerid, healthbeforecheck);
    SetPlayerPos(playerid, x, y, z);
    SetPlayerVirtualWorld(playerid, GetHHCheckVW);
    SetPlayerInterior(playerid, GetHHCheckInt);
    return 1;
}
However, I'm having a few problems:
  • It doesn't set your location to 0, 0, 0 or any virtualworld/interior when it creates the explosion. (either that or the script does it so fast I can't see it with my eye)
  • It isn't stating the players health before and after the check in the string, it just leaves them blank.
Can anyone help me? [REP+]
Reply
#2

Change:
pawn Код:
format(string, sizeof(string), "%s was just Health Hack Checked. Health before check: %s. Health after check: %s", GetName(playerid), GetPlayerHealth(playerid, healthbeforecheck), GetPlayerHealth(playerid, healthaftercheck));
To:
pawn Код:
format(string, sizeof(string), "%s was just Health Hack Checked. Health before check: %s. Health after check: %s", GetName(playerid),  healthbeforecheck, healthaftercheck);
You are already getting the players health before the string, once you get it and store it into the variable, you just use the variable, you don't need to 're-get it' until it changes (or obviously in another command). In regards to setting the position to 0, 0, 0, try setting it to an unused area or interior, instead of 0 0 0.
Reply
#3

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Change:
pawn Код:
format(string, sizeof(string), "%s was just Health Hack Checked. Health before check: %s. Health after check: %s", GetName(playerid), GetPlayerHealth(playerid, healthbeforecheck), GetPlayerHealth(playerid, healthaftercheck));
To:
pawn Код:
format(string, sizeof(string), "%s was just Health Hack Checked. Health before check: %s. Health after check: %s", GetName(playerid),  healthbeforecheck, healthaftercheck);
You are already getting the players health before the string, once you get it and store it into the variable, you just use the variable, you don't need to 're-get it' until it changes (or obviously in another command). In regards to setting the position to 0, 0, 0, try setting it to an unused area or interior, instead of 0 0 0.
Same problem, just now it cuts off after saying "Health before check:"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)