Picking 1 person
#6

pawn Код:
stock GetRandomID()
{
    new rand, count = 0;
    do
    {
        rand = random(MAX_PLAYERS);
        count++;
    }
    while(!IsPlayerConnected(rand) && count < MAX_PLAYERS);
    if(count >= MAX_PLAYERS) return INVALID_PLAYER_ID;
    else
    return rand;
}
Just made it quickly, should work.

Use this:

pawn Код:
public Infected(playerid = GetRandomID())
{
    ResetPlayerWeapons(playerid);
    SetPlayerColor(playerid,Z_COLOR);
    SetPlayerTeam(playerid,TEAM_ZOMBIE);
    SetPlayerHealth(playerid,50);
    SetPlayerWeather(playerid,32);
    SetPlayerTime(playerid,24,0);
    new name[MAX_PLAYER_NAME], string4[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(string4, sizeof(string4), "Player %s has just been infected turned into [Zombie]",name);
    SendClientMessageToAll(COLOR_RED,string4);
    GameTextForPlayer(playerid,"~r~ YOU JUST BEEN ZOMBIFIED INTO INFECTED SIDE",6000,4);

    new skin = random(4);
    switch(skin)
    {
        case 0:SetPlayerSkin(playerid,Z_SKIN2);
        case 1:SetPlayerSkin(playerid,Z_SKIN);
        case 2:SetPlayerSkin(playerid,137);
    }
   
    return 1;
}
Reply


Messages In This Thread
Picking 1 person - by Kitten - 14.11.2010, 22:29
Re: Picking 1 person - by willsuckformoney - 14.11.2010, 23:24
Re: Picking 1 person - by Kitten - 14.11.2010, 23:26
Re: Picking 1 person - by Cameltoe - 14.11.2010, 23:29
Re: Picking 1 person - by Kitten - 14.11.2010, 23:32
Re: Picking 1 person - by The_Moddler - 14.11.2010, 23:33
Re: Picking 1 person - by Kitten - 14.11.2010, 23:39
Re: Picking 1 person - by The_Moddler - 14.11.2010, 23:40
Re: Picking 1 person - by Kitten - 14.11.2010, 23:41
Re: Picking 1 person - by Kitten - 14.11.2010, 23:47

Forum Jump:


Users browsing this thread: 1 Guest(s)