30.10.2010, 07:59
ZCMD + foreach.
NOT TESTED.
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.