i got a little question
#2

ZCMD + foreach.
pawn Код:
COMMAND:pinvisible(playerid, params[])
{
    if ( GetPVarInt ( playerid, "invisibleToggle" ) == 0 ) //Checks if they are currently invisible.
    {
        foreach(Player, i ) // Does a loop.
        {
            SetPlayerMarkerForPlayer    ( i, playerid, 0xFFFFFF00 ) ; //Sets the player's marker white / transparent.
            ShowPlayerNameTagForPlayer  ( i, playerid, 0 ); // Hides the nametags.
            SendClientMessage           ( playerid, 0xFFFFFFAA, "You're a ninja."); //Tell them they are invisible.
            SetPVarInt                  ( playerid, "invisibleToggle" , 1 ); //Set a variable so it would check on the command.
        }
        return 1;
    }
    else
    {
        foreach(Player , i )
        {
            SetPlayerMarkerForPlayer    ( i, playerid, 0xFF7700AA ) ; //Sets the player's marker to orange.
            ShowPlayerNameTagForPlayer  ( i, playerid, 0 ); // Show the nametags to players.
            SendClientMessage           ( playerid, 0xFFFFFFAA, "You have lost your ninja ability"); //Tell them they are not invisible.
            SetPVarInt                  ( playerid, "invisibleToggle" , 0 ); //Set a variable so it would check on the command.
        }
        return 1;
    }
}

NOT TESTED.
Reply


Messages In This Thread
i got a little question - by Andy_McKinley - 30.10.2010, 07:17
Re: i got a little question - by Retardedwolf - 30.10.2010, 07:59
Re: i got a little question - by Andy_McKinley - 30.10.2010, 08:01
Re: i got a little question - by Retardedwolf - 30.10.2010, 08:04
Re: i got a little question - by Andy_McKinley - 30.10.2010, 08:08
Re: i got a little question - by Retardedwolf - 30.10.2010, 08:17
Re: i got a little question - by Andy_McKinley - 30.10.2010, 08:17
Re: i got a little question - by Retardedwolf - 30.10.2010, 08:29
Re: i got a little question - by Andy_McKinley - 30.10.2010, 08:47
Re: i got a little question - by Retardedwolf - 30.10.2010, 09:09

Forum Jump:


Users browsing this thread: 1 Guest(s)