Ummhhh
#8

pawn Код:
if(strcmp(cmd, "/infect", true) == 0)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new name2[MAX_PLAYER_NAME];

    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);

    new somebody_is_infected = 0;

    for(new i; i < MAX_PLAYERS; i++) // I would suggest you to use foreach
    {
        if(i != playerid)
        {
            GetPlayerName(i, name2, sizeof(name2));

            if(PlayerToPoint(1,i,x,y,z))
            {
                Inftimer = SetTimerEx("InfectedTimer",5000,true,"i",i);
                SendClientMessage(i,COLOR_RED,"You have been biten,you are now infected,Quickly get some antidote");
                Infected[i] = 1;
                new string[128];
                format(string,sizeof(string),"%s infected %s.",name1,name2);
                SendClientMessageToAll(YOURCOLOR,string);
                somebody_is_infected = 1;
            }
        }
    }

    if(somebody_is_infected == 0)
    {
        //add a message here that nobody has been infected
    }
    return 1;
}
Reply


Messages In This Thread
Ummhhh - by WardenCS - 16.12.2010, 15:11
Re: Ummhhh - by WardenCS - 16.12.2010, 17:28
Re: Ummhhh - by Baboon - 16.12.2010, 17:47
Re: Ummhhh - by WardenCS - 17.12.2010, 16:31
Re: Ummhhh - by WillyP - 17.12.2010, 16:35
Re: Ummhhh - by WardenCS - 18.12.2010, 14:11
Re: Ummhhh - by WardenCS - 18.12.2010, 20:25
Re: Ummhhh - by rs.pect - 18.12.2010, 20:41

Forum Jump:


Users browsing this thread: 1 Guest(s)