The Death Timer!!
#5

Whole command.

Not Tested
pawn Код:
new InfectedTimer[MAX_PLAYERS];

COMMAND:infect(playerid, params[])
{
    new targetid;
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /infect [playeris | name]");
    else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFAA, "That player is not connected");
    {
        InfectedTimer[playerid] = SetTimerEx("Infected", 1000, true, "d", targetid);
        SendClientMessage(playerid, 0xFFFFFFAA, "You infected someone");
        SendClientMessage(targetid, 0xFFFFFFAA, "Someone infected you");
    }
    return 1;
}

forward Infected(playerid);
public Infected(playerid)
{
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    if(Health >= 5)
    {
        SetPlayerHealth(playerid, Health - 5);
    }
    else
    {
        SetPlayerHealth(playerid, 0.0);
        KillTimer(InfectedTimer[playerid]);
        SendClientMessageToAll(0xFFFFFFAA, "Someone died of a infection");
    }
    return 1;
}
Reply


Messages In This Thread
The Death Timer!! - by Swiftz - 13.05.2011, 15:42
Re: The Death Timer!! - by Hobod - 13.05.2011, 15:44
Re: The Death Timer!! - by [SU]Balli - 13.05.2011, 15:51
Re: The Death Timer!! - by __ - 13.05.2011, 15:54
Re: The Death Timer!! - by Laronic - 13.05.2011, 15:59
Re: The Death Timer!! - by __ - 13.05.2011, 16:01
Re: The Death Timer!! - by Laronic - 13.05.2011, 16:03
Re: The Death Timer!! - by Swiftz - 13.05.2011, 16:12
Re: The Death Timer!! - by Laronic - 13.05.2011, 16:14
Re: The Death Timer!! - by Swiftz - 13.05.2011, 16:19

Forum Jump:


Users browsing this thread: 10 Guest(s)