Noob...
#2

pawn Код:
forward Infected(playerid);
public Infected(playerid)
{
    SetPlayerHealth(playerid,GetPlayerHealth(playerid)-2);
    SetTimerEx("Infected",1000,0,"i",playerid); // -2 hp per second
    return 1;
}

CMD:infect(playerid,params[])
{
    new targetid;
    if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Infect <playerid>");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Invalid ID.");
    else
    {
            new metin[512];
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            new target[MAX_PLAYER_NAME];
            GetPlayerName(targetid, target, sizeof(target));
            SetTimerEx("Infected",100,0,"i",targetid);
            format(metin, sizeof(metin), "INFO: You have made %s infected!",target);
            SendClientMessage(playerid, -1, metin);
            format(metin, sizeof(metin), "WARNING: You have been infected by %s!",name);
            SendClientMessage(targetid, -1, metin);
    }
    return 1;
}
Reply


Messages In This Thread
Noob... - by DizzY2306 - 23.07.2012, 18:26
Re: Noob... - by Matz - 23.07.2012, 19:06
Re: Noob... - by DizzY2306 - 23.07.2012, 19:20
Re: Noob... - by DizzY2306 - 26.07.2012, 13:11
Re: Noob... - by TaLhA XIV - 26.07.2012, 13:15
Re: Noob... - by Matz - 26.07.2012, 13:17
Re: Noob... - by DizzY2306 - 26.07.2012, 13:34
Re: Noob... - by doreto - 26.07.2012, 13:47
Re: Noob... - by doreto - 26.07.2012, 13:54
Re: Noob... - by DizzY2306 - 26.07.2012, 19:15

Forum Jump:


Users browsing this thread: 1 Guest(s)