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