Need help with this Health Hack command please.
#1

Evening.
I'm seeking help for making this /hh command. I'm trying to make it, so if the player's health, OR armour is above 105 (the regular amount is 100) then it'll send a message to the player who did the command, telling them the result. Here's my current code.

pawn Code:
CMD:hh(playerid, params[])
{
    new iTarget;
    if(sscanf(params, "u", iTarget)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hh [PlayerID] (Spectate before exploding.)");
    {
        if(iTarget == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: That Player is not connected.");
        {
            if(PlayerInfo[playerid][pAdmin] >=3)
            {
                new TStr[256];
                new pStr[256];
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid,pname,sizeof(pname));
                new tname[MAX_PLAYER_NAME];
                GetPlayerName(iTarget, tname,sizeof(tname));
                format(pStr,sizeof(pStr), "You have checked %s for health hacks.",tname);
                format(TStr,sizeof(TStr), "You've been checked for health hacks by Administrator %s.",pname);
                SendClientMessage(iTarget, COLOR_TAN, TStr);
                SendClientMessage(playerid, COLOR_GREEN, pStr);
                new Float:health;
                new Float:armour;
                GetPlayerHealth(iTarget, health);
                GetPlayerArmour(iTarget, armour);
                if (armour > 105)
                {
                    SendClientMessage(playerid, COLOR_TAN, "Player is possibly hacking.");
                }
                else if (health > 105)
                {
                    SendClientMessage(playerid, COLOR_TAN, "Player is possibly hacking.");
                }
                else if(armour < 100.0)
                {
                    SendClientMessage(playerid, COLOR_TAN, "Player is NOT hacking.");
                }
                else if(health < 100.0)
                {
                    SendClientMessage(playerid, COLOR_TAN, "Player is NOT hacking.");
                }
            }
            else SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not authorized to use this command.");
        }
    }
    return 1;
}
I've tried messing with < and > for everything, really. What do I need to do?
Reply


Messages In This Thread
Need help with this Health Hack command please. - by rangerxxll - 08.03.2012, 23:00
Re: Need help with this Health Hack command please. - by Shabi RoxX - 08.03.2012, 23:06
Re: Need help with this Health Hack command please. - by Babul - 08.03.2012, 23:07
Re: Need help with this Health Hack command please. - by rangerxxll - 08.03.2012, 23:32

Forum Jump:


Users browsing this thread: 2 Guest(s)