Decrease the health
#6

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
Give this a go, not tested:

pawn Код:
new decreaser[MAX_PLAYERS];
forward DecreaseHealth(playerid);

CMD:decrease(playerid, params[])
{
    new giveplayerid;
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Correct usage: /decrease [playerid/name]");
    if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "Player not connected.");
    decreaser[giveplayerid] = SetTimerEx("DecreaseHealth", 10000, true, "i", giveplayerid);
    SetPlayerHealth(giveplayerid, GetPlayerHealth(giveplayerid) - 5.0);
    return 1;
}

public DecreaseHealth(playerid) SetPlayerHealth(playerid, GetPlayerHealth(playerid) - 5.0);

public OnPlayerDeath(playerid, killerid, reason)
{
    KillTimer(decreaser[playerid]);
    return 1;
}
this is really an idea, thank you
Reply


Messages In This Thread
Decrease the health - by AnonScripter - 04.10.2013, 15:08
Re: Decrease the health - by Jankingston - 04.10.2013, 15:54
Re: Decrease the health - by Konstantinos - 04.10.2013, 15:58
Re: Decrease the health - by DanishHaq - 04.10.2013, 16:11
Re: Decrease the health - by AnonScripter - 04.10.2013, 16:13
Re: Decrease the health - by AnonScripter - 04.10.2013, 16:16
Re: Decrease the health - by [XST]O_x - 04.10.2013, 16:16
Re: Decrease the health - by AnonScripter - 04.10.2013, 16:18
Re: Decrease the health - by [XST]O_x - 04.10.2013, 16:20

Forum Jump:


Users browsing this thread: 1 Guest(s)