2 Questions :
#7

pawn Код:
dcmd_health(playerid, params[])
{
    new
        giveplayerid, tmp[256], tmp2[256], idx,
        amount, string[156];
        tmp=strtok(params, idx); tmp2=strtok(params, idx);
    if(!strlen(tmp) || !strlen(tmp2)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /health [playerid] [amount]");
    giveplayerid=strval(tmp); amount=strval(tmp2);
    if (!IsPlayerConnected(giveplayerid)) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
    if (amount > 100) SendClientMessage(playerid, 0xFF0000AA, "Invalid health");
    else
    {
        new Float:hh; GetPlayerHealth(playerid, hh);
        SetPlayerHealth(giveplayerid, amount);
        SetPlayerHealth(playerid, hh-10);
        format(string,sizeof(string),"life's й [%i]",amount);
        SendClientMessageToAll(COR_BRANCO, string);
    }
    return 1;
}
Try this.

And I did not get the thing with the -10 HP. I just made that if you set someones health, your own health will be set 10 lower.
Reply


Messages In This Thread
2 Questions : - by felipex - 16.07.2010, 13:41
Re: 2 Questions : - by felipex - 16.07.2010, 13:59
Re: 2 Questions : - by tanush - 16.07.2010, 14:06
Re: 2 Questions : - by felipex - 16.07.2010, 14:09
Re: 2 Questions : - by Jeffry - 16.07.2010, 14:10
Re: 2 Questions : - by felipex - 16.07.2010, 14:18
Re: 2 Questions : - by Jeffry - 16.07.2010, 14:26
Re: 2 Questions : - by felipex - 16.07.2010, 14:35

Forum Jump:


Users browsing this thread: 2 Guest(s)