SA-MP Forums Archive
[Help] /hhcheck - 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)
+--- Thread: [Help] /hhcheck (/showthread.php?tid=517626)



[Help] Strings - BornHuman - 05.06.2014

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:
Can anyone help me? [REP+]


Re: [Help] /hhcheck - Jack_Leslie - 06.06.2014

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.


Re: [Help] /hhcheck - BornHuman - 06.06.2014

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:"