Making interiors....
#1

Hello,
I wanted to ask that is there a way in which we can make interiors dark,I want to make commands like /lightson,off.Just a random idea.
ThAnKs!
Reply
#2

Anyone?Just tell me if there a way?
Reply
#3

Nope. Maybe you can create light objects and another command to delete them.
Reply
#4

Actually, you could do this with text draws. Sounds funny, but works.
Reply
#5

Can I have a textdraw which is covering all of the screen?
ThAnKs!
Reply
#6

I'll get to work on an example and get back to you.
Reply
#7

ThAnKs!
Reply
#8

pawn Код:
new Text:HouseLightsText;

public OnGameModeInit()
{
    HouseLightsText = TextDrawCreate(0.0,00.0,"D");
    TextDrawAlignment(HouseLightsText,0);
    TextDrawBackgroundColor(HouseLightsText,0x00000000);
    TextDrawFont(HouseLightsText,1);
    TextDrawLetterSize(HouseLightsText,200.0,400.0);
    TextDrawColor(HouseLightsText,0x000000A9);
    TextDrawSetOutline(HouseLightsText,false);
    TextDrawSetProportional(HouseLightsText,false);
    TextDrawSetShadow(HouseLightsText,false);
    TextDrawUseBox(HouseLightsText, true);
    TextDrawBoxColor(HouseLightsText, 0x000000A9);
};

public OnPlayerLogin(playerid,password[])
{
    TextDrawHideForPlayer(playerid, HouseLightsText);
    for(new h; h<MAX_HOUSES; h++)
    {
         if(HouseInfo[h][ID] > 0)
         {
              if(strcmp(HouseInfo[h][Owner], sendername) == 0)
          {
                 PlayerInfo[playerid][pHouses] ++;
           }
          }
     }
         return 1;
}          

//add this where your house enter command is
if(HouseInfo[h][Lights] != 1)//If they are off
    {
        TextDrawShowForPlayer(playerid, HouseLightsText);
    }


CMD:lights(playerid)
{
   
    if(PlayerInfo[playerid][pLocal]-1000 >= 0)
    {
        new house = PlayerInfo[playerid][pLocal]-1000;
        if(!IsPlayerInRangeOfPoint(playerid, 4.0, HouseInfo[house][ExitX], HouseInfo[house][ExitY], HouseInfo[house][ExitZ]))
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "You must be next to the light switch (at the front door).");
            return 1;
        }
        if(HouseInfo[house][Lights] == 0)// off
        {
            HouseInfo[house][Lights] = 1;
            foreach(Player,i)
            {
                if(PlayerInfo[i][pLocal] == house+1000)
                {
                    TextDrawHideForPlayer(i, HouseLightsText);
                }
            }
            TextDrawHideForPlayer(playerid, HouseLightsText);
            SendClientMessage(playerid, COLOR_LIGHTGREEN, "* Lights ON");
            return 1;
        }
        else if(HouseInfo[house][Lights] == 1)// on
        {
            HouseInfo[house][Lights] = 0;
            foreach(Player,i)
            {
                if(PlayerInfo[i][pLocal] == house+1000)
                {
                    TextDrawShowForPlayer(i, HouseLightsText);
                }
            }
            TextDrawShowForPlayer(playerid, HouseLightsText);
            SendClientMessage(playerid, COLOR_LIGHTGREEN, "* Lights OFF");
            return 1;
        }
I created this a while back, from an old script I had, so some things will need changing.
Reply
#9

lol tHaNkS! But I wanted the textdraw only cuse my house system is diffrent,thanks.+rep(not good with textdraws.)
Reply
#10

The textdraw makes the screen darker, giving the impression that lights are turned off. /lights removes the textdraw, making it brighter.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)