How to create a command check?
#1

Hello! How do you check whether your health and armour in full in the spelling of command?
Reply
#2

in ZCMD:
pawn Код:
CMD:checkhanda(playerid, params[])
{
    new Float:Health, Float:Armour;
    GetPlayerHealth(playerid, Health);
    GetPlayerArmour(playerid, Armour);
    if ( Health == 100 && Armour == 100)
    {
         SendClientMessage(playerid, -1, "You Have Both Health And Armour Full"):
    }
    else
    {
        SendClientMessage(playerid, -1, "You Don't Have Your Health And Armour Full");
    }
    return 1;
}
If u want to check if he has armour and give another msg, tell me.. REP if HELPED
Reply
#3

Well I made this, it will tell you how much Armor and Health you have... I'm not sure if this is exactly what you want..

pawn Код:
if(strcmp(cmd, "/check", true) == 0)
    {
    new string[100];
    new Float: AR;
    new Float: HP;
    GetPlayerArmour(playerid, Float:AR);
    GetPlayerHealth(playerid, Float:HP);
    format(string, sizeof(string), "Health: %f, Armor: %f",Float:HP, Float: AR);
    SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
    return 1;
    }
Reply
#4

I want to check whether it is full health and armour, and if to perform command.
Reply
#5

pawn Код:
if(strcmp(cmd, "/check", true) == 0)
{
    new string[100];
    new Float: AR;
    new Float: HP;
    GetPlayerArmour(playerid, Float:AR);
    GetPlayerHealth(playerid, Float:HP);
    if(AR == 100 && HP == 100);
    {
         //Command
    }
    return 1;
}
Reply
#6

Thanks! Lock.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)