Spectating a random player
#7

Quote:
Originally Posted by iggy1
Посмотреть сообщение
pawn Код:
#include <foreach>//you need this include

new randomplayer = Iter_Random(Player);
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid,randomplayer);
You will want to do some additional checks to make sure you don't spec yourself ect.
No i think i don't need to add some code ...
pawn Код:
public OnPlayerSpawn(playerid)
{
        if(EndRoundCounter != 0)//if the round is busy ..
        {

            SendClientMessage(playerid, COLOR_RED,"Sorry, you can't join while the round is in progress, you have to wait ...");
            SendClientMessage(playerid, COLOR_ORANGE,"While you have to wait, you can specate some players");
            GameTextForPlayer(playerid, "~y~Round in progress ...", 1250, 3);
            for(new i; i<MAX_PLAYERS; i++)
            {
                new randomplayer = Iter_Random(Player);
                TogglePlayerSpectating(playerid, 1);
                PlayerSpectateVehicle(playerid,randomplayer);
            }

        }
        //.....
Im using it under OnPlayerSpawn()
Reply


Messages In This Thread
Spectating a random player - by Michael@Belgium - 11.04.2011, 08:38
Re: Spectating a random player - by iggy1 - 11.04.2011, 08:44
Re: Spectating a random player - by Michael@Belgium - 11.04.2011, 08:47
Re: Spectating a random player - by iggy1 - 11.04.2011, 08:50
Re: Spectating a random player - by Mean - 11.04.2011, 08:51
Re: Spectating a random player - by iggy1 - 11.04.2011, 08:53
Re: Spectating a random player - by Michael@Belgium - 11.04.2011, 08:54
Re: Spectating a random player - by Mean - 11.04.2011, 08:54
Re: Spectating a random player - by iggy1 - 11.04.2011, 08:57
Re: Spectating a random player - by Michael@Belgium - 11.04.2011, 08:58

Forum Jump:


Users browsing this thread: 1 Guest(s)