/sethp command not working
#4

I don't know how to use sscanf and y_cmd etc..
Okay I deleted one of the strtok's and when not inserting any numbers, it returns the USAGE message I wrote like should. Now the problem is when you insert an id and then it still returns "Server: Unknown Command"

pawn Код:
if(strcmp("/sethp", cmdtext, true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!strlen(tmp))
                return SendClientMessage(playerid, -1, "USAGE: /sethp [playerid/PartOfName] [health]");
            new playa;
            new health;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            health = strval(tmp);
            if(IsPlayerConnected(playa))
            {
                if(playa != INVALID_PLAYER_ID)
                {
                    new playername[MAX_PLAYER_NAME+1];
                    GetPlayerName(playerid, playername, sizeof(playername));
                    SetPlayerHealthAM(playa, health);
                    format(string, sizeof(string), "Your health has been set to %d by %s (%d)", health, playername, playerid);
                    SendClientMessage(playerid, -1, string);
                }
                else
                    return SendClientMessage(playerid, -1, "{FF0000}ERROR: Player is not connected!");
            }
            else
                return SendClientMessage(playerid, -1, "{FF0000}ERROR: Player is not connected!");
        }
        return 1;
    }
Reply


Messages In This Thread
/sethp command not working - by arad55 - 04.08.2014, 22:07
Respuesta: /sethp command not working - by Cepillado - 04.08.2014, 22:24
Re: /sethp command not working - by ViniBorn - 04.08.2014, 22:26
Re: /sethp command not working - by arad55 - 04.08.2014, 22:37
Respuesta: /sethp command not working - by Cepillado - 04.08.2014, 22:45
Re: /sethp command not working - by arad55 - 04.08.2014, 22:55
Re: /sethp command not working - by TLN - 04.08.2014, 22:59
Respuesta: /sethp command not working - by Cepillado - 04.08.2014, 23:04
Re: /sethp command not working - by arad55 - 04.08.2014, 23:05
Re: /sethp command not working - by Don_Cage - 04.08.2014, 23:11

Forum Jump:


Users browsing this thread: 3 Guest(s)