House System Problem
#1

I've had lots of problems with this tiny piece of script, the problem is that when I type the command at My house. It works but the chat is spammed for me. When i get to another person's house. This code does not work. I need some help from you guys to help me fix it.

PHP код:
case DIALOG_HOUSEPASSWORDENTER:
{
    if(
response)
    {
        if(
strlen(inputtext) != 4)
        {
            
ShowPlayerDialog(playeridDIALOG_HOUSEPASSWORDENTERDIALOG_STYLE_INPUT,""COL_YELLOW"Lock Password (Numbers Only)",""COL_WHITE"Enter The House Password","Confirm","Close");
            return 
true;
        }
        for(new 
0MAX_HOUSESx++)
        {
               new 
pName4[MAX_PLAYER_NAME];
            new 
string41[128];
            new 
labelString[128];
            
GetPlayerName(playeridpName4MAX_PLAYER_NAME);
            if(
house[x][hLockCode] == strval(inputtext))
            {
                switch(
house[x][hHouseLocked])
                {
                    case 
1:
                    {
                        
format(string41sizeof(string41), "%s places their fingers on the keypad"pName4);
                        
SendLocalMessage(playeridstring4115.0COLOR_PURPLECOLOR_PURPLE);
                        
house[x][hHouseLocked] = 0;
                        
format(labelStringsizeof(labelString), "House ID: %d\nOwner: %s\n\nPress ~k~~PED_DUCK~ to enter."xhouse[x][hHouseOwner]);
                        
UpdateDynamic3DTextLabelText(house[x][hLabelID], COLOR_LIMEGREENlabelString);
                    }
                    case 
0:
                    {
                         
format(string41sizeof(string41), "%s places their fingers on the keypad"pName4);
                        
SendLocalMessage(playeridstring4115.0COLOR_PURPLECOLOR_PURPLE);
                        
house[x][hHouseLocked] = 1;
                        
format(labelStringsizeof(labelString), "House ID: %d\nOwner: %s\n\n(Locked)"xhouse[x][hHouseOwner]);
                        
UpdateDynamic3DTextLabelText(house[x][hLabelID], COLOR_LIMEGREENlabelString);
                    }
                }
                break;
            }
            else
            {
                
format(string41sizeof(string41), "%s places their fingers on the keypad"pName4);
                
SendLocalMessage(playeridstring4115.0COLOR_PURPLECOLOR_PURPLE);
                
PlayerActionMessage(playerid,15.0,"Incorrect Password");
            }
         }
    }

Thanks for your time, I've spent a lot of time trying different ways to get this to work but sadly it didn't.

The script saves and loads the code perfectly. I just have a problem with this part.
Reply


Messages In This Thread
House System Problem - by MadSkillz - 06.06.2012, 21:09
Re: House System Problem - by Yuryfury - 07.06.2012, 01:43
Re: House System Problem - by MadSkillz - 07.06.2012, 08:54
Re: House System Problem - by MadeMan - 07.06.2012, 09:01
Re: House System Problem - by MadSkillz - 07.06.2012, 09:16
Re: House System Problem - by MadeMan - 07.06.2012, 09:24
Re: House System Problem - by MadSkillz - 07.06.2012, 09:25

Forum Jump:


Users browsing this thread: 1 Guest(s)