Script problem
#4

Here is a good method,
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(heal, 4, cmdtext);
    return 0;
}

dcmd_heal(playerid, params[])
{
    new id Float:amount;
    if (sscanf(params, "df", id,amount))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /heal <playerid> <amount>");
    if(id != INVALID_PLAYER_ID)
    {
        if(amount <= 100.0 && amount >= 1)
        {
            SetPlayerHealth(id,amount);
            return 1;
        }
        else return SendClientMessage(playerid, 0xFF0000AA, "Error: Invalid Amount");
    }
    else return SendClientMessage(playerid, 0xFF0000AA, "Error: Player not found");
}
Not tested but should work.

Edit: Delete that apple fuction all it does is returns 2. Unless for some reason you need that, I cant see why though.
This
pawn Код:
stock apple(playerid)
{
    return 1+1;
}
Might aswell be
pawn Код:
stock apple(playerid)
{
    return 2;
}
Reply


Messages In This Thread
Script problem - by typedef - 31.07.2010, 22:07
Re: Script problem - by cofy1 - 31.07.2010, 22:15
Re: Script problem - by cofy1 - 31.07.2010, 23:27
Re: Script problem - by iggy1 - 31.07.2010, 23:43
Re: Script problem - by typedef - 01.08.2010, 00:58
Re: Script problem - by iggy1 - 01.08.2010, 16:14

Forum Jump:


Users browsing this thread: 2 Guest(s)